Quick start

Account setup

Access token

Each call to the API needs to contain an access token which can be obtained using your public and secret keys.

The access token is retrieved from our OIDC service which is found at https://auth.kaizenep.com. An example of how to construct the retrieval is shown below.

# Find out the configuration
>>> configuration = requests.get('https://auth.kaizenep.com/.well-known/openid-configuration').json()

# Find token_endpoint in the response above to be able to retrieve an access token
>>> token_endpoint = configuration['token_endpoint']

# Construct a request to receive an access token
>>> auth_data = {
        'client_id': public_key,
        'client_secret': secret_key,
        'grant_type': 'client_credentials',
    }
>>> response = requests.post(token_endpoint, auth_data).json()

# Find access_token in the response
>>> access_token = response['access_token]

API connection

Each call to the API requires two request headers to be set:

  • Access token: Described above

  • Organisation ID: this will be provided by Fry after initialisation of your organisation

A simple way to test the API connection is by fetching the current profile information of the integration user.

>>> headers = {
        'EAS-Organisation': 'org_fry', # Your organisation id
        'Authorization': 'Bearer {}'.format(access_token)
    }
>>> profile_document = requests.get('https://api.kaizenep.com/v1/account/profile', headers=headers).json()