无法从 LinkedIn python API 获取连接

问题描述 投票:0回答:2

我正在尝试通过其 python API 获取 LinkedIn 连接。

现在代码可以调用 get_profile() 函数,但是当我尝试

application.get_connections()
时,它给了我错误显示:

linkedin.exceptions.LinkedInError:403客户端错误:禁止网址:https://api.linkedin.com/v1/people/~/connections?oauth2_access_token=...

我的linkedin应用权限只有4个选择: r_basicprofile、r_emailaddress、rw_company_admin、w_share

我使用的重定向网址是 http://localhost/

那么,你知道如何通过 python API 获取 LinkedIn 连接吗?

我的代码:

from linkedin import linkedin as lk

new_token = [my token]

application = lk.LinkedInApplication(token=new_token)

p = application.get_profile()     # this one works
c = application.get_connections()
print p
print c
python linkedin-api
2个回答
1
投票

connections API 需要用户授予

r_network
范围。根据此 LinkedIn doc,某些范围已受到限制,需要开发人员向 LinkedIn 的合作伙伴计划申请才能访问它们。

注意:似乎 this 是您正在使用的库。


0
投票

对于访问 Connections API 有什么建议吗?我已经两次申请合规合作伙伴计划(Connections API 位于该计划内),但尚未收到回复。很好奇是否有人有建议 - 我的应用程序实际上会通过 api 向 LinkedIn 发送更多流量,这样我们就可以访问 Connections API!

© www.soinside.com 2019 - 2024. All rights reserved.