11

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.

Kazelin
  • 83
  • 8

3 Answers3

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.

Will Jayne
  • 19
  • 2
0

I think you should prefer this document of Instagram.

You may also receive responses with an HTTP response code of 400 (Bad Request) if we detect spammy behavior by a person using your app. These errors are unrelated to rate limiting.

Quang Dam
  • 305
  • 3
  • 15
0

It seems like , we can not use http://localhost/... in call back url. Instagram may have restricted it.

It worked for me, when I have added live Ip of my aws server. for example http://xx.xx.xx.xx/.. instead of localhost.

Hiren patel
  • 971
  • 8
  • 25