Response Codes
The API returns appropriate HTTP status codes in addition to JSON-based error codes and messages for every request.
HTTP Status Codes
Code | Text | Description |
---|---|---|
200 | OK | Success! |
400 | Bad Request | The request was invalid or cannot be otherwise served. |
401 | Unauthorized | Missing or incorrect authentication credentials. |
404 | Not Found | The URI requested does not exist. |
500 | Internal Server Error | Something is broken in backend. |
JSON-based Error Messages and Error Codes
There are two types of JSON-based error messages:
- Type 1 Example
{ "error": "not_found", "error_description": "Resource /service/facilities/computer_room_pc_status/abc not found!" }
- Type 2 Example
{ "fault": { "code": 900902, "message": "Missing Credentials", "description": "Required OAuth credentials not provided. Make sure your API invocation call has a header: \"Authorization: Bearer ACCESS_TOKEN\"" } }
Type 2 error responses are raised by WSO2 API Manager. This webpage lists the error codes and corresponding meanings.
https://docs.wso2.com/display/AM210/Error+Handling