Note that there are some explanatory texts on larger screens.

plurals
  1. POWindows Live Contacts API Error on Getting E-Mail hashes - JavaScript
    text
    copied!<p>The following codes for the Window Live Contacts API to Get all email address from. Its works fine in login, log-out, and other authentications. I can collect all user information of logged in user with <code>Get Data</code> function call, but am getting email hashes of users, rest of the email hashes are blank. I have 10 email address in my contact book.</p> <p>How do i get the email addresses of my contacts using this api?</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;script src="https://js.live.net/v5.0/wl.js" type="text/javascript"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;a href='javascript:void(0);' onclick='signUserIn();'&gt;signUserIn&lt;/a&gt; &lt;br&gt; &lt;a href='javascript:void(0);' onclick='signUserOut()'&gt;signUserOut&lt;/a&gt;&lt;br&gt; &lt;a href='javascript:void(0);' onclick='loginStatus()'&gt;Check User Status&lt;/a&gt; &lt;a href='javascript:void(0);' onclick='getData()'&gt;Get Data&lt;/a&gt; &lt;script type="text/javascript" &gt; WL.init({ client_id: '0000000044444444', redirect_uri: 'http://domain.com/contact.php', response_type: "token", logging: true }); var scopesArr = ['wl.signin', 'wl.basic', 'wl.emails']; function signUserIn() { WL.login({ scope: scopesArr }); } function loginStatus() { WL.getLoginStatus(function(response) { alert("response " + response ); }); } function getData() { alert( "getData"); WL.api( { path: "me/contacts", method: "GET", scope: scopesArr }, function (result) { if (!result.error) { var resultData = result.data; var emailHashes = new Array; for (i = 0; i &lt; resultData.length; i++) { for (j = 0; j &lt; resultData[i].email_hashes.length; j++) { alert( "resultData " + resultData[i].email_hashes[j]); emailHashes[emailHashes.length] = resultData[i].email_hashes[j]; } } var resultText = ""; for (k = 0; k &lt; emailHashes.length; k++) { resultText += emailHashes[k] + "\r\n"; } // document.getElementById("emailHashes").setAttribute("rows", emailHashes.length); document.getElementById("lists").value = resultText; } else { alert("Error getting contacts: " + result.error.message); } }); } function signUserOut() { WL.logout(); } &lt;/script&gt; &lt;textarea rows="10" cols="100" id="lists"&gt;&lt;/textarea&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload