Generate an API Token
Before configuring any settings, an access token is required to access the configuration endpoints. To obtain the token, you need to call the authentication endpoint using the API key and signature.
curl --location '{{BASE-URL}}/api/login' \
--header 'x-authentication-api-key: {{APIKEY}}' \
--header 'x-multitenant-external-id: {{EXTERNAL-ID}}' \
--header 'x-authentication-signature: {{SIGNATURE}}' \
--header 'Content-Type: application/json' \
--data '{
"timestamp": {{ZONEDATETIME}} // Example: "2024-09-06T05:36:25.966Z"
}'
The response contains a token in the accessToken field that we will use then in the configuration requests.
{
"accessToken": "eyJhbfIWOJnewIUzI1NiJ9.eWIiOiJhZG1pbiIsImV4cCI6MTcyMTEzNjc0MCwiYXV0aCI6IkFETUlOIEJBQ0tPRkZJQ0UiLCJpYXQiOjE3MjEwNTAzNDAsImRldmljZUlkIjoiLTEifQ.bosYs82RrGsqx6we_MFrcebIhh6d5hUMWaecbCiySDU",
"refreshToken": "eyJhbfIWOJnewIUzI1NiJ9.eiOiJhZG1pbiIsImV4cCI6MTcyMTY1NTE0MCwiYXV0aCI6IkFETUlOIEJBQ0tPRkZJQ0UiLCJpYXQiOjE3MjEwNTAzNDAsImRldmljZUlkIjoiLTEifQ.77odDiZJ7CWjGHM7yNSRU4b8ycqzkPzPwUKXi0aEAOU"
}
How to generate the signature?
Generate the body with this structure:
{
"timestamp": "2024-09-06T05:36:25.966Z"
}
Build the body to convert to a signature. We need to remove all the spaces (whitespaces, tabs, etc). Also respect the structure in which the data is sent like this:
To generate the signature hash, the body must respect the order of the attributes as shown in the example the timestamp).
{"timestamp":"2024-09-06T05:36:25.966Z"}
Build the signature with the body and the secret key. This needs to be on Sha256 - Hex:
Last updated