如何从linkedin导入联系人并使用我使用过的php发送消息
api_key: 'APIKEY'
authorize: true
credentials_cookie: true
window.onload = function onLinkedInAuth() {
// After they've signed-in, print a form to enable keyword searching
var div = document.getElementById("sendMessageForm");
div.innerHTML = '<h2>Send a Message To Yourself</h2>';
div.innerHTML += '<form action="javascript:SendMessage();">' +
'<input id="message" size="30" value="You are awesome!" type="text">' +
'<input type="submit" value="Send Message!" /></form>';
};
function SendMessage(keywords) {
// Call the Message sending API with the viewer's message
// On success, call displayMessageSent(); On failure, do nothing.
var message = document.getElementById('message').value;
var BODY = {
"recipients": {
"values": [{
"person": {
"_path": "/people/~",
}
}]
},
"subject": "JSON POST from JSAPI",
"body": message
}
IN.API.Raw("/people/~/connections")
.method("POST")
/*.body(JSON.stringify(BODY)) */
.result(displayMessageSent)
.error(function error(e) { console.log(e);alert ("No dice"); });
}
function displayMessageSent() {
var div = document.getElementById("sendMessageResult");
div.innerHTML += "Yay!";
}
从网址http://developer.linkedin.com/documents/sample-code-sending-message引用
但没有成功..任何帮助都非常感谢!