© Adviser Technologies Limited t/as Adviser.ai – Privacy Policy
Authentication
To authenticate with the Adviser.ai API and access its endpoints, follow the steps below. This process involves obtaining a JWT token using your account credentials, which is then included in API requests for authorisation.
Steps to Obtain Authentication Token
- Obtain API Email Address:
- Locate the email address associated with your campaign API from the API Process Document.
- Set Password:
- Visit Adviser.ai and enter the email address into the ‘New User’ field and click on ‘Set Password’.
- Follow the on-screen instructions to set your password.
- This will involve receiving a verification code via SMS, as Two-Factor Authentication (2FA) is enabled.
- Log In and Obtain Token:
- Once you have the email and password, make a POST request to the authentication endpoint to obtain a JWT token.
Example Request
Using ‘curl’:
curl -X POST --data "email=campaignapi@yourdomain.co.uk&password=YOURPASSWORD" https://adviser.ai/api/auth
- URL endpoint: https://adviser.ai/api/auth
- Replace campaignapi@yourdomain.co.uk with your actual campaign API email address
- Replace YOURPASSWORD with the password you set in the previous step.
Example Response
The API will return a JSON response containing the token:
{ "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9sb2NhbGhvc3Q6ODAwMCIsImlhdCI6MTU5MTAxMjIzNCwiZXhwIjoxNTkyMzA4MjM0LCJjb250ZXh0Ijp7InVzZXIiOnsidXNlcl9pZCI6IjE4NCJ9fX0.ErfCKAMBn7baXMfd8liQcBtjdXHRVPXS38s-Wlslrn0"
}
Note: The token provided is an example and will differ in actual usage. The token expires after 15 minutes, so you will need to refresh it periodically.
Using the Authentication Token
Include the obtained token in the headers of your API requests to authenticate them. Here’s how to include the token:
Example Header
Authorisation: Bearer <your_token_here>
Additional Notes
Two-Factor Authentication (2FA): We have 2FA enabled and will require an SMS code to be sent to the mobile number of the project owner. For any issues, submit a ticket at Adviser.ai Help.
Token Expiry: The token expires after 15 minutes. Implement a mechanism to refresh the token as needed to maintain API access.
Example Usage
Sending a Request
Once authenticated, you can include the token in the Authorisation header for all subsequent API calls, for adding campaigns.
curl -X GET https://adviser.ai/api/v3/company/{companyId}/campaign/add/live \
-H "Authorisation: Bearer <your_token_here>" \
-H "Content-Type: application/json"
This process ensures secure and authorized access to Adviser.ai’s API, allowing you to interact with the platform programmatically.