Inspecting API response codes
To inspect response codes
All API responses are assigned specific numeric response codes that allow you to quickly identify if a request to an endpoint has been successful or, if not, why it was not successful.
You can inspect response codes via curl by adding the --include
option:
curl -X POST -s <the Acronis data center URL>/<Acronis product API location>/status \ --header Authorization: Bearer <your token> \ --data "{...}" --include
Success codes
HTTP/1.1 200 OK <...> {"created_by": "f90e086b...","last_access_at": "2020-05-22T10:13:28+00:00","tenant_id": "e5afb5e8...", ...}
Error codes
For an error code, the platform can respond with a JSON object in the response body, containing information about the specific error. These codes are specific to each API and endpoint.
Value |
Description |
---|---|
|
A platform code or an HTTP code. Platform codes and descriptions are detailed in the individual API chapters. |
|
A short descriptive message with the error reason. |
|
An object with additional information on the error. |
|
A service or service component where the error has occurred. |
For example:
HTTP/1.1 400 Bad Request <...> {"error":{"code":1006,"message":"It is prohibited to delete a non-disabled tenant.","details":{"info":"It is prohibited to delete a non-disabled tenant "1415032"","addition":[{"id":"1415032"}]},"context":{"id":"1415032"},"domain":"PlatformAccountServer"}}