我试图使用JavaScript获取MSN联系人列表,但它无法正常工作。有任何想法吗?
这是我的代码:
WL.init({
client_id: APP_CLIENT_ID,
client_secret:CLIENT_SECRET,
redirect_uri: REDIRECT_URL,
scope: "wl.signin",
response_type: "token"
});
function get_msn_contact(){
WL.login({
scope: ["wl.basic", "wl.contacts_emails"]
}).then(function (response){
WL.api({
path: "me/contacts",
method: "GET"
}).then(
function (response) {
alert(response.toSoruce());
//your response data with contacts
console.log(response.data);
},
function (responseFailed) {
console.log(responseFailed);
}
);
},
function (responseFailed)
{
console.log("Error signing in: " + responseFailed.error_description);
});
}