From 0ac86c2f897d1d4ff9b1ab743e392dd325a78934 Mon Sep 17 00:00:00 2001 From: wumf-terra Date: Wed, 26 Oct 2016 16:01:28 +0900 Subject: [PATCH] Add version to URL path for access_token --- facebook/__init__.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/facebook/__init__.py b/facebook/__init__.py index f43fec65..e322a97c 100755 --- a/facebook/__init__.py +++ b/facebook/__init__.py @@ -289,7 +289,7 @@ def get_app_access_token(self, app_id, app_secret, offline=False): 'client_id': app_id, 'client_secret': app_secret} - return self.request("oauth/access_token", + return self.request(self.version + "/" + "oauth/access_token", args=args)["access_token"] def get_access_token_from_code( @@ -306,7 +306,7 @@ def get_access_token_from_code( "client_id": app_id, "client_secret": app_secret} - return self.request("oauth/access_token", args) + return self.request(self.version + "/" + "oauth/access_token", args) def extend_access_token(self, app_id, app_secret): """ @@ -322,7 +322,8 @@ def extend_access_token(self, app_id, app_secret): "fb_exchange_token": self.access_token, } - return self.request("oauth/access_token", args=args) + return self.request(self.version + "/" + "oauth/access_token", + args=args) def debug_access_token(self, token, app_id, app_secret): """ @@ -339,7 +340,7 @@ def debug_access_token(self, token, app_id, app_secret): "input_token": token, "access_token": "{0}|{1}".format(app_id, app_secret) } - return self.request("/debug_token", args=args) + return self.request(self.version + "/" + "debug_token", args=args) class GraphAPIError(Exception):