Question

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.

Was it helpful?

Solution

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/someone@gmail.com/full?access_token=xyz&alt=json&callback=JSON_CALLBACK")
  .success(function(data, status, headers, config) { ...})
  .error(function(data, status, headers, config) {...})

OTHER TIPS

Does this API fit what you need? Looks like it uses HTTP requests and XML - not entirely Javascript, but can be done in Javascript/jQuery with AJAX.

There is no problem using the deprecated GData Client Library to access the Contacts V3 API while also using the official Google APIs JS Client. You just won't be able to get any official support for the GData library.

Otherwise, depending on your use case, the Google+ API is compatible with the official JS Client and may fit your needs.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top