diff --git a/clio/client.py b/clio/client.py index a9c7df0..c6579c4 100644 --- a/clio/client.py +++ b/clio/client.py @@ -166,6 +166,19 @@ def get_token(self, code, redirect_uri): }) return json.loads(urllib.urlopen(api_oauth + '/token', data = post_args).read()) + + def refresh_token(self, refresh_token): + ''' + This method retrieves a new Oauth token using the refresh token + ''' + post_args = urllib.urlencode({ + 'client_id': self.public_key, + 'client_secret': self.private_key, + 'grant_type': 'refresh_token', + 'refresh_token': refresh_token, + }) + return json.loads(urllib.urlopen(api_oauth + 'token', + data = post_args).read()) class _PropClass(object): '''