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:400 Bad Request
400 Bad Request
Invalid request parameters or malformed requests.
401 Unauthorized
401 Unauthorized
403 Forbidden
403 Forbidden
Valid credentials but insufficient permissions for the requested resource.
429 Too Many Requests
429 Too Many Requests
Rate limit exceeded. Check rate limit headers for retry information.
500 Internal Server Error
500 Internal Server Error
Server-side error. Contact support if the issue persists.
Best Practices
Token Management
Token Management
- 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
Request Optimization
Request Optimization
- 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
Security
Security
- 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.