All plans have 30% OFF For this week

Claim Discount

Error Codes

API Reference: Error Codes

The AnswerPal API uses standard HTTP status codes to indicate the success or failure of API requests. This page lists all common error codes, explains their meaning, and provides best practices for handling errors in your integration. For endpoint-specific error codes, refer to the relevant API documentation section.

Common Error Codes

Status Code Error Name Description Example Solution
400 Bad Request The request could not be understood due to invalid input, missing parameters, or validation errors. Check input data and required fields.
401 Unauthorized Authentication failed or was not provided. Token may be missing, expired, or invalid. Check your Authorization header and credentials. Re-authenticate if needed.
403 Forbidden Authenticated but not permitted to access the resource. Contact your admin or support to verify your access rights.
404 Not Found The requested resource does not exist. Check the resource ID or URL.
409 Conflict Duplicate or conflicting resource (e.g., trying to create a resource with the same unique field). Ensure the resource does not already exist or resolve conflicts.
415 Unsupported Media Type The uploaded file type is not supported. Use a supported file format (e.g., PDF, PNG).
500 Internal Server Error Unexpected server-side error. Retry later or contact support if the issue persists.
    • 401 Unauthorized: The API call was made without valid credentials or with an expired/invalid token. Solution: Check your Authorization header and ensure your token or credentials are correct and not expired.
    • 403 Forbidden: The credentials are valid but lack permission to access the requested resource. Solution: Contact your admin or support to verify your access rights.
    • Token Expiry: JWT tokens are time-limited. If you receive a token expiry error, re-authenticate to obtain a new token.
    • 400 Bad Request: Missing or invalid parameters, validation errors, or ID mismatch. Solution: Check your input data and ensure all required fields are provided.
    • 404 Not Found: The requested resource does not exist. Solution: Check the resource ID, path, or URL.
    • 409 Conflict: Duplicate or conflicting resource (e.g., already exists). Solution: Ensure there are no duplicates and resolve any conflicts.
    • 415 Unsupported Media Type: The uploaded file type is not supported. Solution: Use a supported file format (see documentation for allowed types).
    • 500 Internal Server Error: An unexpected error occurred on the server. Solution: Retry later or contact support if the issue persists.

Best Practices for Handling API Errors

  • Always validate input data before making API requests.
  • Handle authentication errors by prompting users to re-authenticate.
  • Log all error responses for troubleshooting and auditing.
  • Use secure storage for API credentials and tokens.
  • Implement retry logic for transient errors (e.g., 500 Internal Server Error).
  • Contact support if you encounter persistent or undocumented errors.

Example Error Responses

Elementor Code Block Paste the following:

{

"status": 401,

"error": "Unauthorized",

"message": "The API call was made without valid credentials or with an expired/invalid token."

}

{

"status": 400,

"error": "Bad Request",

"message": "Missing required parameter: sourceText."

}

{

"status": 404,

"error": "Not Found",

"message": "The requested resource does not exist."

}

FAQ

Check your authentication credentials and ensure your token is valid and not expired.

Ensure you are not creating a duplicate resource or update the conflicting data.

Retry the request later. If the error persists, contact support.

Table of Contents

AnswerPal: AI-powered customer service solutions to elevate your support and communication effortlessly.

Contact

For all support, sales, and partnership inquiries, email us at info@answerpal.eu