Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Fix exchange_code_for_access_token by supplying Content-Type info #249

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yousong
Copy link

@yousong yousong commented Apr 6, 2017

Otherwise, it will fail with the following error

Traceback (most recent call last):
  File "get_access_token.py", line 49, in <module>
access_token = api.exchange_code_for_access_token(code)
  File "/home/yousong/git-repo/python-instagram/instagram/oauth2.py", line 48, in exchange_code_for_access_token
return req.exchange_for_access_token(code=code)
  File "/home/yousong/git-repo/python-instagram/instagram/oauth2.py", line 116, in exchange_for_access_token
raise OAuth2AuthExchangeError(parsed_content.get("error_message", ""))
instagram.oauth2.OAuth2AuthExchangeError: You must provide a client_id

Otherwise, it will fail with the following error

    Traceback (most recent call last):
      File "get_access_token.py", line 49, in <module>
	access_token = api.exchange_code_for_access_token(code)
      File "/home/yousong/git-repo/python-instagram/instagram/oauth2.py", line 48, in exchange_code_for_access_token
	return req.exchange_for_access_token(code=code)
      File "/home/yousong/git-repo/python-instagram/instagram/oauth2.py", line 116, in exchange_for_access_token
	raise OAuth2AuthExchangeError(parsed_content.get("error_message", ""))
    instagram.oauth2.OAuth2AuthExchangeError: You must provide a client_id
@facebook-github-bot
Copy link

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla - and if you have received this in error or have any questions, please drop us a line at [email protected]. Thanks!

If you are contributing on behalf of someone else (eg your employer): the individual CLA is not sufficient - use https://developers.facebook.com/opensource/cla?type=company instead. Contact [email protected] if you have any questions.

@facebook-github-bot
Copy link

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

4d11 pushed a commit to 4d11/python-instagram-ext that referenced this pull request Apr 13, 2017
Fixes "instagram.oauth2.OAuth2AuthExchangeError: You must provide a client_id" error

Reference: facebookarchive#249. All credit goes to yousong.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants