Thursday, June 30, 2016

Receiving “400 Bad Request” for /oauth/access_token

Leave a Comment

I have approved for public_content clientId. To get access token, I send a request to www.instagram.com:

GET /oauth/authorize?client_id=MyClientId&redirect_uri=MyRedirectURL&response_type=code&scope=likes+comments+public_content HTTP/1.1` 

After authentication, the browser redirects me to MyRedirectURL and I can get the code from the URL.

With this code I send a request to api.instagram.com:

/oauth/access_token HTTP/1.1 

client_id=MyClientId&client_secret=MyClientSecret&grant_type=authorization_code&redirect_uri=MyRedirectURL&code=CodeFromURL`

But sometimes I get response HTTP/1.1 400 Bad Request. This situation continues for a few hours, and sometimes for a day. It is interesting that the problem is very unstable. I may have two client apps that make identical requests, and one app will work fine, while the other will fail at the same time. Looks like it is a problem somewhere in the Instagram infrastructure.

2 Answers

Answers 1

Instagram is no longer supporting custom schemas for your callback urls. That was my problem, I changed it to https and the problem was solved.

Answers 2

This seems slightly relevant.

Also here they don't list any examples which is not http(s) :)

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment