Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

Can not create shortcut of file using google drive api

$
0
0

Here is sample code that i am trying to run.

import requestsapi_endpoint = 'https://www.googleapis.com/upload/drive/v3/files?supportsAllDrives=true'headers = {'Authorization': f'Bearer {access_token}'}json={"name": "a.jpg", "mimeType": "application/vnd.google-apps.shortcut", "parents": [{"id": "folder_id"}], "shortcutDetails": {"targetId": "target_file_id"}}res = requests.post(api_endpoint, headers=headers,  json=json)print(res.status_code)print(res.text)

Even this code does not pickup that name and it just create a text file that contain json data.


Viewing all articles
Browse latest Browse all 23131

Trending Articles