Best Practices

Best practices highlight recommended patterns that help your system interact reliably with Health Gorilla APIs once initial connectivity is established. They address common operational considerations that can affect stability, performance, and supportability over time.

Environment Separation

Maintain strict separation between sandbox and production environments:

  • Use the correct base URL for each environment.
  • Use environment-specific credentials.
  • Avoid sharing tokens or credentials across environments.

Environment separation helps prevent accidental production impact during testing.

Access Token Handling

Access tokens issued through the OAuth 2.0 client credentials flow have a defined lifetime. Your system should request a new token when the current token expires rather than reuse an expired token.

Avoid requesting a new token for every API call. Cache the token securely and reuse it until expiration.

Retry Behavior

Transient network errors or downstream service interruptions may occur. When retrying requests:

  • Retry only idempotent operations.
  • Apply backoff between retry attempts.
  • Avoid rapid or unbounded retry loops.

Retrying non-idempotent write operations may result in unintended side effects.

Rate Limit Awareness

Health Gorilla enforces rate limits to protect platform stability. Your system should:

  • Monitor HTTP response codes.
  • Avoid burst traffic patterns.
  • Back off appropriately when limits are reached.

Unexpected throttling often indicates overly aggressive request behavior.

Logging and Troubleshooting

Log request and response metadata needed for troubleshooting, including:

  • Request identifiers
  • Timestamps
  • HTTP status codes

Providing this information when contacting Health Gorilla support helps speed investigation and resolution.