The Google v3 Contact API does not provide a JavaScript SDK.
However, if you want to handle importing contacts on the client side, you can do this by calling ajax:
var clientId = 'XXX'; var apiKey = 'XXX'; var scopes = 'https://www.google.com/m8/feeds'; $(document).on('click', '.js-google_contacts', function() { gapi.client.setApiKey(apiKey); window.setTimeout(checkAuth, 3); }); function checkAuth() { gapi.auth.authorize({ client_id: clientId, scope: scopes, immediate: false }, handleAuthResult); } function handleAuthResult(authResult) { if (authResult && !authResult.error) { $.get('https://www.google.com/m8/feeds/contacts/default/full?alt=json&access_token=' + authResult.access_token + '&max-results=700&v=3.0', function(response) {
Hope this helps!
Tristan
source share