Generating a token to be used in your application is actually fairly straightforward once you know the magical incantation. Just do the following:
- Write down the client ID, client secret, and redirect URI for the client you want to generate an access token for. You can find it on the “Manage Clients” panel in the Instagram Developer‘s site.
- Visit the following address replacing the client ID and the redirect URI:
- When prompted choose “Yes” to authorize the app
- You’ll be redirected to the redirect URI you supplied. At the end of the address you’ll see a request variable called code. Copy the value.
- Open Terminal (or favorite command line tool). Copy and paste the following. Replace the appropriate values:
- Copy the access token from the returned JSON object.
It should also be noted that the generated access token can still expire. It shouldn’t expire in the near-term but it’s not permanent.