Requesting an Access Token from Instagram
Instagram changed their API, introducing new restrictions and a permissions process. I had to re-register my Instagram client and get a new Access Token to use the API.
Registering the Client
- Log in to the Intragram Developer portal
- Select Register a new Client
- Fill out the form (see the sample below)
- Application Name: I used my top level domain name, but this can be anything you choose as long as it does not contain ‘insta’, ‘gram’, ‘IG’ or ‘Instagram’
- Description: Again, anything is ok, but it is best to outline what your application will do
- Company Name: I don’t have a company, so I registered myself
- Website URL: The URL of my website
- Valid Redirect URIs: This is the place where users will be redirected after logging in to your application. Note, nobody will be loggin into the application so I have just used my TLD so this app will work on all levels below that
- Contact Email: Make sure you add a valid URL
All of the fields are mandatory, so make sure you fill them all in.
Finally, switch to the Security tab and deselect the ‘Disable implicit OAuth’ checkbox, then hit Register.
Once that is done, you should see the client registered.
It is important to note that your client is operating in Sandbox mode at the moment - that means that ‘data is restricted to sandbox users and the 20 most recent media from each sandbox user’
To switch the status of the client to Live, you need to submit the client for approval from the Permissions tab by editing the client.
Here you will need to provide supporting information to Instagram about how the API will be used.
Client-Side Authentication (Authorizing and Getting the Token)
To retrieve data via the API you will need to use an Access Token, this is a unique token speific to a user.
- Paste the above URL into your browser
- Replace CLIENT-ID with your client’s generated ID
- Replace REDIRECT-URI with the redirect URI you added to your client
- Load the URL
- The URL will load and you will see the Access Token included in the page URL