Sandu Kiritsa
Sandu Kiritsa

Reputation: 91

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?

Upvotes: 9

Views: 4210

Answers (2)

Shiyu
Shiyu

Reputation: 601

Use app_id, and app_secret.

For postman, put the body params in x-www-form-urlencoded.

Upvotes: 0

giraffe.guru
giraffe.guru

Reputation: 520

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.

Upvotes: 9

Related Questions