google-api-ruby-client当前用户没有足够的权限来执行请求的操作
我使用google-api-ruby-client google-api-ruby-client为我的后端服务器validationandroid inapppurchase代码(见下文):
require 'google/api_client' require 'google/api_client/client_secrets' require 'google/api_client/auth/installed_app' API_VERSION = 'v1.1' service_account_email = 'xxx@developer.gserviceaccount.com' # Email of service account key_file = 'xxx.p12' # File containing your private key key_secret = 'notasecret' # Password to unlock private key scope_url = 'https://www.googleapis.com/auth/androidpublisher' client = Google::APIClient.new( :application_name => 'Ruby Inapppurchases validate', :application_version => '1.0.0') key = Google::APIClient::KeyUtils.load_from_pkcs12(key_file, key_secret) client.authorization = Signet::OAuth2::Client.new( :token_credential_uri => 'https://accounts.google.com/o/oauth2/token', :audience => 'https://accounts.google.com/o/oauth2/token', :scope => scope_url, :issuer => service_account_email, :signing_key => key) client.authorization.fetch_access_token! publisher = client.discovered_api('androidpublisher', 'v1.1') p client.execute( api_method: publisher.inapppurchases.get, parameters: { packageName: 'com.examble', productId: 'android.test.purchased', token: "inapp:com.examble:android.test.purchased" }).data
我按照api的说明,但我的错误如下:
#{"errors"=>[{"domain"=>"androidpublisher", "reason"=>"permissionDenied", "message"=>"The current user has insufficient permissions to perform the requested operation."}], "code"=>401, "message"=>"The current user has insufficient permissions to perform the requested operation."}}>
这让我很烦恼。 谁能帮我?
- 为什么Google的自定义搜索API说我在使用Ruby客户端时缺少访问令牌?
- 为什么Google API无论输入设置了+01偏移量?
- 403尝试获取Google Analytics数据时权限不足错误
- 如何从服务帐户谷歌驱动器api下载文件?
- 如何使用OAuth 2.0为Ruby中的google预测API进行授权?
- cron crawler使用Ruby中的Google API将数据插入Google电子表格的授权问题
- 通过Gmail API创建包含收件人的Gmail草稿
- Ruby Google Calendar Integration观看事件/推送通知
- 使用Ruby中的Google Apps API和服务帐户时出现问题