We silently released v2 of our Content Management API. The major change is how file uploads are now handled:
We no longer have an "Image" and "Image gallery" field. Every existing image field has been converted to a "Single file" field, and every "Image gallery" field has been converted into a "Multiple files" field. We made sure to add a format validation so that only images can be uploaded, so everything should work exactly as before.
When fetching records from the API that contain single/multiple file fields, you will no longer receive the complete "Upload" payload, but just its ID. You can fetch all the info regarding an Upload using the
When creating/updating records that contain single/multiple file fields, you no longer have to pass the complete "Upload" payload, but just its ID (or array of IDs, in case it's a "multiple files" field).
We released a new version of all of our clients (JS/Ruby/GatsbyJS/Middleman) to reflect this change, while mantaining the old methods signature.
Despite the big change, we tried not to break sites using our old clients. If no
X-Api-Version: 2 header is passed, we assume Version 1 of our API is requested, so the
GET /items and
GET /items/:id endpoints will keep on returning data in the old format.
Important: Content Management API v1 will be sunsetted on September 1st, and so please upgrade your projects dependencies before this date!