Integration Guides
Authentication
Learn how to authenticate your API requests with ParcelShield
Authentication
ParcelShield APIs use Bearer token authentication. To authenticate your requests, you’ll need to:
- Obtain an access token
- Include the token in your API requests
Getting an Access Token
To get an access token, send a POST request to the token endpoint with your client credentials:
The response will include your access token:
Using the Access Token
Once you have an access token, include it in the Authorization header of your API requests:
Token Lifecycle
- Access tokens are valid for 24 hours (86400 seconds)
- You should request a new token when the current one expires
- Store tokens securely and never expose them in client-side code
- Implement token refresh logic in your application to maintain continuous access
Best Practices
Rate Limits
The authentication service implements rate limiting on token endpoints. Ensure you’re caching tokens and not requesting new ones for every API call.
Contact ParcelShield support if you need higher rate limits for your application.
Error Responses
If authentication fails, you’ll receive one of these common error responses:
Common HTTP status codes:
401
- Invalid or expired token403
- Valid token but insufficient permissions429
- Rate limit exceeded