All responses are returned in JSON. But some internal errors are responded when HTTP header ‘Accept’ contains ‘text/html’ and the server runs in debug mode.
All responses are returned in the same format.
{
"response_code": HTTP_RESPONSE_CODE,
"message": ERROR_MESSAGE,
"more_info": ERROR_DETAIL_URL,
"code": ERROR_CODE
"body": RESPONSE_BODY
}
Data: |
|
---|
Error stack trace written in HTML.
Response body for a single user is below.
{
"id": USER_ID,
"name": USER_NAME
}
Data: |
|
---|
Response body for multiple users is below.
[
['id', 'name'],
[USER_ID_1, USER_NAME_1],
...
]
Data: |
|
---|
Query params: | name (string) – new user name |
---|---|
Opt. params: | supress_response_codes (boolean) – returns response with code 200 always. The response code is in the response body. |
Responses: |
|
Opt. params: |
|
---|---|
Responses: | 200 – list successfully. |
Opt. params: | supress_response_codes (boolean) – returns response with code 200 always. The response code is in the response body. |
---|---|
Responses: | 200 – delete all users successfully. |
Show the user.
Opt. params: |
|
---|---|
Responses: |
|
If exists update the user. If not error.
Opt. params: |
|
---|---|
Responses: |
|
Delete the user.
Opt. params: |
|
---|---|
Responses: |
|
Returns user count.
Opt. params: | supress_response_codes (boolean) – returns response with code 200 always. The response code is in the response body. |
---|---|
Responses: | 200 – count successfully. |