Let’s say you want to put a feed of Instagram posts on the site. Let’s take an example of getting an instagram access token for your application.

Step 1

Go to Facebook developers tools and create a new application

Step 2

Enter the created application and go to Settings - Basic. Scroll down and add a platform (site). Then save the settings.

Step 3

Products – Instagram Basic Display. Create a new app

Step 4

Set the redirect uri and other links

Step 5

Add a tester. This must be the Instagram account for which you receive the key.

Step 6

Go to profile settings in Instagram and accept the invitation.

Step 7

Using Instagram App Id and Redirect URI, follow the link:


and confirm the authorization

Step 8

Save the code from the address you were redirected to:


Step 9

Now you have to make a POST request to https://api.instagram.com/oauth/access_token to obtain a short-term access token. This is what it looks like when you use curl in a console:

curl -d "client_id=INSTAGRAM-APP-ID&redirect_uri=REDIRECT-URI&grant_type=authorization_code&client_secret=INSTAGRAM-APP-SECRET&code=CODE " https://api.instagram.com/oauth/access_token

In return you get json containing access_token

Step 10

Follow the link using the access_token:


In return, you get json with a long-term key for 60 days.

Step 11

To update the long-term access key, use the link:


The update should be done while the key is still active.