Emag
(Emag)
February 26, 2025, 2:29am
1
I want to upload a text file to Google Drive using the Google Drive API.
I tested it with Postman, and it worked using the following code:
curl --location 'https://www.googleapis.com/upload/drive/v3/files?uploadType=media' \
--header 'Authorization: Bearer [access_token]' \
--header 'Content-Type: text/plain' \
--data 'Hello from Postman'
However, when I tried the same method on Kodular, I got the following error:
401 Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential.
Did I do something wrong, or is this not possible on Kodular? Do I need to use Google Apps Script instead?
Taifun
February 26, 2025, 12:35pm
2
The request header is a list of key value pairs
i.e. the value is Bearer ya29…
Aldo it might be necessary to add a second key value pair, see again your curl example
Content-Type
text/plain
Taifun
1 Like
Emag
(Emag)
February 27, 2025, 8:02am
3
Sorry, I didn’t notice earlier. The saved image is incomplete. This is how it should be. Please check again. Thank you!
SyntaxCore
(Mahir Labib)
February 27, 2025, 9:07am
4
Hi try this one. It may work. Ensure spelling.
1 Like
Emag
(Emag)
February 27, 2025, 12:01pm
5
Thank you very much, it works.
system
(system)
Closed
March 29, 2025, 12:01pm
6
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.