Authentication

๐Ÿ“˜

POST https://api.kayzen.io/v1/authentication/token

Kayzen API supports standard OAuth with password grant type. You can use your username and password to get an access token by making a simple POST request like the following:

POST https://api.kayzen.io/v1/authentication/token

// cURL 
curl -X POST \
'https://api.kayzen.io/v1/authentication/token' \
-H 'authorization: Basic ' \
-H 'content-type: application/x-www-form-urlencoded' \
-d 'grant_type=password&username=&password='

grant_type

password

username

The email you use while logging into the Kayzen Platform

password

Your Kayzen account password

Header

You are required to pass the authorization: Basic header, by deriving values from base64 encode of string <API_Key>:<API_Secret_Key>.

Refer to this link to learn how to get your API Key and API Secret Key

The response to the authentication call is an OAuth token which should be included in the header calls of all future requests as Authorization: Bearer .... By default the token gets expired in 30 mins.

If your token expires, you will need to implement the OAuth refresh token flow by making the authentication call again and using the newly issued OAuth token for subsequent requests.

curl -X POST \
'https://api.kayzen.io/v1/authentication/token' \
-H 'authorization: Basic ' \
-H 'content-type: application/x-www-form-urlencoded' \
-d 'grant_type=password&username=&password='
{"access_token":ACCESS_TOKEN,"expires_in":"1799","scope":""}

How to make subsequent calls

Once you get the authentication token, you are required to pass this token as the bearer token in your HTTP headers. A sample to list campaigns has been shown here

curl -X GET \
'https://api.kayzen.io/v1/meta/campaigns?page=1&per_page=25?' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer ACCESS_TOKEN'

Error codes

We support standard HTTP error codes.

In the case of an authentication failure, you will receive one of the following "Authentication error" errors
a. Incorrect username/password- Invalid login credentials
b. Invalid Access Token - Invalid API Key.


Whatโ€™s Next

Learn more about getting started with Reporting API