I used the 2.0 version of the contacts API with the Gdata library to import client gmail information. This version is no longer supported, and I'm trying to upgrade to V3, but I see that Gdata is not supported with v3, and I spend daily trying to change the current code to work with the "Contact API 3.0" for javascript.
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Gmail Login</title>
<meta http-equiv="content-type" content="text/html;charset=UTF-8"/>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
</head>
<body style="margin:0;padding:0;">
<img src="/images/templates.png" style="display:none;"/>
<script type="text/javascript">
google.load("gdata", "2.s");
google.setOnLoadCallback(function (){
if(window.location.hash=="") {
if(!checkLogin()){
logMeIn();
} else {
var feedUrl = "https://www.google.com/m8/feeds/contacts/default/full";
query = new google.gdata.contacts.ContactQuery(feedUrl);
query.setMaxResults(5000);
myService = new google.gdata.contacts.ContactsService('exampleCo-exampleApp-1.0');
myService.getContactFeed(query, function(result) {
document.cookie="g314-scope-0=";
window.opener.parseGmailContacts(result.feed.entry);
close();
}, function(e){
alert(e.cause ? e.cause.statusText : e.message);
});
}
}
});
function logMeIn() {
scope = "https://www.google.com/m8/feeds";
var token = google.accounts.user.login(scope);
}
function logMeOut() {
google.accounts.user.logout();
}
function checkLogin(){
scope = "https://www.google.com/m8/feeds/";
var token = google.accounts.user.checkLogin(scope);
return token;
}
</script>
</body>
</html>
Does the Google API support API v3.0 support javascript client or gdata library?
source
share