gpt4 book ai didi

javascript - Linkedin 在 java 脚本 api 中显示 403 禁止错误

转载 作者:行者123 更新时间:2023-12-03 12:28:53 24 4
gpt4 key购买 nike

我正在尝试搜索具有公司名称的人员,但它在控制台中显示为

获取https://api.linkedin.com/v1/people-search:(num-results,people:(first-name,last-name,distance))?company-name=infosys 403(禁止)xdrpc.html?v=0.0.2000-RC8.35784-1413:1651

我的代码:

 <html>
<head>
<script type="text/javascript" src="http://platform.linkedin.com/in.js">
api_key: --api-key-here--
onLoad: onLinkedInLoad
authorize: true
</script>

<script type="text/javascript">

function onLinkedInLoad() {
alert("authenticating..");
// Listen for an auth event to occur
IN.Event.on(IN, "auth", onLinkedInAuth);
}

function onLinkedInAuth() {

IN.API.PeopleSearch()
.fields("firstName", "lastName", "distance")
.params({"company-name":"infosys"})
.result(displayPeopleSearch)
.error();

}

function displayPeopleSearch(peopleSearch){

var peopleSearchDiv = document.getElementById("peoplesearch");

var members = peopleSearch.people.values;


for (var member in members) {
// but inside the loop, everything is the same
// extract the title from the members first position
peopleSearchDiv.innerHTML += "<p>" + members[member].firstName + " " + members[member].lastName + " is a " + members[member].positions.values[0].title + ".</p>";

}
}
</script>
</head>
<!-- need to be logged in to use Search; if not, offer a login button -->
<script type="IN/Login"></script>
<body>
</body>
</html>

最佳答案

经过一场大战后发现,Linked IN 已经创建了经过审查的 API 来访问人物搜索,只有注册到该流程的开发者才能访问人物搜索功能

关于javascript - Linkedin 在 java 脚本 api 中显示 403 禁止错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24039388/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com