--- title: Effiapi test suite author: Lars Wirzenius ... # Test scenarios This chapter descibes the effiapi API, as a [yarn][] automated scenario test. It is meant to be understandable to Effi sysadmins, as well as be an executable test suite for the API. The API is a simple RESTful HTTP API using JSON. This means that: * each API call is an HTTP request, with a response * all data is represented as JSON in the body of the request of response * metadata about the data is represeneted as HTTP headers * standard HTTP verbs (POST, PUT, GET, DELETE) are used to indicate the action * standard HTTP status codes are used to indicate result of the request (200 = OK, 404 = not found, etc) ## Manage memberships This section shows the API calls to manage a memberhip: to create the member, to update and retrieve it, and to search memberships. ~~~ SCENARIO Manage memberships GIVEN An effiapi instance WHEN admin requests POST /memb with body { "fullname": "James Bond" } THEN the member id is ID WHEN admin requests GET /memb with header Muck-Id: ${ID} THEN HTTP status 200 AND HTTP body matches { "fullname": "James Bond" } ~~~ TODO: * update * delete * search * members can see their own data, and can't see each others' * member follows authn link emailed to them # Appendix: Yarn scenario step implementations