Skip to main content

Overview

This guide covers how to handle errors and edge cases when using the Gather API. Proper error handling ensures your integration is robust and provides a good user experience.

Error Response Format

All errors follow a consistent format:

HTTP Status Codes

400 Bad Request

Invalid request parameters or malformed request body.
Action: Review the error details and fix the request parameters.

401 Unauthorized

Invalid or missing authentication credentials.
Action: Verify your API credentials are correct and properly formatted.

404 Not Found

Resource not found.
Action: Verify the resource ID exists and you have access to it.

429 Too Many Requests

Rate limit exceeded.
Action: Implement exponential backoff and retry after the reset time.

500 Internal Server Error

Server error.
Action: Retry the request with exponential backoff. If the error persists, contact support.

Error Handling Patterns

Retry Logic

Implement retry logic for transient errors (429, 500):

Validation Error Handling

Handle validation errors gracefully:

Common Error Scenarios

Invalid Credentials

Symptom: 401 Unauthorized Solution:
  • Verify credentials are correct
  • Check that your API key is correctly formatted and prefixed with qapi_
  • Ensure using organizationId:apiKey (not reversed)

Resource Not Found

Symptom: 404 Not Found Solution:
  • Verify resource ID exists
  • Check you have access to the resource
  • Ensure using correct endpoint path

Rate Limit Exceeded

Symptom: 429 Too Many Requests Solution:
  • Implement exponential backoff
  • Monitor rate limit headers
  • Cache responses when possible
  • Reduce request frequency

Network Errors

Symptom: Connection timeout or network errors Solution:
  • Implement retry logic
  • Use connection pooling
  • Set appropriate timeouts
  • Handle network failures gracefully

Best Practices

  1. Always Check Status Codes: Don’t assume requests succeed
  2. Log Errors: Log errors with request IDs for debugging
  3. User-Friendly Messages: Translate technical errors to user-friendly messages
  4. Retry Strategically: Retry transient errors, not client errors
  5. Handle Edge Cases: Plan for network failures, timeouts, and partial failures
  6. Monitor Error Rates: Track error rates and types to identify issues

Rate Limits

Learn about rate limits and throttling

Best Practices

Review API best practices