From b3f22d59c1ac4bee9a1892dcb0bfe09e857d77c2 Mon Sep 17 00:00:00 2001 From: Kerin Cosford Date: Thu, 14 Nov 2013 11:05:01 +0000 Subject: [PATCH] Added access_type param to get_authentication_tokens method. --- twython/api.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/twython/api.py b/twython/api.py index 39b8f28..a067f70 100644 --- a/twython/api.py +++ b/twython/api.py @@ -251,12 +251,13 @@ class Twython(EndpointsMixin, object): return self._last_call['headers'].get(header, default_return_value) - def get_authentication_tokens(self, callback_url=None, force_login=False, screen_name=''): + def get_authentication_tokens(self, callback_url=None, force_login=False, screen_name='', access_type=None): """Returns a dict including an authorization URL, ``auth_url``, to direct a user to :param callback_url: (optional) Url the user is returned to after they authorize your app (web clients only) :param force_login: (optional) Forces the user to enter their credentials to ensure the correct users account is authorized. :param screen_name: (optional) If forced_login is set OR user is not currently logged in, Prefills the username input box of the OAuth login screen with the given value + :param access_type: (optional) Overrides the access level an application requests to a users account. Supported values are read or write. :rtype: dict """ @@ -266,6 +267,8 @@ class Twython(EndpointsMixin, object): request_args = {} if callback_url: request_args['oauth_callback'] = callback_url + if access_type: + request_args['x_auth_access_type'] = access_type response = self.client.get(self.request_token_url, params=request_args) if response.status_code == 401: