Public
Documentation Settings

Kizen V2 API Docs

About

The KIZEN API is a JSON-based RESTful interface that allows developers to integrate KIZEN into their applications.

You may access the API using any programming language or your command line through an HTTP client or Core API client.

Authentication

Unless otherwise stated, all requests to the API require including the following headers: X-API-Key, X-User-Id, and X-Business-Id. API keys are created on a per-user basis and grant access to all businesses that the associated user has access to.

X-API-Key: Create and delete API keys on the API Keys Settings Page. API keys must be kept secret and must not be included in client-side code or shared outside of your organization.

X-User-Id: Your User ID is visible on the API Keys Settings Page at the bottom of the page. This value acts like your username and is not secret.

X-Business-Id: Visit the API Keys Settings Page where the current business ID is visible on the top right of the page. This value is required to associate your API request with the appropriate business and is not secret.

The below Python example retrieves a paginated list of companies stored in the business's KIZEN account. You will need to add the appropriate values in AUTH_HEADERS.

Plain Text
import requests

API_ROOT = 'https://api.kizen.com'
AUTH_HEADERS = {
    'X-API-Key': '',
    'X-User-Id': '',
    'X-Business-Id': ''
 }

 response = requests.get(API_ROOT + '/company', headers=AUTH_HEADERS)

Error Codes

In almost all instances, details of your error will be clearly and explicitly stated in the response of the API request. Below are error codes that you can expect from the API.

200 - OK

201 - Created

404 - Not Found

405 - Method Not Allowed

500 - Server Error

Pagination

In some instances the amount of results returned in an API call has the potential to be too large to be returned in a single response. For these cases we employ a technique called pagination.

Most list routes accept two URL parameters: page and page_size. These two parameters allow a request to specify how many results it will return (page_size) and which group of results to return (page). Unless otherwise specified page_size will be 1000 and page will be 1.import requests

Plain Text
import requests

API_ROOT = 'https://api.kizen.com'
AUTH_HEADERS = {
    'X-API-Key': '',
    'X-User-Id': '',
    'X-Business-Id': ''
  }

 names = []
 params = {
     'page_size': 50,
     'page': 1
 }

while True:
     response = requests.get(API_ROOT + '/company', params=params,        
     headers=AUTH_HEADERS)
     content = response.json()

     for result in content['results']:
        names.append(result['name'])

     if content['next']:
        params['page'] += 1
     else:
        break

Every paginated response contains three attributes: previous, next, and results. previous and next will point to the previous/next page or null if that page doesn't exist. For example, if there are no more results then next will be null. results will be an array containing the page of results.

Rate limit

All API clients are limited to 25 requests per second. If you receive a 503 error code that means you have exceeded your rate limit.

Base URL

The Base URL is https://app.go.kizen.com/api