Last Updated: November 12, 2017
·
16.49K
· cheneveld

HowTo: Generate Instagram access_token for API use

  1. Create an client via http://instagram.com/developer/clients/register/
  2. Capture the clientid, clientsecret and redirect_uri.
  3. Hit the following url with the appropriate client_id and redirect URL

    https://instagram.com/oauth/authorize/?client_id=your_client_id&redirect_uri=your_redirect_uri&response_type=code

  4. A url redirect will take place that will look like #{redirecturi}?code=yourcode

  5. Copy that code

  6. 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

  7. The response will contain your access_token

3 Responses
Add your response

How to run this Curl command

over 1 year ago ·

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

over 1 year ago ·

You misspelled client_id as clientid (without a underscore), the same goes for the other attributes as well.

over 1 year ago ·