I need to transform the multiline input into “an array of strings” according to the API documentation, which is what I thought I was going to achieve with the ‘split by’.
Ah… ok… not quite…
The API call body is just a string… (text)
when you use :split by on a text, it converts it into a list of texts
Say for example, you have a single text (i.e. tha value of a multiline input):
www.url1.com
www.url2.com
www.url3.com
Using :split by and pressing enter to set the delimiter to a line break, will split that single text into a list of texts:
www.url1.com
www.url2.com
www.url3.com
When you print that list into a text (as you are in the URL parameter of the API call) Bubble will separate each one with a comma and a space
So the actual text being input into your API will be (using the above example):
www.url1.com, www.url2.com, www.url3.com
Or… in context:
"batch": {
"urls": [
"www.url1.com, www.url2.com, www.url3.com"
],
"concurrency": 1
}
which is incorrect… it should be:
"batch": {
"urls": ["www.url1.com", "www.url2.com", "www.url3.com"],
"concurrency": 1
}
or
"batch": {
"urls": [
"www.url1.com",
"www.url2.com",
"www.url3.com"
],
"concurrency": 1
}
so, first you need to remove the quotes from outside the urls key in your JSON body (change "<urls>"
to <urls>
Then, in the url parameter when making the api call you need to use:
MultilineInput ASINs's value: split by: format as text
Where, again, you split the input text by a linebreak…
Then, in the format as text operation, for each item you’ll need to show "This text"
And for the delimiter put a comma (and a space if you like, or a line break)