apidoc example project
Compare Verison 0.3.0 with 0.2.0 and you will see the green markers with new items in version 0.3.0 and red markers with removed items since 0.2.0.
GET /user/:id
Name | Type | Description |
---|---|---|
id | String | The Users-ID. |
CURL example:
curl -i -X POST http://localhost:3001/example
-H 'Content-Type: application/json' \
-d '{ "id": "4711" }'
Success-Response (example):
HTTP/1.1 200 OK
{
"id": "4711"
"registered": "31.01.2013"
"name": "John Doe"
}
Error-Response (example):
HTTP/1.1 401 Not Authenticated
{
"error": "NoAccessRight"
}
In this case "apiErrorStructure" is defined and used. Define blocks with params that will be used in several functions, so you dont have to rewrite them.
POST /user
Name | Type | Description |
---|---|---|
name | String | Name of the User. |
Response (example):
HTTP/1.1 400 Bad Request
{
"error": "UserNameTooShort"
}
This function has same errors like POST /user, but errors not defined again, they were included with "apiErrorStructure"
PUT /user/:id
Name | Type | Description |
---|---|---|
name | String | Name of the User. |
Response (example):
HTTP/1.1 400 Bad Request
{
"error": "UserNameTooShort"
}