Understanding Responses and Handling Errors
API responses are delivered in JSON format. The client applications must parse this JSON to extract the required data. Equally important is handling the HTTP status code returned with each response to determine success or failure.
Common HTTP Status Codes:
200 OK
The request was successful, and the response body contains the requested data.
400 Bad Request
The request was malformed (e.g., invalid parameters, incorrect format). Check the request syntax and parameters.
401 Unauthorized
Authentication failed. The access token is missing, invalid, or expired. Obtain/refresh the token.
403 Forbidden
Authentication succeeded, but the user does not have permission to access the requested resource
404 Not Found
The requested resource (e.g., specific address, endpoint path) does not exist.
429 Too Many Requests
The client has exceeded the allocated rate limit.
500 Internal Server Error
An unexpected error occurred on Nansen's servers.
504 Gateway Timeout
API didn't get a timely response from backend server
Last updated
Was this helpful?