1

you can refer this protocol: http://code.google.com/apis/apps/profiles/developers_guide_protocol.html

John Saunders
  • 160,644
  • 26
  • 247
  • 397
Mak
  • 108
  • 5
  • I answered differently according to someone else suggestion : [here][1] [1]: http://stackoverflow.com/questions/3350778/modify-http-headers-for-a-jsonp-request/23885498#23885498 – Azr May 27 '14 at 09:23

1 Answers1

0

try this thing:

function Retrivecontact() {  
   netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");  

   $.ajax({  
     type: 'GET',  
     url: 'https://www.google.com/m8/feeds/contacts/'+domain+'/full?alt=json',  // Url used to get full shared contacts in json form
     //~ url: 'https://www.google.com/m8/feeds/profiles/domain/'+domain+'/full/dhaval.khandhedia?alt=json',  
     //~ url: 'https://www.google.com/m8/feeds/profiles/domain/'+domain+'/full?alt=json',  
     //~ url: 'https://www.google.com/m8/feeds/profiles/domain/'+domain+'/full/dhaval.khandhedia',  
     //~ url: 'https://www.google.com/m8/feeds/profiles/domain/searcelabs.com/full/dhaval.khandhedia',  
     //~ url: 'https://www.google.com/m8/feeds/profiles/domain/searcelabs.com/full',  
     //~ url: 'https://www.google.com/m8/feeds/contacts/'+domain+'/full/378c2a728e358d2b',  
     //~ url: 'https://www.google.com/m8/feeds/contacts/'+domain+'/full?start-index=1',     // Url used to get full contacts in XML
     //~ url: 'https://www.google.com/m8/feeds/contacts/kapil.kaisare@searceapps.com/full?max-results=200&start-index=1',     // Url used to get full CONTACTS in XML of a user

     beforeSend: function(xhr) {  
       $('#data').html('Getting...');  
       xhr.setRequestHeader('GData-Version', '3.0');
       xhr.setRequestHeader('Authorization', 'GoogleLogin auth=' + token);  
     },  
     success: function(resp) {  
     alert($.toJSON(resp));
       //~ var names = $(resp).find('entry>title').text(); /// when XML
            //~ alert(names)
            //~ $('#data').html(names);  
            printjsoncontact(resp);
     },
     error: function(){
    $('#data').html("Error in Request");
     }
   });  
 }  

function printjsoncontact (json)
{
$('#data').html("");
    var length =  json.feed.entry.length;
    for (var i=0; i<length; i++)
    {
        var title = json.feed.entry[i].title.$t;
        etag = json.feed.entry[0].gd$etag
        alert(etag);
        var updated =  json.feed.entry[i].updated.$t;
        var temp = "Title: "+title+", Updated On: "+updated+" </br>";
        $('#data').append(temp);

    }
Mahesh Thumar
  • 4,257
  • 5
  • 22
  • 30
  • The suggested code results in:
    405 (Method Not Allowed)
    and
    XMLHttpRequest cannot load https://www.google.com/m8/feeds/contacts/default/full. Origin ... is not allowed by Access-Control-Allow-Origin.
    –  Jul 07 '12 at 19:30