未找到文件错误Google Drive API [英] File not found error Google Drive API
本文介绍了未找到文件错误Google Drive API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用Drive REST API下载文件。我正在使用文件ID发出一个GET请求,并且我得到一个文件未找到异常
。
I am using the Drive REST API to download a file. I am making a GET request using the file id and I get a file not found exception
.
{
"error": {
"errors": [
{
"domain": "global",
"reason": "notFound",
"message": "File not found: xxxxx",
"locationType": "other",
"location": "file"
}
],
"code": 404,
"message": "File not found: xxxxx"
}
}
我也生成了apikey,我在我的GET请求中使用它。该文件确实存在,所以我不确定我在这里丢失了什么。
I have also generated the apikey and I am using it in my GET request.The file does exist so I am unsure what I am missing here.
推荐答案
已解决。在对文件元数据进行GET请求时,我没有提供正确的access_token。我重新生成了授权码,access_token,现在我的代码正在工作。
This is resolved. I wasn't providing the correct access_token when making the GET request for file metadata. I regenerated the authorization code, access_token and my code is working now.
这篇关于未找到文件错误Google Drive API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文