我正在尝试从连接中获取电子邮件、姓名和图片,但是当用户进行身份验证时,我收到错误“GET https://api.linkedin.com/v1/people/~/connections:(picture-url,first -name,email-address)?count=30 403 (禁止) "
我在下面发布我的代码。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<script type="text/javascript" src="http://platform.linkedin.com/in.js">
api_key: uey3banalp6s
authentication: true
</script>
<script type="text/javascript">
function loadData() {
IN.API.Connections("me")
.fields(["pictureUrl","firstName","emailAddress"])
.params({"count":30})
.result(function(result) {
profHTML = "";
for (var index in result.values) {
profile = result.values[index]
if (profile.pictureUrl) {
profHTML += "email:" + profile.emailAddress;
profHTML += "name:" + profile.firstName;
profHTML += "<img class=img_border height=30 align=\"left\" src=\"" + profile.pictureUrl + "\">";
}
}
$("#connections").html(profHTML);
});
}
</script>
</head>
<body>
<div id="connections"></div>
<script type="IN/Login" data-onAuth="loadData">
</script>
</body>
</html>