Webflow JSON - How to select only image fields?

Hi Bubblers,

I want to create a tool to optimize and resize images on Webflow.
The principle :

  1. The user gives me his API key of the Webflow site he wants to optimize in an input.
  2. With this API key I make an API call to get all his collections
  3. Then I make an API call to get all the items of a collection (I do this for each collection)
    And that’s where I have a problem.
    Webflow sends me a JSON like this: Webflow CMS API Reference

Knowing that each collection is built differently. So I can’t initialize my data in Bubble on a single model.
And for Bubble, each field is either a boolean or a text.

How to select only the image fields?

Image field will look like this in the JSON file:

“image.fileId”: “602f7da79bec959dbf297090”,
“image.url”: “https://uploads-ssl.webflow.com/602f7da79bec9509d72966ea/602f7da79bec959dbf297090_a-clear-dashboard.png”,
“image.alt”: “”,

Here you can find an example of JSON from Webflow: https://we.tl/t-yIV3ZGMElX

All images from Webflow will be upload with this starting URL “https://uploads-ssl.webflow.com/…”

I guess you would have to parse the information with regex. But I wonder if there is not another way.

Thank you for your help,

This topic was automatically closed after 70 days. New replies are no longer allowed.