Determine number of contacts with Google People API -


i using google people api fetch user's connections, , since results not include email addresses, phone numbers, etc. after call people.connections.list , retrieve total of 50 results polling people:batchget fetch data users (which accepts 50 users @ time). works fine, , after looping on results few times can import of contacts. great!

but because of setup , need loop (some users have thousands of connections after all) using process (basically) redirects on , on until we're done. working fine, i'd love show progress bar on redirect screens, , in order i'd need know total number of connections user has. can't seem find way determine number of total results people.connections.list return (provided no filters or sync tokens passed in). know way can determine how many connections total need loop on people.connections.list?

what language using? works me in java.

// user's connections listconnectionsresponse r = peopleservice.people().connections()         .list("people/me")         .setpagesize(500)         // specify fields returned         .setrequestmaskincludefield("person.names,person.emailaddresses")         .execute();  list<person> connections = r.getconnections(); system.out.println(connections.size()); 

you add fields included if use url:

https://people.googleapis.com/v1/people/me/connections?pagesize=500&requestmask.includefield=person.names%2cperson.emailaddresses&key={your_api_key} 

Comments

Popular posts from this blog

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -