什么是超出用户率的例外。

时间:2013-09-19 13:04:23

标签: java oauth-2.0 google-admin-sdk

我正在使用admin sdk。我正在使用java检索每个请求100个用户。 https://developers.google.com/admin-sdk/directory/v1/guides/manage-users#get_all_domain_users

   Directory directoryService = getDirectoryService(adminEmailAddress);
   Directory.Users.List list = directoryService.users().list();
    list.setDomain(adminEmailAddress.substring(adminEmailAddress.indexOf('@')+1, adminEmailAddress.length()));
    list.setMaxResults(100); 

我正在低于例外

<HTML>
<HEAD>
<TITLE>User Rate Limit Exceeded</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>User Rate Limit Exceeded</H1>
<H2>Error 403</H2>
</BODY>
</HTML>

at com.google.api.client.auth.oauth2.TokenResponseException.from(TokenResponseException.java:105)
at com.google.api.client.auth.oauth2.TokenRequest.executeUnparsed(TokenRequest.java:287)
at com.google.api.client.auth.oauth2.TokenRequest.execute(TokenRequest.java:307)
at com.google.api.client.googleapis.auth.oauth2.GoogleCredential.executeRefreshToken(GoogleCredential.java:269)
at com.google.api.client.auth.oauth2.Credential.refreshToken(Credential.java:489)
at com.google.api.client.auth.oauth2.Credential.intercept(Credential.java:217)
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:858)r code here

任何人都可以告诉我,这个例外是什么,它的根本原因并修复它。?

1 个答案:

答案 0 :(得分:1)

它正是它所说的:你过快地调用API调用,所以你得到了403 Forbidden个回复。减慢通话速度,或申请增加配额。

编辑:显然,无效凭据也可能会触发配额警告,因此请确保您的OAuth凭据有效。