Authentication

Use the authentication endpoint to obtain an access token and refresh token by providing your username and password. Include the access token in the Authorization header for all subsequent API requests.


How do I get an access token?

Get an access token from the authentication endpoint by providing a username and password. Example:

Authenticate and get an access token

import requests

response = requests.post(
    "https://api.prod1.valu8group.com/v2/authentication",
    json={
        "username": "[USERNAME]",
        "password": "[PASSWORD]"
    }
)

data = response.json()
access_token = data["accessToken"]["value"]
refresh_token = data["refreshToken"]["value"]

print("Access token expires at:", data["accessToken"]["expiresAt"])
print("Refresh token expires at:", data["refreshToken"]["expiresAt"])

When you have recieved an access token, then include it in subsequent requests as a header like this:

Important!

It's important that you NOT create a new access token with each new request. Instead, reuse the same access token as long as it is valid, (i.e. the date for expireAt has not expired) Currently the expiration time is 3 months.

When you have recieved an access token, then include it in subsequent requests as a header like this:

Authorization: Bearer <access_token>
import requests

response = requests.get(
    "https://api.prod1.valu8group.com/v2/companies/search-parameters",
    headers={"Authorization": f"Bearer {token}"}
)

How do I renew an access token?

Use the refresh token endpoint to renew an access token. Use this endpoint when your current access token is about to expire.

import requests

response = requests.post(
    "https://api.prod1.valu8group.com/v2/authentication/refresh-token",
    json={
        "accessToken": "<your-existing-access-token>",
        "refreshToken": "<your-existing-refresh-token>"
    }
)

print(response.json())

How do I get or reset my password?

You can find this information in the "Password management" section of the documentation here.