{% extends "rest_framework/api_basics.html" %} {% block description %}
Each API response contains a JSON-encoded object in the HTTP body, which contains 3 attributes:
Here is a sample response from a request that ended successfully:
{
"error": null,
"result": {
"serial": 1007,
"name": "ibox007",
"version": "1.5.3.2",
"type": "InfiniBox",
"api_url": "https://ibox007",
"api_username": "admin",
"created": "2016-11-16T13:11:58Z",
"modified": "2016-12-18T15:06:01Z",
"monitored_entities": "https://infinimetrics/api/rest/systems/1007/monitored_entities/",
"annotations": "https://infinimetrics/api/rest/systems/1007/annotations/"
},
"metadata": {
"ready": true
}
}
Here is a sample response from a request that ended with an error:
{
"error": {
"message": "Not found"
},
"result": null,
"metadata": {
"ready": true
}
}
In case of a bad request (HTTP 400), the response also includes an additional list of details:
{
"error": {
"message": "Bad request",
"details": [
"Unknown filter field: 'color' (choices are serial, name, version, api_url, api_username, created, modified)"
]
},
"result": null,
"metadata": {
"ready": true
}
}
The API returns each response with one of the following HTTP status codes:
| HTTP 200 | Successful OPTIONS, GET, PUT or PATCH request |
|---|---|
| HTTP 201 | Successful POST request |
| HTTP 204 | Successful DELETE request |
| HTTP 400 | Bad request (e.g. validation failure) |
| HTTP 403 | Missing or invalid credentials |
| HTTP 404 | Not found |
| HTTP 405 | Method not allowed |
| HTTP 406 | The request data is in an unsupported content type |