I use the set variable tool to remove empty strings from the array and then use the output of that to make the API call, which doesn’t work because of the space that’s being added in between each item in the array (as shown above).
Share the Dropbox module details and your full input bundle. Seems weird to need to remove spaces. It’s valid json either way as long as there is a valid json structure for Dropbox.
It might look a little strange with the red stripes, but I have no easy way to show it without hiding personal info like this. I will try my best to explain what went good and what went wrong.
Basically when I test the automation with 1 item in the array, it works like a charm.
When I try it with multiple items in the array, it doesn’t work anymore.
This is my Dropbox API setup:
This is my ‘set variable’ array output with 1 item:
The above works without issue:
Have you tested what does work in something like postman? What’s the api spec for multi file upload with Dropbox? Maybe your array is not correct for the paths key?
This is a case of some sort of weird gremlins in the body. Can you look in the input bundle on the make api call and see what the underlying structure actually is?
See the little icon in the upper right that has a little down arrow. You can look at output bundle. And then you want to try this all in postman to see actually what make api is supposed to do.
Postman seems a little bit too complicated for my skill level in all of this. What is interesting though is that the following works in comparison to the snippet of code I provided above:
The only real difference that I can spot is the space between the seperate items in the array that’s present in the first snippet (multiple items) and isn’t there in the second snippet (the one with 1 item that actually works).
That would be a first indeed. An api that forces no spaces in an array. It may be the escaping that’s causing issues too. Try postman. You’ll have a bit of a learning curve but it will save you lots of time when using make api call. You need to figure out what actually will work for multiple paths.
I’ll look into postman, but for now I have figured out that the space might actually be the issue at hand here. I copied the inputs manually into the API and it returned an error. I then removed the spaces between the items manually, ran it again and it succesfully ran the entire call.
So I guess my question is is it possible to remove the space from the array and if so, how?
I have been playing around with Replace for a while before waking up to this comment, but funnily enough everything I try removes anything but the space that it should remove. Your suggestion removes all the spaces from the items as well, and yet still refuses to remove the space between the different items.
First I composed a string from the array:
Then I replaced the spaces with empty strings:
The output is as follows:
It might be an issue on Make’s side of things, because I had a similar issue with mapping a body in the Discord API and then used the “Assemble Body” function and it worked like a charm. For some reason the Dropbox module doesn’t come with this option. I’ll keep trying to find a way to turn the array into an actual string and then remove the space.