久久久久久久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))
主站蜘蛛池模板: 日韩av免费在线电影 | 黄色大片网站 | 国产成人午夜高潮毛片 | 亚洲一区二区三区视频 | 爱爱视频日本 | 久久精品二区 | 成人国产在线观看 | 中文字幕 在线观看 | 免费视频久久 | 亚洲综合一区二区三区 | 蜜桃在线一区二区三区 | 精品香蕉一区二区三区 | 欧美一区二区三区视频在线 | 亚州视频在线 | 欧美男人亚洲天堂 | 国产中文视频 | 国产精品不卡视频 | 欧美激情 亚洲 | 伦理二区| 日韩久久久久久 | 欧美日韩视频在线 | 日韩高清国产一区在线 | 精品美女 | 久久99久久 | 黑人巨大精品欧美一区二区免费 | 精品一区二区电影 | 国产9 9在线 | 中文 | 国产精品久久久久久久久久三级 | 日本三级电影在线看 | 国产精品久久久久久久久久免费看 | 日韩视频观看 | 婷婷精品| 欧美一级α片 | 国产成人精品一区二区三区在线 | 欧美一区二区二区 | 国产精品伦理一区 | 中文在线一区二区 | 色婷婷综合久久久中字幕精品久久 | 欧区一欧区二欧区三免费 | 色婷婷狠狠 | 久久久久久999 |