How could I upload file to Google Drive using Google Drive API with Postman?
I also want to set file's name and parent directory.
I try to upload file with following properties:
But I get 403 error:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "parseError",
"message": "Parse Error"
}
],
"code": 400,
"message": "Parse Error"
}
}
I have resolved my problem, using answer on this question: How to send application/json data along with file in postman multipart/form-data post request?.
1) create file for upload to Google Drive: test.txt
;
2) create file upload-options.json
with file's metadata properties in json format:
{
"name": "my-uploaded-file.txt",
"parents": ["<parent-directory-id>"]
}
3) add two form-data
fields: