2011-11-23 62 views
1

我用this library來製作API請求併成功獲取了令牌。Linkedin的Python API

但是文檔沒有說明如何在將來使用_access_token_access_token_secret。我想應該有一種方法,如:

set_access_token(_access_token, _access_token_secret) 

但我找不到在此代碼或文檔中的方法。

請幫我解決這個問題。

回答

1

我還沒有使用這個特定的庫或API,但在這些情況下的一種常見模式是,您將令牌作爲參數傳遞給後續調用。望着源,我可以看到一個名爲get_user_profile功能__init__.py

def get_user_profile(self, access_token, selectors=None, headers=None, **kwargs): 
    """ 
    Get a user profile. If keyword argument "id" is not supplied, this 
    returns the current user's profile, else it will return the profile of 
    the user whose id is specificed. The "selectors" keyword argument takes 
    a list of LinkedIn compatible field selectors. 
    """ 

所以我猜你只是想通過令牌作爲第一個參數(在這種情況下)。

+0

感謝您的回覆。最後我用http://code.google.com/p/python-linkedin/ api完成了我的工作。感謝您的回覆。 –