Response Codes


Response codes reverted back to user from Crawford systems are based on RESTful standards. User can expect the same style of response for each request invoked on api.

Response Codes
Code Text Description
200 OK The request has succeeded. The meaning of a success varies depending on the HTTP method:
GET: The resource has been fetched and is transmitted in the message body.
HEAD: The entity headers are in the message body.
PUT or POST: The resource describing the result of the action is transmitted in the message body.
400 Bad Request Server cannot or will not process the request due to something that perceived as client error for e.g. Validation error, Invalid data input , Malformed request syntax etc.
403 Forbidden The 403 (Forbidden) status code indicates that the server understood the request but refuses to authorize it. A server that wishes to make public why the request has been forbidden can describe that reason in the response payload (if any). If authentication credentials were provided in the request, the server considers them insufficient to grant access. The client SHOULD NOT automatically repeat the request with the same credentials. The client MAY repeat the request with new or different credentials. However, a request might be forbidden for reasons unrelated to the credentials.
404 Not Found The 404 (Not Found) status code indicates that the origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
500 Internal Server Error The 500 (Internal Server Error) status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the request

Credits: Content of HTTP response code representation is referred from RFC 7231 of IEEE

Reason & Resolution
Code Reason Resolution
400
  • Data pushed in request is invalid
  • Validation failure with message (comma separated error string representation) in body
  • Data representation syntax not matched. System supports JSON as valid data format
Users are expected to improve upon sanity of data pushed in request and retry again with valid data. Message received in response body can guide user to improve on request.
403
  • Token is invalid
  • Client is inactive
Users are expected to verify the credential passed in request header and in case of mismatch, change and retry again with valid credentials.
404
  • Identifier used is invalid
Users are expected to verify the identifier passed in request body and in case of mismatch , change and retry again with valid identifier.
500
  • Internal Server Error
Users are expected to reach out to support for more details