2011-11-23 64 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完成了我的工作。感谢您的回复。 –