Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

accessing google contacts with google api javascript client - how?

I am implementing a client side only webapp based on the google api javascript library. Unfortunately, this library doesn't support contacts. Or does it? Is it an undocumented feature? If not, is there another working way to access contacts? E.g. with the deprecated gdata api? I already found some answers about this topic on stackoverflow. But none of them have me a clear answer.

like image 951
David Graf Avatar asked Oct 04 '22 16:10

David Graf


1 Answers

Since I need read access only, I decided to use jsonp to access the contacts. Otherwise, I need to use an additional library which is deprecated and a deprecated api version (because the gdata client library doesn't support the contacts api version 3).

Since I have the access token already, it's pretty easy to get contact data:

http.jsonp(https://www.google.com/m8/feeds/contacts/[email protected]/full?access_token=xyz&alt=json&callback=JSON_CALLBACK")
  .success(function(data, status, headers, config) { ...})
  .error(function(data, status, headers, config) {...})
like image 71
David Graf Avatar answered Oct 10 '22 04:10

David Graf