Skip to main content

External APIs

External APIs are designed for third-party integrations and public-facing applications. These APIs provide basic functionality for external developers to integrate with the Weir AI platform.
Use Case: External APIs are perfect for building integrations that will be used by external developers, third-party applications, or public-facing services.

Authentication

External APIs use basic authentication with client credentials to generate access tokens.

Get Client Credentials

Obtain your clientId and secretKey from the Weir AI dashboard.

Generate Access Token

Use basic authentication to generate an access token for API requests.

Use Access Token

Include the access token in the Authorization header for all API requests.

Available Endpoints

Rate Limits

External APIs have the following rate limits:

Authentication

  • Token Generation: 10 requests per minute per client
  • Token Refresh: 20 requests per minute per client

API Requests

  • General Endpoints: 100 requests per minute per client
  • Burst Limit: 200 requests per 5-minute window

Error Handling

External APIs return standard HTTP status codes and error responses:
Invalid request parameters or malformed requests.
Invalid or missing authentication credentials.
Valid credentials but insufficient permissions for the requested resource.
Rate limit exceeded. Check rate limit headers for retry information.
Server-side error. Contact support if the issue persists.

Best Practices

  • Store access tokens securely and never expose them in client-side code
  • Implement automatic token refresh before expiration
  • Use different tokens for different environments
  • Monitor token usage and implement proper error handling
  • Cache responses when possible to reduce API calls
  • Use appropriate HTTP methods for different operations
  • Implement retry logic with exponential backoff
  • Monitor rate limit headers to avoid hitting limits
  • Always use HTTPS for all API requests
  • Validate and sanitize all input parameters
  • Implement proper error handling without exposing sensitive information
  • Use secure storage for client credentials and tokens

Getting Started

Obtain Credentials

Get your client credentials from the Weir AI dashboard.

Generate Token

Use the Generate Access Token endpoint to get your first access token.

Make Requests

Use the access token to make authenticated API requests.

Handle Responses

Implement proper response handling and error management.
Pro Tip: Start with the Generate Access Token endpoint to understand the authentication flow, then explore other endpoints based on your integration needs.