Template:RestAPI
From Coder Merlin
Revision as of 08:35, 19 October 2021 by David-ben-yaakov (talk | contribs)
Parameters:
- endpoint
- string: The endpoint. Verb and url. REQUIRED.
- action
- string: A description of the purpose of the endpoint.
- parameters
- string: A list of parameters for the endpoint.
- body
- string: Specification of the JSON body.
- statsCode
- string: Status code of the response.
- response
- string: The response from the server.
- responseExample
- string: An example response.
Example:
{{RestAPI |endpoint=POST /games?difficulty=<difficulty> |action=Creates a new game and associated board |parameters=difficulty: easy | medium | hard | hell |body=<span style="font-style: italic;">none</span> |statusCode=201 Created |response=ID (integer) of newly created game {"id":<id>} |responseExample={"id": 728134} |errors=400 Bad Request (difficulty invalid) }}