Platform

Keboola Storage API Supports JSON in All Requests

When using form-data in an API request, you are limited to simple key-value pairs. However, this limitation can now be overcome by using JSON instead.

We'd like to inform you that all endpoints in the Keboola Storage API now support JSON body requests, except for those marked as deprecated. Although it's still possible to send a form-data body, we're formally deprecating this approach moving forward.

Using JSON in your requests offers several benefits over form-data, including improved readability and reduced risk of errors. Take a look at this example:

Request with form-data body:

POST https://connection.keboola.com/v2/storage/tables/123/export-async
Content-Type: application/x-www-form-urlencoded

format=rfc&whereFilters[0][column]=projectId&whereFilters[0][operator]=eq&whereFilters[0][values][]=987&orderBy[0][column]=id&orderBy[0][order]=ASC

Request with JSON body:

POST https://connection.keboola.com/v2/storage/tables/123/export-async
Content-Type: application/json

{
  "format": "rfc",
  "whereFilters": [
    {
      "column": "projectId",
      "operator": "eq",
      "values": ["987"]
    }
  ],
  "orderBy": [
    {
      "column": "id",
      "order": "ASC"
    }
  ]
}

As you can see, the JSON version is much easier to read and understand. We encourage you to switch to JSON body requests whenever possible. If you have any questions or concerns, please let us know.