I am trying to upload a file on my local system to my google drive account using Curl
. I went to Google Developer Console and enabled Google Drive API, created an API-KEY
.
This is my Curl Request
curl -X POST -L \
-H "Authorization: Bearer my_API-KEY" \
-F "metadata={name : 'JUMBA'};type=application/json;charset=UTF-8" \
-F "file=@my_file.json;type=application/zip" \
"https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart"
But I get this Error -
{
"error": {
"errors": [
{
"domain": "global",
"reason": "authError",
"message": "Invalid Credentials",
"locationType": "header",
"location": "Authorization"
}
],
"code": 401,
"message": "Invalid Credentials"
}
}
The documentation is also not very clear. Any help here?