3
votes

I've referred to this question Instagram API: The access_token provided is invalid, before posting this question myself.

My situation is quite similar, where I've just registered a new app yesterday, and it is now in Sandbox mode. I do understand that my access to instagram data is quite limited. However I've got no idea why even the simplest of request as below, I received error The access_token provided is invalid.

https://api.instagram.com/v1/users/self/?access_token=ACCESS-TOKEN

I'm quite certain that I'm doing this right, however just in case I'm doing it wrong. First I will need to login to my app with the below URL, where I would need to change to my own CLIENT-ID and REDIRECT-URI.

https://api.instagram.com/oauth/authorize/?client_id=CLIENT-ID&redirect_uri=REDIRECT-URI&response_type=code

Upon successful login, it will redirect to my REDIRECT-URI example: http://your-redirect-uri?code=CODE

I copy the generated CODE and append with https://api.instagram.com/v1/users/self/?access_token=CODE, which it is returning me with The access_token provided is invalid.

Please correct me if I'm doing it wrong.

1

1 Answers

5
votes

For those who faced the same issue as me, I realised that I needed to change code to access-token. Because I'm using Implicit flow, I needed to change that parameter to return me a token.

From: https://api.instagram.com/oauth/authorize/?client_id=CLIENT-ID&redirect_uri=REDIRECT-URI&response_type=code

To: https://api.instagram.com/oauth/authorize/?client_id=CLIENT-ID&redirect_uri=REDIRECT-URI&response_type=token