How to retrieve google contact groups using url.?

295 views Asked by At

I am retrieving contacts groups of users. I have to show groups by pagination. So i am doing like this,

URL feedUrl1 = new URL("https://www.google.com/m8/feeds/groups/"+userEmail+
 "/full/?xoauth_requestor_id"+userEmail+"&start-index=10&max-results=5");

 ContactGroupFeed resultFeed1 = contactService.getFeed(myQuery, ContactGroupFeed.class);

Above query showing results starting from 10 and showing all records. It is not retrieving results based on max-results. Is there is any wrong in it? What is another option for me?

1

There are 1 answers

2
Emily On BEST ANSWER

I did a quick testing, and the max-results parameter is working as intended.

I have total 6 contact groups. Happy 1, Happy 2, Happy 3, Happy 4, Happy 5 and Happy 6.

This is the request I made:

https://www.google.com/m8/feeds/groups/userEmail/full?start-index=1&max-results=5

In the response, I get the parameter <openSearch:itemsPerPage>5</openSearch:itemsPerPage>, and it is only showing Happy 1 - 5 in the result.

I think if you are using the oauth_requestor_id, the URL should looks like this:

https://www.google.com/m8/feeds/groups/userEmail/full?xoauth_requestor_id=userEmail&start-index=10&max-results=5