Overview
The Fentu FSM API uses token-based authentication. All API requests must include a valid authentication token in the request header.Keep your API credentials secure. Never expose tokens in client-side code or public repositories.
Authentication Methods
API Key Authentication
For server-to-server integrations:OAuth 2.0
For user-authorized applications:- Redirect user to authorization endpoint
- User grants permission
- Receive authorization code
- Exchange code for access token
- Use access token for API requests
Obtaining Credentials
API Keys
OAuth Credentials
For OAuth applications:- Register your application
- Receive client ID and secret
- Configure redirect URIs
- Implement OAuth flow
Making Authenticated Requests
Request Headers
Include the authentication header in all requests:Example Request
Token Management
Token Expiration
| Token Type | Lifetime |
|---|---|
| API Key | No expiration (until revoked) |
| Access Token | 1 hour |
| Refresh Token | 30 days |
Refreshing Tokens
For OAuth access tokens:Revoking Tokens
To invalidate a token:Permissions & Scopes
Available Scopes
| Scope | Access |
|---|---|
read:work-orders | View work orders |
write:work-orders | Create/update work orders |
read:customers | View customers |
write:customers | Create/update customers |
read:assets | View assets |
write:assets | Create/update assets |
admin | Full administrative access |
Requesting Scopes
Include scopes in authorization request:Error Handling
Authentication Errors
| Error Code | Meaning | Resolution |
|---|---|---|
401 | Invalid or missing token | Check token and try again |
403 | Insufficient permissions | Request needed scopes |
429 | Rate limited | Wait and retry |
Error Response Format
Rate Limiting
Limits
| Tier | Requests/Hour |
|---|---|
| Standard | 1,000 |
| Professional | 10,000 |
| Enterprise | Unlimited |
Rate Limit Headers
Responses include rate limit information:Handling Rate Limits
When rate limited:- Check
X-RateLimit-Resetheader - Wait until reset time
- Retry request
- Consider caching responses
Security Best Practices
Secure Storage
Secure Storage
Store credentials in secure vaults or environment variables. Never hardcode in source code.
Use HTTPS
Use HTTPS
Always use HTTPS for API requests. Never send credentials over unencrypted connections.
Minimum Scopes
Minimum Scopes
Request only the scopes you need. Don’t request admin access for read-only operations.
Rotate Keys
Rotate Keys
Periodically rotate API keys. Immediately revoke any compromised credentials.
Monitor Usage
Monitor Usage
Monitor API usage for unusual patterns. Investigate unexpected spikes.
IP Restrictions
IP Restrictions
Where possible, restrict API access to known IP addresses.
Related Documentation
API Introduction
API overview
Work Orders API
Work order endpoints
Customers API
Customer endpoints
Integrations
Integration setup
