When I try to setup the API call, it doesn’t detect the JSON array (list), presumably because of the escaped JSON. Is there a solution to this? How can I get the API to correctly detect the list?
There’s a lot of topic about this API and this response. Basically, the API return a string that contain a JSON. You will probably find solutions in other topic.
One can be to use one of the JSON tools available in plugins marketplace.
Another is to send the JSON to a backend WF and let Bubble parse it. You need to get the same JSON structure each time.
I can parse it afterwards. In fact, it’s pretty easy to un-escape the JSON with a simple find & replace operation. However, my problem is that I need to use the array (list) that is returned as the data source for a repeating group. I don’t believe I can do that if I parse that response afterwards? It has to be detected as a list from the API connector.
a) send the json to backend WF using API connector and send it as text. Use return data from API. Put the whole json text in a raw response as JSON.
B) save the json to file. Use api connector to call the file url.
Certainly! Below is an example of an API response containing escaped JSON:
{
"status": "success",
"data": "{\"user\": {\"id\": 1, \"name\": \"John Doe\", \"email\": \"john.doe@example.com\"}, \"messages\": [{\"id\": 101, \"text\": \"Hello, John!\"}, {\"id\": 102, \"text\": \"Your order has been shipped.\"}]}"
}
In this example, the data field contains a string that is an escaped JSON object. The backslashes (\) are used to escape the double quotes within the JSON string. When parsed, the data field will be interpreted as a nested JSON object.