Hi guys,
I have an API action that handles a few things and should upload using an API call a file to google drive. So far so good but i always get an empty file. I am pretty sure it is the way the binary content is managed by the api call. The data is received in the api action from a simple form with an input file. In the api action inputs i have entered an object variable fileToSend and modified the call of the API call like that :
{
“name”: “api”,
“module”: “api”,
“action”: “send”,
“options”: {
“method”: “POST”,
“url”: “https://www.googleapis.com/upload/drive/v3/files?uploadType=media”,
“headers”: {
“Authorization”: “{{'Bearer '+get_tokens[0].access_token}}”,
“Content-Type”: “{{$_POST.fileType}}”
},
“data”: “{{$_POST.fileToSend}}”
// I have tried with “body”: “{{$_POST.fileToSend}}” same result
},
“output”: true
}
Thank you