如何管理通过JavaScript谷歌帐户的联系人? [英] How can I manage Google account's contacts through JavaScript?

查看:134
本文介绍了如何管理通过JavaScript谷歌帐户的联系人?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想设法通过JavaScript程序谷歌帐户中的联系人。当我试图通过JavaScript来删除联系人,出现此错误:网络错误:405不允许方法

I'm trying to manage Google account contacts through JavaScript programs. When I'm trying to delete contacts through JavaScript, this error occurs: "Network Error: 405 Not Allowed Method."

下面是我的code:

function deleteContacts() {
    $.ajax({
        type: 'DELETE',
        url: 'https://www.google.com/m8/feeds/contacts/default/full/{client_Id}?access_token=' + tokenId,
        headers: {
            'If-Match': '*',
            'Gdata-version': '3.0'
        },
        dataType: 'jsonp',
        data: {},
        success: function (data) {
            console.log("response: " + data)
        }
    });
}

请帮我在这,这是可以管理通过JavaScript谷歌帐户的联系人?如果这是真的有可能那么请告诉我所有的可能性管理谷歌帐户的联系人....

Please help me in this, is this possible to manage Google account's contacts through JavaScript? If it is really possible then please tell me all possibilities for managing Google account's contacts....

是否有任何其他的JavaScript API可用?

Is there any other JavaScript API available?


有没有替代的解决方案?

Is there any alternate solution?

我知道谷歌已经上市在Java,PHP解决方案,节点为好,我写在的NodeJS服务器code,但似乎谷歌客户端code为alpha版本的NodeJS,不知道有多少强它是管理联系人...


I Know Google has listed solutions in java, PHP, nodes as well, and I am writing server code in Nodejs, but seems like Google client code for NodeJs in alpha version, not sure how much strong it is to manage contacts...

推荐答案

请使用的,验证为gettoken然后使用的谷歌客户端API >请求然后执行它。通过对方法和URL根据自己的需要。对于删除的目的,通过这些都是它的输入:

Make use of the google client api for javascript, Authenticate, getToken and then use Request and then execute it. Pass on the method and url as per your need. For delete purpose, pass these are its input:

 method : 'DELETE',
 url : '/m8/feeds/contacts/default/full/<friend id to delete>'    

这篇关于如何管理通过JavaScript谷歌帐户的联系人?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆