request = {
"parents": ["1zaxxxxxxxxxxxxxxxZo"],
"name": selected_name
}
headers = {
"Authorization": "Bearer "+creds.token,
"Accept": "application/json",
"Content-Type": "application/json"
}
data = {
"fileId": file_id,
"request": request,
"fields": "files(id)",
"supportsAllDrives": True,
"ignoreDefaultVisibility": True
}
response = requests.post("https://www.googleapis.com/drive/v3/files/"+file_id+"/copy", data=data, headers=headers)
response = response.json()
I am trying to make a request to copy the file_id to the parent folder listed in my request. I am new to both google drive's api and making post requests, I can't understand what I'm doing wrong. I have been working on this issue for multiple hours now, and I'm getting a error response code 400, Parse Error. From what I have gathered, it means I'm formatting my request improperly. I've been trying different things for a long time now, I can't figure out how to make it properly. If anyone could help me it would be greatly appreciated, or point me to where to look to fix this issue on my own. I've been reading the docs, maybe I've bitten off more then I can chew. Thank you.