2017-04-06 60 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