Authentication
To access the Manifold API, you need to authenticate using an API token. This token identifies your account and allows you to interact with various endpoints, giving you access to vehicle data, driver information, and more.
Getting Your API Token
- Log in to the Manifold Portal: Go to the Manifold portal and log in with your account credentials.
- Navigate to API Tokens:
- Click on the Profile icon at the top right corner.
- Select API Tokens from the dropdown menu.
- Create a New Token:
- Click Create New Token.
- Copy and Store the Token: Once the token is generated, copy it and store it securely. Treat it like a password—do not share it publicly.
Note: Each token comes with an expiration date. Ensure that you monitor the expiry to avoid interruptions in accessing the API. When a token expires, simply generate a new one.
Using the API Key
Manifold uses an API key-based authentication scheme. To authenticate, include your token in the x-api-key header of your HTTP request. Additionally, a Connection-Id is required to specify the data source for most endpoints..
Example of a Request with Authentication
curl --request GET 'https://api.analytics.autos/connections' \
--header 'x-api-key: YOUR_API_KEY'
This header is required for all API requests. Without it, you’ll receive a 401 Unauthorized
error.
Refreshing the API Key
API keys cannot be refreshed. When a key expires, you need to generate a new one through the Manifold portal by following the steps above.
⚠️ Security Best Practices
- Keep Your Key Private: Do not share your API key or include it in client-side code. Anyone with access to this key has access to your data.
- Rotate Keys Periodically: Regularly rotate your API keys and monitor their usage to improve security.
- Use Different Keys for Different Environments: For example, generate separate keys for development and production environments to prevent unintended access.
Handling Unauthorized Requests
If your API key is invalid or expired, the API will return a 401 Unauthorized
error. Here’s a quick checklist for troubleshooting:
- Verify the Key: Ensure you’re using a valid API key in the
x-api-key
header. - Check Expiry: If your key has expired, generate a new one through the Manifold portal.
- Confirm Header Syntax: Ensure you’re using the
x-api-key
header with the correct key value.
By following these steps, you’ll have seamless and secure access to Manifold’s API, enabling you to make the most out of your fleet data and integrations.
Updated 7 days ago