Skip to main content
The DHMAD API uses standard HTTP status codes and returns detailed error messages to help you debug issues.

Error Response Format

All error responses follow this format:

HTTP Status Codes

200 OK

Request succeeded

201 Created

Resource created successfully

400 Bad Request

Invalid request parameters

401 Unauthorized

Missing or invalid API key

403 Forbidden

API key lacks required permissions

404 Not Found

Resource not found

429 Too Many Requests

Rate limit exceeded

500 Internal Server Error

Server error occurred

Common Errors

401 Unauthorized

Missing API Key
Invalid API Key
Solution: Check that your API key is correct and active in the dashboard.

400 Bad Request

Invalid Parameters
Solution: Review the API documentation and ensure all required fields are provided with valid values.

403 Forbidden

Account Not Associated
Solution: Associate your developer account with a user account in the dashboard.

404 Not Found

Resource Not Found
Solution: Verify the resource ID is correct and that you have access to it.

429 Too Many Requests

Rate Limit Exceeded
Solution: Wait for the rate limit to reset or contact support for higher limits.

Error Handling Best Practices

Check Status Codes

Always check the HTTP status code before processing responses

Read Error Messages

Error messages provide specific information about what went wrong

Handle Retries

Implement exponential backoff for 429 and 500 errors

Log Errors

Log error responses for debugging and monitoring

Example Error Handling

Getting Help

If you encounter an error you can’t resolve:
  1. Check the API Reference for endpoint details
  2. Review the error message for specific guidance
  3. Contact support@dhmad.tn with:
    • Error message
    • Request details (without sensitive data)
    • API key ID (not the key itself)

Never log or expose your API keys in error messages or logs. Always redact sensitive information.