2

I applied for Basic and Public content permission on Instagram. I submitted my request for review and my developer account shows that both permissions have been granted/Approved. But when i try to get the public feeds using that access token i get an 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.

Now i am not sure what to do further. Do i need to send this to instagram? If yes, how and where? I also tried generating the new code and then the new access token but it gave me the same access token.

Please help!!!!!!!

Aman Gupta
  • 1,764
  • 4
  • 30
  • 58

2 Answers2

2

I struggled with this for a while but I got a new token with public content scope. I've working in Python but this doesn't require any Python code so you should be fine.

I followed these steps which works for a sandbox Instagram account.

Check your redirect URL, client id and client secret at instagram.com/developer/clients/manage/

Go to this link in your browser but replace redirect_uri and client_id from above instagram.com/oauth/authorize?scope=public_content&redirect_uri=XXXXXXX&response_type=code&client_id=XXXXX

Your temporary code result will be something like myurl.com/?code=XXXXXXX Copy the code after the equals sign, for the next step.

Open your command line terminal (this part works for Mac not sure about Windows).

From the code below, replace the XXX values where necessary. Copy and paste to the terminal and press enter.

curl -F 'client_id=XXXXXXXX' \
    -F 'client_secret=XXXXXXX' \
    -F 'grant_type=authorization_code' \
    -F 'redirect_uri=XXXXXXX' \
    -F 'code=XXXXXXX' \
    https://api.instagram.com/oauth/access_token

Hope that helps.

You'll have an access token from there, so you'll be able to run queries with &access_token=XXXX in your Instagram API URL. Once you have that token with public scope, it seems to work without needing client id or client secret in the URL.

Michael Currin
  • 615
  • 5
  • 14
  • @micheal Thank you so much for the answer but i did this again and each time i get the same access token. and instagram approved my request for the public content scope but the access token gives me the error that i do not have these permissions. – Aman Gupta Jun 21 '16 at 10:40
1

Make sure you are requesting the public_content in your authorize url. I got this error message too and when adding &scope=public_content to the url, you'll get an authentication prompt to approve the public_content scope.

Mike
  • 26
  • 2
  • Thanks. I resolved this by generating new code and then using the new code the same old access token was generated which is working fine. – Aman Gupta Jul 13 '16 at 07:50