2017-04-06 62 views
0

这是一个内部项目。我的最终目标是获取我的联系的详细信息。和我在同一个城市。Python - LinkedIn API获取配置文件错误

我是使用LinkedIn API的新手。我使用回答here中提到的代码来生成访问令牌。现在我正在使用下面的行来获取我的LinkedIn个人资料。

application.get_profile(access_token['oauth_token']) 

但是我得到错误以下。

Traceback (most recent call last): 
    File "<pyshell#4>", line 1, in <module> 
    application.get_profile(access_token['oauth_token']) 
    File "C:\Python34\lib\site-packages\python_linkedin-2.0-py3.4.egg\linkedin\linkedin.py", line 189, in get_profile 
    response = self.make_request('GET', url, params=params, headers=headers) 
    File "C:\Python34\lib\site-packages\python_linkedin-2.0-py3.4.egg\linkedin\linkedin.py", line 169, in make_request 
    params.update({'oauth2_access_token': self.authentication.token.access_token}) 
AttributeError: 'str' object has no attribute 'token' 

有人能帮我吗?

回答

0

我不认为你需要再次通过身份验证令牌来获取您的个人资料。我也在使用python库。

application.get_profile() 

应该返回您的配置文件的基本信息。然后查看使用选择器来指定您想要的端点。

+0

它不工作 – pratibha