HowTo: Generate Instagram access_token for API use
- Create an client via http://instagram.com/developer/clients/register/
- Capture the clientid, clientsecret and redirect_uri.
-
Hit the following url with the appropriate client_id and redirect URL
A url redirect will take place that will look like #{redirecturi}?code=yourcode
Copy that code
-
Run the following curl:
curl -F 'client_id=your_client_id' \
-F 'client_secret=your_client_secret' \
-F 'grant_type=authorization_code' \
-F 'redirect_uri=your_redirect_uri' \
-F 'code=your_code' \https://api.instagram.com/oauth/access\_token
The response will contain your access_token
Written by Craig Heneveld
Related protips
3 Responses
How to run this Curl command
Curl -F 'clientid=dce19c3dfb624242949105c60a9215bd' -F 'clientsecret=ddaaf9674aad484899c829947746c4ee' -F 'granttype=authorizationcode' -F 'redirecturi=http://localhost:2163/Main.aspx' -F 'code=6b86710236a140c7875eef65bd9214b8' https://api.instagram.com/oauth/accesstoken
I framed liken above but it throws error code 400 , You mush provide Client Id
You misspelled client_id as clientid (without a underscore), the same goes for the other attributes as well.