Authorization
API Authorization Methods
The API supports three authorization methods. To enable any of these methods, please submit your requirements here.
1. Login with login Method (Session-Based)
login Method (Session-Based)This method uses the login API call to obtain a sessionId. You’ll need to provide two parameters, apiAuthCode and siteAuthCode, which must be Base64 encoded.
Parameters for POST Request:
apiAuthCode: A Base64-encoded string of the API Hub username and password.siteAuthCode: A Base64-encoded string of the site username and password.
Example Request:
POST /login
{
"companyId": "", // Company ID
"appId": "DBTEAdmin",
"apiAuthCode": "base64_encoded_api_username:password",
"siteAuthCode": "base64_encoded_site_username:password"
}Example Header:
{
"Content-Type": "application/json"
}Upon successful login, the response will contain a sessionId that can be used for subsequent requests.
2. API Key
For applications using an API key, pass the api-key parameter in the request header. Sessions are automatically managed, so sessionId is not required.
Example Header:
{
"Content-Type": "application/json",
"api-key": "your_api_key"
}3. Basic Authentication
Alternatively, you can authorize API requests using Basic Authentication by including an Authorization header with your Base64-encoded credentials. This approach also manages sessions automatically, so sessionId is not needed.
Example Header:
{
"Content-Type": "application/json",
"Authorization": "Basic your_base64_encoded_credentials"
}Each method offers secure access to API resources, allowing you to choose the best fit for your application
Updated 8 months ago
