Error Handling

This section outlines the error handling process for the API. It provides information on the types of errors returned, their corresponding HTTP status codes, and how to interpret error responses.

Error Response Format

Error response from the API follow a consistent format to facilitate easy understanding and debugging.

{
  "error": {
  "code": "ERROR_CODE",
  "message": "ERROR_MESSAGE",
  }
 
}

Example

 {
  "error": {
  "code": "400",
  "message": "Bad Request: Invalid Input data",
  }
 
}

Common Error Codes

The API may return the following error codes:

Status CodeMeaningDescription
400Bad RequestIndicates that the request was malformed or contained invalid parameters.
401UnauthorizedIndicates that authentication credentials are missing or invalid.
403ForbiddenIndicates that the request is not authorized to access the resources.
404Not FoundIndicates that the requested resources does not exist
500Serve ErrorsIndicates an internal server error occurred
 
{
  "type": "api_error",
  
"message": "No way this is happening",
  "documentation_url": "https://protocol.chat/docs/errors/api_error",
  
}

Unsure of where to find what you need? Try Search Enter the error message or keywords into the search bar above. if you don't find what you're seeking, feel free to reach out to us for assistance. We're here tp help!

Was this page helpful?

Helpful (0)

Not helpful (0)

© Copyright 2024. All rights reserved.