Errors
The XingZap API uses the following error codes:
| Error Code | Meaning |
|---|---|
| 400 | Bad Request - Your request is invalid. |
| 403 | Forbidden - Access denied. Check your API key. |
| 429 | Too Many Requests - You’re exceeding the rate limit. |
| 500 | Internal Server Error - We had a problem with our server. Please contact us! |
Handling Errors
Section titled “Handling Errors”400 Bad Request
Section titled “400 Bad Request”Check that your request body contains valid JSON and all required parameters. Refer to the specific endpoint documentation for required fields.
403 Forbidden
Section titled “403 Forbidden”Ensure your X-Api-Key header is present and contains a valid API key. If you don’t have an API key, request one here.
429 Too Many Requests
Section titled “429 Too Many Requests”You’ve exceeded the rate limit of 1 request per second. Implement exponential backoff in your application:
import time
def make_request_with_retry(max_retries=3): for attempt in range(max_retries): response = make_api_request() if response.status_code == 429: wait_time = 2 ** attempt # 1, 2, 4 seconds time.sleep(wait_time) continue return response raise Exception("Max retries exceeded")500 Internal Server Error
Section titled “500 Internal Server Error”This is a server-side issue. Please contact support if the problem persists.