0

我正在尝试使用 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);
        });
} 
4

0 回答 0