Token authentication API

Token authentication API

All requests are authorized via a OAuth2 bearer token. Requests for an access token should be made with an “client_credentials” grant type. Bearer token will expire after 30 minutes, and will need to be refreshed. Expiration times will be returned with the token request, and represented in seconds from the time the token was issued.

Account

Creovai used specific API User account to access the Creovai APIs (your normal Creovai user will not work).  The Creovai API user need to be create by Creovai Support, please send an email to Support@Creovai.com and they will walk you throw the process of setting up an API user, (Note a Creovai user with the Administrator role is required to access the API user secret).  The API user client secret is only valid for 365 day, at which time a new secret will need to be generated. Creovai support team will reach out to the technical contact on file prior to the secret expiring to remind you that it much be cycled.


Example token request

POST https://[INSTANCE NAME].Audio.Creovai.com/Token HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Content-Length: 124
Expect: 100-continue
Connection: Keep-Alive

grant_type=client_credentials&client_secret=[ApiUserSecret]&client_id=[ApiUsername]


Sample token request using cURL

curl -k -X POST "https://[INSTANCE NAME].Audio.Creovai.com/Token" -dclient_id=[ApiUsername] -dclient_secret=[ApiUserSecret] -dgrant_type=client_credentials


Response (if the token request is successful)

{
    "access_token": "[TOKEN]",
    "token_type": "bearer",
    "expires_in": 1799
}



Articles in this section



Was this article helpful?