How to get MSN contact list using JavaScript?

36 Views Asked by At

I'm trying to get the MSN contact list using JavaScript but it is not working. Any ideas?

Here is my code:

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);
        });
} 
0

There are 0 best solutions below