我尝试在这里使用 python-linkedin 库 https://github.com/ozgur/python-linkedin通过脚本向 LinkedIn 联系人发送邀请
但是对于以下代码:
from linkedin import linkedin
API_KEY = 'wFNJekVpDCJtRPFX812pQsJee-gt0zO4X5XmG6wcfSOSlLocxodAXNMbl0_hw3Vl'
API_SECRET = 'daJDa6_8UcnGMw1yuq9TsjoO_PMKukXMo8vEMo7Qv5J-G3SPgrAV0FqFCd0TNjQyG'
RETURN_URL = 'https://localhost:8000'
authentication = linkedin.LinkedInAuthentication(API_KEY, API_SECRET, RETURN_URL) #, linkedin.PERMISSIONS.enums.values())
print authentication.authorization_url # open this url on your browser
application = linkedin.LinkedInApplication(authentication)
我明白了
redirect_uri 与注册值不匹配
将authentication.authorization_url粘贴到浏览器中时。
http://localhost:8000/?code=
authentication.authorization_code = "the code provided"
authentication.get_access_token()
application = linkedin.LinkedInApplication(token='the token provided')
快速使用示例:
from linkedin import server
application = server.quick_api(KEY, SECRET)
application.get_profile()