1

I want to use the Instagram API to show my own content on my own website. I can see in their documentation that content owners can display up to 20 pieces of media on their site while the app is in Sandbox mode.

I've created an app on my account and I am trying to use their Client Side Implicit Authentication to generate an access_token.

I hit this URL and login to my account:

https://www.instagram.com/oauth/authorize/?client_id=MYCLIENTID&redirect_uri=www.mysite.com&response_type=token

When I submit the login form, I am brought to an Instagram 404 page that says:

Sorry, this page isn't available. The link you followed may be broken, or the page may have been removed. Go back to Instagram.

What am I missing? Do I even need an access_token? Before they changed their API last November I was able to use just the client_id in my requests. I suppose that's not possible anymore?

Laurel
  • 5,965
  • 14
  • 31
  • 57
Michael Lynch
  • 2,682
  • 3
  • 31
  • 59

1 Answers1

6

I think you need to include http://.../ for your redirect_uri. So it would be: https://www.instagram.com/oauth/authorize/?client_id=MYCLIENTID&redirect_uri=http://www.example.com/&response_type=token

But of course that means you will also need to add http://www.example.com/ as the Valid redirect URIs in "Manage Clients" on Instagram.

HuorCulnamo
  • 336
  • 2
  • 11
  • Awesome. Thank you! That worked. However, I'm still having trouble getting the content. Now the API gives me this error: This request requires scope=public_content, but this access token is not authorized with this scope. The user must re-authorize your application with scope=public_content to be granted this permissions. If my app is going to be permanently in Sandbox mode, how do I authorize public_content? – Michael Lynch May 27 '16 at 21:02
  • I just found out you you need to include a scope parameter on the auth URL: https://www.instagram.com/oauth/authorize/?client_id=MYCLIENTID&redirect_uri=http://example.com&response_type=token&scope=public_content – Michael Lynch May 27 '16 at 21:19
  • @MichaelLynch You are very welcome! Glad to help. In order to get other scopes, like `public_content`, you must first submit your app for review. You only get the `basic` scope by default. That said, even if your app is going to be in Sandbox Mode permanently, you still have to start a submission under "Edit Client" on the Instagram side in order to receive other scopes. – HuorCulnamo May 27 '16 at 21:29