With many websites you might want to integrate your Instagram account with your website so that you can show your most recent posts. Most platforms that dish out API Keys to their users usually make this a pretty easy and painless process, but not Instagram. If you need an access token or API key for your Instagram account read on!
- Log into the Instagram account you want to integrate with your site
- Visit https://www.instagram.com/developer/
- From here you will need to 'Register' your application.
- Follow the steps shown, then click 'Manage Clients' and 'Register a New Client'
- Complete all the fields.
- Once created, untick the 'Disable implicit...' checkbox on the Security tab.
- Once you have done this you will then need to generate an 'access token'. This is the not so obvious part of the process. Visit this url https://www.instagram.com/oauth/authorize/?client_id=CLIENT-ID&redirect_uri=REDIRECT_URI&response_type=token replacing the CLIENT_ID with the client id you have just created in Instagram and REDIRECT_URI with the website url you have just entered in whilst creating this client.
- You will then be asked to authorize the application, click 'authorize'
- You will now be redirected to your website and the access token will be present in the URL. This is a very long string of numbers and letters and will look similar to http://yourwebsite.com/#access_token=123456789.76543a1.e11abc123a1234567ab12345a12b1234
- Copy and save the access code into your website's CMS in the appropriate section.
After doing this, you may receive an error like:
"Sorry, an error occurs from Instagram API: This request requires scope=public_content, but this access token is not authorized with this scope. The user must re-authorize your application with scope=public_content to be granted this permissions."
To rectify this (whilst logged into the Instagram account) go to:
Replacing the CLIENT_ID and REDIRECT_URI with the appropriate values.
Easy! (when you know how...)