What are my options when sending a list of items through the API connector?
What is the request of the API? This is the main question!
Each API will have different format for a list.
POST/ creating contentt
Provide API doc or expected payload! This is what tell you what you need to send to the API
@Jici The bubble API Docs state that they dont support lists so im searching for a way to send a list
When you talk about API connector… you mean the plugin API Connector right?
This support list.
If you talk about Workflow API (or backend WF), they support list too.
So actually, it’s hard to tell you what you need to do without getting more info about what the API you trying to reach expect. So if you have doc url to API, we can probably help you.
Again… this depend of the API!
[“texta”,“textb”]
Is a list of text
[{“id”:“value”}.{“id”:“value”}] is an object list
parameter1[]=aaaa¶meter1[]=bbb is also a list… in url
parameter1[0]=aaa¶meter2[0]=aaa¶meter1[1]=bbb¶meter2[1]=bbb is also a list of object
@Jici what are you trying to say?
The api has an array within the call, bubble needs to send an array to the backend so it can store that array
Do you have API Documentation to the endpoint what you are trying to reach? not just /POST creating content
of course
So share the url to the doc!
We cannot help if we don’t know what the API expect!
Example:
this will let you know: The type of the body. The type of the request. The authorization process. The requested headers. And finally, the body structure.
Each API are differents and will request you to provide the list in a different format. There’s no possible answer without this documentation.
trying to send image URLs (metadata)
"images": [
{
"path": "string",
"name": "string",
"type": "string",
"size": 0,
"mime": "string",
"meta": {},
"url": "string"
}
]
}
This would be a list of image URLs
Actually, this JSON is not complete. But basically, you will set in JSON Body
"image":[<image_list>]
This will let you dynamically provide an image list. The parameters value for image list will be {“url”,“urlimage”,“name”:“imagename”}
(Replace the url image and imagename by real value). Initialize API
Once it’s done, in front end, you will load the list of image and use :format as text or format as JSON safe (this will encode the json, can be usefull when sending url sometimes)
And you will set the text to: {“url”,“This image url(dynamic)”,“name”:“This image name(dynamic”} with a , (comma) as separator
@Jici when sending each items URL it doesn’t send the (https:) so i need to hardcode it in, example:
So its grabbing the <image_list> but each item in that list isnt going to have the (https:)
You just need to encode it in the :format as text function
But actually, the screenshot you show doens’t have the same structure
the format as text will look like: “https:This image url” (This iamge url is dynamic)
with the same separator , (comma)
In the body, it will be "content": [<imagelist>]
content to show per list item is not correct,
You need to use (including quotes) “https:This file url”
And set delimiter to ,
Format as text take a list and format it the way you want. You need to use This… to use current item and format it
its only grabbing 1 image within the list. the input shows both images but response only gets 1
Share what you have set now And step by step in debuger mode