Google drive api:范围“drive.file"的复制错误和“drive.readonly" [英] Google drive api: copy error with scopes "drive.file" and "drive.readonly"

查看:23
本文介绍了Google drive api:范围“drive.file"的复制错误和“drive.readonly"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是,如果您只有范围drive.file"和drive.readonly",是否无法使用 google drive api 将文件从驱动器中的一个文件夹复制到驱动器中的另一个文件夹?

My question is if it is not possible to copy a file from one folder in drive to another folder in drive with the google drive api if you only have the scopes "drive.file" and "drive.readonly"?

使用 API 资源管理器进行测试:https://developers.google.com/驱动器/v2/参考/文件/副本错误是:经过身份验证的用户尚未授予应用 X 对文件 Y 的写入权限".

Tested using the API explorer: https://developers.google.com/drive/v2/reference/files/copy The error is: "The authenticated user has not granted the app X write access to the file Y".

创建一个文件(使用相同的范围)并复制它是可能的.

Creating a file (using the same scopes) and copying it is possible however.

推荐答案

由于很难找到有关 google drive api 的信息,所以我想问并提出答案.

Figured I ask and put the answer up since it's hard to find info about the google drive api.

这是可能的,但您还需要 "drive.metadata" 范围才能使其工作.您可以使用驱动器"范围,但这提供了比需要更多的访问权限.

It is possible but you also need the "drive.metadata" scope for it to work. You can ofc use the "drive" scope but that provides more access than needed.

这篇关于Google drive api:范围“drive.file"的复制错误和“drive.readonly"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆