Configuring an Instagram Feed


*** Sorry Not working for the moment ***

Until Migrate Instagram Feed to Latest API #16 has been played


NGX-Ramblers has built-in support for rendering social media feeds for your group automatically, one of which is instagram. When configured correctly, it can be rendered alongside a corresponding facebook feed as shown in the example below and shows the 14 most recent media posts:

Introduction

This article shows you how to:

Before You Start

You will need:

Step 1: Create a Facebook App

Step 2: Configure Instagram Basic Display

Display Name

Enter the name of the Facebook app you just created.

Valid OAuth Redirect URIs

Deauthorize Callback URL

Data Deletion Request Callback URL

App Review

Step 3: Add an Instagram Test User

Step 4: Authenticate the Test User

https://api.instagram.com/oauth/authorize
  ?client_id={app-id}
  &redirect_uri=https://www.ngx-ramblers.org.uk/handle_auth
  &scope=user_profile,user_media
  &response_type=code
https://api.instagram.com/oauth/authorize
  ?client_id=684477648739411
  &redirect_uri=https://www.ngx-ramblers.org.uk/handle_auth
  &scope=user_profile,user_media
  &response_type=code

Step 5: Exchange the Code for a Token

curl -X POST \
  https://api.instagram.com/oauth/access_token \
  -F client_id={app-id} \
  -F client_secret={app-secret} \
  -F grant_type=authorization_code \
  -F redirect_uri=https://www.ngx-ramblers.org.uk/handle_auth \
  -F code={code}
curl -X POST \
  https://api.instagram.com/oauth/access_token \
  -F client_id=684477648739411 \
  -F client_secret=eb8c7... \
  -F grant_type=authorization_code \
  -F redirect_uri=https://www.ngx-ramblers.org.uk/handle_auth \
  -F code=AQCPojlEZVyWVZ8aCpSkbcaCqOyuusWBFC3umVO47KkpKNwTUSni1_jaX_S_BniA9DDH95_MsmF4bygDrO1vjKr6eVwCZ2DLrX2lcBG0mRvL5oGwZs9tmLO-fqaHEi-CLAtJme5APcIyOyuBZk6hLdnyS8hBBWcy1RaV7zudwpj-FUsofvAOkJ7vDozABSPIAFMpGtXtHb3E51i_w-HiM8mYrVaTGAh0M51ESZ8DLYnGJQ
{
  "access_token": "IGQVJ...",
  "user_id": 17841405793187218
}

Step 6: Get a Long-Lived Token

curl -i -X GET https://graph.instagram.com/access_token
  ?grant_type=ig_exchange_token
  &client_secret={app-secret}
  &access_token={short-lived-access-token}
{
  "access_token":"IGQWRNNF9IWEVDNkFWaF9JSTRRcEFGYTcxZAGdiMjhRSlNkZAGt5LXBoVmYtOWhSbzM4Y",
  "token_type": "bearer",
  "expires_in": 5183944  
}

Step 7: Save your Instagram configuration details in your Website Config

Now enter / check the following details:

Refreshing The Access Token

According to the Instagram API documentation, the long-lived access_token is only valid for 60 days. However your NGX-Ramblers website will automatically refresh the token when the site is used so there is never any need to do this manually — if you've managed to get the feed working in the prior step, that's all you'll ever need to do.

Troubleshooting

If you've followed the above process and you are still not seeing the instagram feed above, drop us an email and we'll take a look at your site logs to see what's wrong!