Hotmail에서 친구의 이메일 주소를 가져 오려면 범위를 "wl.contacts_emails"로 추가해야합니다.
나는 전체 코드를 게시하고하기에
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<script src="//js.live.net/v5.0/wl.js"></script>
<script type="text/javascript">
WL.init({ client_id: **WRITE YOUR CLIENTID HERE**,
redirect_uri: **place ur redirect page url** });
WL.login({ scope: "wl.contacts_emails" }).then(
function(response) {
getContacts();
},
function(response) {
log("Could not connect, status = " + response.status);
}
);
function getContacts() {
WL.api({ path: "/me/contacts", method: "GET" }).then(
onGetContacts,
function(response) {
log("Cannot get contacts: " + JSON.stringify(response.error).replace(/,/g, ",\n"));
}
);
}
function onGetContacts(response) {
var items = response.data;
for (var i = 0; i < 5; i++) {
if (i > items.length) {
break;
}
getContactProperties(items[i].id);
}
}
function getContactProperties(contactId) {
WL.api({ path: contactId, method: "GET" }).then(onGetContactProperties);
}
function onGetContactProperties(response) {
log(JSON.stringify(response).replace(/,/g, ",\n"));
}
function log(message) {
var child = document.createTextNode(message);
var parent = document.getElementById('JsOutputDiv') || document.body;
parent.appendChild(child);
parent.appendChild(document.createElement("br"));
}
</html>
답장을 보내 주셔서 감사합니다. 나는 그것을 시험하고 곧 피드백을 줄 것이다. – Parth