People API not retrieving all contacts

116 Views Asked by At

I'm using the Google People API to retrieve my contacts, but I'm not able to retrieve all of them. I've checked my API key and quotas, and everything seems to be in order. I've also verified that the contacts I'm trying to retrieve are not hidden.

Here's the a part of the code I'm using to make the API request:

URI uri = URI.create("https://people.googleapis.com/v1/people/me/connections?pageSize=2000&personFields=names");
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = 
  HttpRequest.newBuilder()
    .uri(uri)
    .header("Authorization", "Bearer " + accessToken)
    .GET()
    .build();

The API is only returning 1000, even though I have 2700 contacts stored in my account. I actually would like to have a solution not to be limited in only 2000 or less, i want to be able to get all my contacts so that i can save them in my database. I would appreciate any help in resolving this issue.

0

There are 0 best solutions below