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 Key400 Bad Request
Invalid Parameters403 Forbidden
Account Not Associated404 Not Found
Resource Not Found429 Too Many Requests
Rate Limit ExceededError 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:- Check the API Reference for endpoint details
- Review the error message for specific guidance
- 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.