久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

Google Drive 服務帳號返回 403 usageLimits

Google Drive service account returns 403 usageLimits(Google Drive 服務帳號返回 403 usageLimits)
本文介紹了Google Drive 服務帳號返回 403 usageLimits的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我正在嘗試編寫一個 AppEngine 應用程序,該應用程序將 Google 文檔寫入 Google Drive,放入一組特定的文件夾并設置訪問權限.我可以使用舊的 DocsList API,但由于它剛剛被棄用,我決定更新我的代碼(無論如何我還有一些額外的功能要添加).

I'm trying to write an AppEngine app that writes a Google Document to Google Drive, puts in a specific set of folders and sets access rights. I have this working with the old DocsList API but since that just got deprecated I decided to update my code (and I had some additional functions to add anyway).

我面臨的問題是:當我使用服務帳戶并嘗試模擬特定用戶時,即使我沒有用完任何配額,我也會收到帶有 usageLimits 的 403.

Problem I'm facing is this: When I use a service account and try to impersonate a specific user I get a 403 with usageLimits even though I have not used up any of my quota.

這是我正在使用的代碼:

Here is the code I'm using:

GoogleCredential credentials = new GoogleCredential.Builder()
                 .setTransport(HTTP_TRANSPORT)
                 .setJsonFactory(JSON_FACTORY)
                 .setServiceAccountId("xxxxxxxxxxgserviceaccount.com")
                 .setServiceAccountScopes(DriveScopes.DRIVE)
                 .setServiceAccountPrivateKeyFromP12File(
                                    new java.io.File("xxxx-privatekey.p12"))
                 .setServiceAccountUser("user@xxxxxx.org").build();

我會使用這些憑據來啟動我的 Drive 對象:

I than use these credentials to initiate my Drive object:

Drive d = Drive.builder(httpTransport, jsonFactory)
               .setHttpRequestInitializer(credentials)
               .setJsonHttpRequestInitializer(new JsonHttpRequestInitializer() {
                @Override
                public void initialize(JsonHttpRequest request) {
                    DriveRequest driveRequest = (DriveRequest) request;
                    driveRequest.setPrettyPrint(true);
                }
            }).setApplicationName("MYAPPNAME").build();

順便說一句:我嘗試過使用 new Drive(....) ,但無論我嘗試什么都行不通.不斷拋出找不到內部方法的錯誤!

BTW: I've tried using new Drive(....) but that just won't work, no matter what I try. Keeps throwing errors that internal methods are not found!

回到這個問題:當我使用 'd' 調用類似 .files().get("SOMEFILEID").execute() 的東西時,我得到一個 403

Back to this issue: When I than use 'd' to call something like .files().get("SOMEFILEID").execute() I get a 403

{ "code" : 403,
"errors" : [ {
    "domain" : "usageLimits",
    "message" : "Daily Limit Exceeded. Please sign up",
    "reason" : "dailyLimitExceededUnreg",
    "extendedHelp" : "https://code.google.com/apis/console"
  } ],
  "message" : "Daily Limit Exceeded. Please sign up"
}

我不明白為什么這不起作用.我在網上看了一整天,但找不到合適的答案.非常感謝一些幫助.

I can't figure out why this doesn't work. I've look online all day but can't find a suitable answer. Some help is very much appreciated.

推薦答案

當 API 調用缺少 Authorization http 標頭時,我通常會得到 403.跟蹤 http 并查看標頭.配額"消息的基本原理是,如果沒有 Auth 標頭,您就是匿名的,匿名使用的配額為零.

I usually get a 403 when the API call was missing the Authorization http header. Trace the http and look at the headers. The rationale for the "quota" message is that without an Auth header, you are anonymous, and the quota for anonymous use is zero.

您還可以檢查您的應用是否已注冊兩個 Drive API,因為我聽說這可能會導致同樣的問題.

You might also check that your app is registered for both of the Drive APIs, as I've heard that that can cause the same problem.

關于內部方法問題,聽起來您使用的是不兼容的庫版本.最適合我的方法是刪除我下載的所有庫以及示例代碼,然后使用 Google Eclipse 插件Google/Add Google APIs..."下載所有最新版本.

On the internal method issue, that sounds like you're using incompatible library versions. What worked best for me was to delete all of the libraries I had downloaded with the sample code, then use the Google Eclipse plugin to "Google/Add Google APIs..." to download all of the latest versions.

這篇關于Google Drive 服務帳號返回 403 usageLimits的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Upload progress listener not fired (Google drive API)(上傳進度偵聽器未觸發(Google 驅動器 API))
Save file in specific folder with Google Drive SDK(使用 Google Drive SDK 將文件保存在特定文件夾中)
Google Drive Android API - Invalid DriveId and Null ResourceId(Google Drive Android API - 無效的 DriveId 和 Null ResourceId)
Google drive api services account view uploaded files to google drive using java(谷歌驅動api服務賬戶查看上傳文件到谷歌驅動使用java)
com.google.api.client.json.jackson.JacksonFactory; missing in Google Drive example(com.google.api.client.json.jackson.JacksonFactory;Google Drive 示例中缺少)
Check progress for Upload amp; Download (Google Drive API for Android or Java)(檢查上傳和進度下載(適用于 Android 或 Java 的 Google Drive API))
主站蜘蛛池模板: 麻豆91精品91久久久 | 亚洲一区二区三区在线 | 成人免费在线视频 | 最新国产在线 | 亚洲国产成人精品女人 | 人人鲁人人莫人人爱精品 | 一级欧美| 亚洲黄色网址视频 | 九九av| 成人精品一区二区三区中文字幕 | 可以免费看的毛片 | 国产视频1 | 成人在线播放网站 | 欧美一区二区三区高清视频 | 人人干人人干人人 | 四虎永久影院 | 一区二区在线 | 成人网av | 99久热在线精品视频观看 | 欧美性猛交一区二区三区精品 | 亚洲精品久久久久久久久久久久久 | 日本不卡一区 | 激情五月综合 | 国产日韩欧美一区 | 欧美色综合一区二区三区 | 91香蕉嫩草 | 大陆一级毛片免费视频观看 | 99久久精品免费视频 | 欧美激情视频一区二区三区在线播放 | 在线观看中文字幕 | 91精品国产91久久久久久最新 | 精品av| 91动漫在线观看 | 国产精品美女久久久久aⅴ国产馆 | 国产精品日本一区二区不卡视频 | 精品久久久久一区二区国产 | 精品国产乱码久久久久久中文 | 欧美成人一区二区三区 | 韩国精品在线观看 | 美女在线视频一区二区三区 | 国产蜜臀97一区二区三区 |