0

I am using the admin sdk. I am retrieving 100 users per request using java. 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); 

I am getting below Exception

<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

can anyone tell me , what is this exception , root cause of it and fix for it.?

RBP
  • 481
  • 1
  • 9
  • 29

1 Answers1

1

It's exactly what it says: You were making API calls too fast, and so you got a 403 Forbidden reply. Slow down your calls, or apply for an increased quota.

EDIT: Apparently, it's also possible for invalid credentials to trigger quota warnings, so make sure your OAuth credentials are valid.

chrylis -cautiouslyoptimistic-
  • 75,269
  • 21
  • 115
  • 152
  • slowing down means should i minimize the count to 50.? or anything else – RBP Sep 19 '13 at 14:34
  • I have arraylist of 2000 users, I am using below code to update on google. for(int i=0; i – RBP Nov 28 '13 at 06:08