Developer Documentation
Kinabase API

Fetching Data

Learn how to make requests to the Kinabase API and handle responses effectively


Basic Concepts

Once you have the authentication token from Setting Up the API, you're ready to interact with the API. Here are some key points to remember:

Base URL

The base URL for all API requests is: https://app.kinabase.com/api/v1/

Format

The request body should always be a valid JSON object.

Security

All requests must be made over HTTPS.

Authentication

All requests must include the following headers:

{
  "Content-Type": "application/json",
  "Accept": "application/json", 
  "Authorization": "Bearer {your-token-here}"
}

Rate Limiting

The API has a rate limit of 100 requests per minute. If you exceed this limit, you will receive a 429 Too Many Requests error.

Error Handling

If an error occurs, the API will return a JSON object with the error message and a status code.

Pagination

The API supports pagination. If a request returns more than 100 records, the API will return a next page token. You can use this token to request the next page of records.

Examples

Example Request

Here's a sample API request to retrieve records from a collection, in JavaScript:

fetch("https://app.kinabase.com/api/v1/collections", {
  method: 'get',
  headers: {
    'Content-Type': 'application/json',
    'Accept': 'application/json',
    'Authorization': `Bearer ${yourTokenHere}`,
  },
})

Example Response

Here's a sample response from the API, in JSON format:

{
  "records": [
    {
      "data": {
        // Record data
      }
    }
  ],
  "totalRecords": 1,
  "pageIndex": 0,
  "pageSize": 10
}

Troubleshooting

If you encounter issues, here are some common troubleshooting steps:

Incorrect Field Naming

Ensure that field names are in camelCase. For example, "Job Title" should be passed as jobTitle.

Case Sensitivity

Field names are case-sensitive. If you use Name instead of name, the request will fail with a 400 Bad Request.

Collection ID

Some requests require a collection ID. You can retrieve it by making a GET request to /collections and searching for the id property, or by using the collection's slug (e.g., purchase-orders).