Need help with Google Drive API multipart upload

Hello guys,

I'm playing around with Google Drive API to upload files and got the simple upload working. However I can't seem to get the multipart upload to work. My best guess is that the culprit is the way Xano sends the request body over when making the external API call.

Here's the link to the Google Drive API upload: https://developers.google.com/drive/api/guides/manage-uploads#multipart

The format of the request body needs to be in the following format (note that the space between the Content-Type line and the next line of data is a must):
--some_boundary
Content-Type: application/json; charset=UTF-8


--some_boundary
Content-Type:


--some_boundary--My setup of the request body:[Screenshot 2022-07-22 at 11.48.04 AM.png]And I always get an error 400 when I make the call. When I look at the debugger, this is what gets sent over to the endpoint where the newlines get eliminated. I have also tried to put everything in an array and then join them using a ' n'|json decode| connector with the same results:[Screenshot 2022-07-22 at 11.54.34 AM.png]
I tried setting things up in Postman exactly the way it was setup in Xano with the proper newlines inserted in the request body and it works successfully:[Screenshot 2022-07-22 at 11.56.42 AM.png]Here's the snippet of my setup: https://www.xano.com/snippet/eMZboSN4

Would appreciate if anyone could shed some light into this and suggest any possible workarounds. Thanks!
Working with APIs
4 replies