API Documentation Template
Try to group several API endpoints (e.g. set of CRUD APIs) into a separate md file. This way the documentation will contain a separate section with all related API calls. Please provide first a description of what this "group" of API calls represent
API Description
For each API call that belongs to this "group" of API calls, provide relevant title that describes what this API does. Also provide additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).
Request
Endpoint
GET
| POST
| DELETE
| PUT
The URL Structure (path only, no root url)
Path Parameters
Sometime a part of the URL path might be variable. For example, it could contain a user ID or a tenant ID or similar. Describe here which parameters are expected and what they represent.
Parameter | Description |
---|---|
pathparam1 | describe what this parameter is about |
pathparam2 | describe what this parameter is about |
URL/Query parameters
Query parameters are typical .
Parameter | Description |
---|---|
queryparam1 | describe what this parameter is about |
queryparam2 | describe what this parameter is about |
queryparam3 | describe what this parameter is about |
Body parameters
Describe which parameters (and their type) are expected in the body. If no body is supported/needed, you can remove this section
Parameter | Type | Description | Required |
---|---|---|---|
bodyparam1 | string | Simple string | yes |
bodyparam2 | integer | Simple integer | yes |
bodyparam3 | object | Complex object | no |
Describe which parameters (and their type) are expected in the body. If no body is supported/needed, you can remove this section
bodyparam3
Parameter | Type | Description | Required |
---|---|---|---|
subparameter1 | string | Simple string | yes |
subparameter2 | integer | Simple integer | yes |
Example
POST /api/v1/org/1949/sites/
{
"name": "test",
"userLimit": 100,
"address": {
"addressLine1": "Koekoekstraat 77",
"zipCode": "8090",
"city": "Melle"
}
}
Response
Status codes
Parameter | Description |
---|---|
200 | Resource created |
400 | Bad request because ... |
500 | Uncatched error on server side |
Success
Body
Parameter | Type | Description | Conditinal |
---|---|---|---|
respbodyparam1 | string | Simple string | no |
respbodyparam2 | integer | Simple integer | no |
Example
{
"uuid": "8391-3KKkJOE-23883"
}
Error
Body
Parameter | Type | Description | Conditinal |
---|---|---|---|
respbodyparam1 | string | Simple string | no |
respbodyparam2 | integer | Simple integer | no |
Example
{
"message": "You are not lucky today"
}
API Description 2
More Related API's can follow here