我正在构建一个实现一些驱动功能的应用程序。现在我正在尝试使用google-api-ruby-client gem共享一个文件。我在使用下面的代码时遇到了一些问题。
#Here, I create a DriveService object and I authorize it.
#This works fine. In my app I list drive files well.
@drive = Google::Apis::DriveV3::DriveService.new
@drive.authorization = @token[:access_token]
#Here, first I create a permission object with some parameters
#Then I call create_permission to share the file to a other user
per=Google::Apis::DriveV3::Permission.new(type: "user", role: "writer",email_address: "some@gmail.com")
@drive.create_permission(file_id:"0B8XBWuVEmvN8YS01OXNUcHhOYWs",permission_object: per, fields: "id", &callback)当我执行这段代码时,回调显示如下:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "required",
"message": "The permission type field is required.",
"locationType": "other",
"location": "permission.type"
}
],
"code": 400,
"message": "The permission type field is required."
}}
我不能解决这个错误。有人能帮我吗?
https://stackoverflow.com/questions/41559034
复制相似问题