ItGo.me Focus on IT Recommend

Home > python - Http 404 when using Google Drive Api with GMail

python - Http 404 when using Google Drive Api with GMail

2020腾讯云8月秒杀活动,优惠非常大!(领取2860元代金券),
地址https://cloud.tencent.com/act/cps/redirect?redirect=1040

2020阿里云最低价产品入口,含代金券(新老用户有优惠),
入口地址https://www.aliyun.com/minisite/goods

It seems that the following code fails with a Http404 error if users open GMail attachments with the new GMail/Drive api

state = request.GET['state']
fileId = (state.get('ids')+state.get('exportIds'))[0] 
file = self.client.files().get(fileId=fileId).execute()
==> Http404 (Failed) if I use the drive.file scope
==> Http200 (Success) if I use the drive.readonly scope 

To be clear: This code works perfectly when users open files directly from Google Drive. It just seems to hit alot of 404 errors when users use the new GMail/Drive api

Recommend:http post - Files:insert - Google Drive SDK - Python Example - What is Drive API service instance

ing) a file to Google Drive using Python and the Drive API. Here is the link showing the code near the bottom of the page: Write a file to a Google Drive using Python A function named: insert_file is defined in the Python module. def insert

oriUlr:http://stackoverflow.com/questions/23050089/http-404-when-using-google-drive-api-with-gmail

------splitte line----------------------------