Response Codes 2018-04-20T16:01:21+08:00

Response Codes

The API returns appropriate HTTP status codes in addition to JSON-based error codes and messages for every request.

HTTP Status Codes

CodeTextDescription
200OKSuccess!
400Bad RequestThe request was invalid or cannot be otherwise served.
401UnauthorizedMissing or incorrect authentication credentials.
404Not FoundThe URI requested does not exist.
500Internal Server ErrorSomething 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