Authentication
API Authentication
All requests to the eHub API require authentication via Bearer Token, referred to as an API key in this documentation. each user receives a unique API key, ensuring individual access. If multiple users have API access within the same account, each user will have their own API key.
Obtaining Your API Key
To be assigned an API key, your user account must have the API role. To view the API keys for other users within the eHub account, your account must have the Primary or Owner role.
To locate your API token:
- Log in to your eHub account at app.ehub.com
- Navigate to
Settings→Users. - Locate your user with the
APIrole. - Copy the token listed under the
API KEYfield.
You can copy the API key with one click using the copy button to the right of the key.
Using the API Token
Once you have obtained your API key, include it in the Authorization header of your HTTP requests. The token must be prefixed with the word Bearer followed by a space, formatted like this:
Authorization: Bearer YOUR_API_KEYExample request using the API token:
curl --request GET \ --url https://api.ehub.com/api/v2/test/ping \ --header 'Authorization: Bearer {your_api_key}' \ --header 'Content-Type: application/json'Forgetting to include an API key when making a request will lead to an Unauthorized 401 error.
Status: 401 - Unauthorized
{ "status": "error", "error_code": "errors.insufficient_scope", "error_message": "Token does not allow access to service."}On this page
- Authentication