From d14816de6b7a22ddd6d5a558028cbd164719bd16 Mon Sep 17 00:00:00 2001 From: zazatech Date: Sat, 14 Apr 2018 14:26:55 -0400 Subject: [PATCH] Fixed: issue with Requesting the access_token: You must provide a client_id --- instagram/oauth2.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/instagram/oauth2.py b/instagram/oauth2.py index 053b1be8..fcbccfd6 100644 --- a/instagram/oauth2.py +++ b/instagram/oauth2.py @@ -109,7 +109,8 @@ def exchange_for_access_token(self, code=None, username=None, password=None, sco data = self._data_for_exchange(code, username, password, scope=scope, user_id=user_id) http_object = Http(disable_ssl_certificate_validation=True) url = self.api.access_token_url - response, content = http_object.request(url, method="POST", body=data) + headers = {'Content-type': 'application/x-www-form-urlencoded'} + response, content = http_object.request(url,headers=headers,method="POST", body=data) parsed_content = simplejson.loads(content.decode()) if int(response['status']) != 200: raise OAuth2AuthExchangeError(parsed_content.get("error_message", ""))