Authentication
The Lightyshare API uses token-based authentication to secure all API requests.API Tokens
All API requests require authentication using an API token. You can obtain your API token from your Lightyshare dashboard.Using Bearer Token (Recommended)
Include your API token in theAuthorization
header:
Using Query Parameter (Legacy)
For backward compatibility, you can also pass the token as a query parameter:Token Security
- Keep your token secure: Never expose your API token in client-side code or public repositories
- Token rotation: Regularly rotate your API tokens for enhanced security
- Scope: Each token is tied to a specific user account and has access to that user’s resources only
Error Responses
Invalid Token (401 Unauthorized)
Access Denied (403 Forbidden)
Best Practices
- Use environment variables to store your API tokens
- Implement proper error handling for authentication failures
- Use HTTPS for all API requests
- Monitor token usage through your dashboard