私はいくつかのドライブ機能を実装するアプリケーションを構築しています。今、私はgoogle-api-ruby-client gemを使ってファイルを共有しようとしています。私は次のコードを使用していくつかの問題を抱えています。私はこのエラーを解決することができないRails Drive Rest Api | google api client gemを使ってファイルを共有する
{
"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."
}
}
:私はこのコード、コールバック・ショーこれを実行
#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: "[email protected]")
@drive.create_permission(file_id:"0B8XBWuVEmvN8YS01OXNUcHhOYWs",permission_object: per, fields: "id", &callback)
。誰か助けてくれますか?
デバッガが@ drive.create_permission行を指しています –