Javascript 谷歌联系人API错误

Javascript 谷歌联系人API错误,javascript,google-api,google-contacts-api,Javascript,Google Api,Google Contacts Api,我正在使用以下代码获取google联系人的姓名和电话号码。授权页面本身未正确显示。它显示错误为“您请求的页面无效”。:(请帮我解决这个问题 ` google.load(“gdata”,“1.x”); 无功接触器; 函数设置ContactsService() { contactsService=新的google.gdata.contacts.contactsService('exampleCo-exampleApp-1.0'); } 函数logMeIn(){ var范围=https://www.

我正在使用以下代码获取google联系人的姓名和电话号码。授权页面本身未正确显示。它显示错误为“您请求的页面无效”。:(请帮我解决这个问题

`


google.load(“gdata”,“1.x”);
无功接触器;
函数设置ContactsService()
{
contactsService=新的google.gdata.contacts.contactsService('exampleCo-exampleApp-1.0');
}
函数logMeIn(){
var范围=https://www.google.com/m8/feeds';
var token=google.accounts.user.login(范围);
}
函数initFunc(){
setupContactsService();
logMeIn();
getMyContacts();
}
函数checkLoggedIn(){
范围=”https://www.google.com/m8/feeds";
var token=google.accounts.user.checkLogin(范围);
如果(令牌!=“”)
返回true;
其他的
返回false;
}
函数getMyContacts(){
var contactsFeedUri=https://www.google.com/m8/feeds/contacts/default/full';
var query=new google.gdata.contacts.ContactQuery(contactsFeedUri);
//我们默认加载所有结果//
query.setMaxResults(10);
getContactFeed(查询、handleContactsFeed、ContactsServiceInitError);
}
//获取作为参数传递的联系人提要//
var handleContactsFeed=函数(结果){
//所有联系人条目//
条目=result.feed.entry;
对于(变量i=0;i

感谢您,您似乎正在尝试使用Google Contacts 1.X API。该API已被弃用。请查看,看看是否有帮助。

您可以尝试此示例

var config = {
  'client_id': 'Client ID',
  'scope': 'https://www.google.com/m8/feeds'
};

inviteContacts = function() {
   gapi.auth.authorize($scope.config, function() {
       fetch(gapi.auth.getToken());
   });
}

function fetch(token) {
    $.get("https://www.google.com/m8/feeds/contacts/default/full?access_token=" + token.access_token + "&alt=json", function(response) {
         console.log(response);
         //console.log(response.data.feed.entry);
    });
}
别忘了将
添加到您的html文件中。祝您好运

var config = {
  'client_id': 'Client ID',
  'scope': 'https://www.google.com/m8/feeds'
};

inviteContacts = function() {
   gapi.auth.authorize($scope.config, function() {
       fetch(gapi.auth.getToken());
   });
}

function fetch(token) {
    $.get("https://www.google.com/m8/feeds/contacts/default/full?access_token=" + token.access_token + "&alt=json", function(response) {
         console.log(response);
         //console.log(response.data.feed.entry);
    });
}