Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Instagram API OauthException: "You must provide a client_id"

When I'm trying to receive an access_token from Instagram. I do the following request

params = {
    'client_id' : config.INSTAGRAM_APP_ID,
    'client_secret' : config.INSTAGRAM_APP_SECRET_KEY,
    'grant_type' : 'authorization_code',
    'redirect_uri' : '`my localhost`',
    'code' : code
    }
r = requests.post('https://api.instagram.com/oauth/access_token', params = params)

And receive error:

{"code": 400, "error_type": "OAuthException", "error_message": "You must provide a client_id"}

What can I do with these?

like image 624
Sandu Kiritsa Avatar asked Jul 10 '14 11:07

Sandu Kiritsa


1 Answers

I fixed this by putting these params in the (x-www-form-encoded) body instead of in the header (credit to https://github.com/request/request/issues/983#issuecomment-57005849 for the idea).

NB: I am not using the python wrapper.

like image 67
giraffe.guru Avatar answered Sep 20 '22 07:09

giraffe.guru