Instagram API

Number of APIs: 5

This collection will allow you to connect to Instagram's Graph API, which allows Instagram Professionals - Businesses and Creators - to manage their presence on the platform. This guide will help you to generate tokens, publish content, gather insights and manage an Instagram profile.

The API is built on top of Facebook's Graph API, we recommend giving this guide a look before getting started.

Before You Start

To interact with the API, you must first have a Facebook App. You can create one following this [guide] for the purposes of the guide, we recommend using a Business App.

After creating the app, you must generate a User Access Token with it. This token will allow you to manage permissions and objects you manage, you can generate it with this [guide] Afterwards, make sure to select the Instagram environment in Qodex and paste the resulting token under the user_access_token variable.

The permission model for the API requires a Page to be linked with a Professional Instagram Account before starting. Linking process can be found here.

Access Token Permissions needed

These are the permissions needed for the requests in this collection:

  • pages_show_list
  • instagram_basic
  • instagram_content_publish
  • pages_read_engagement
  • instagram_manage_comments
  1. Token - Get Access Tokens of Pages You Manage GET https://graph.facebook.com/{{api_version}}/me/accounts?fields=name,access_token,tasks,instagram_business_account&access_token={{user_access_token}}

  2. Reels Publishing - Upload a Reel to an IG Container POST https://graph.facebook.com/{{api_version}}/{{ig_user_id}}/media?media_type=REELS&video_url={{video_url}}&caption=Hello World!&share_to_feed=false&access_token={{page_access_token}}

  3. Token - Get Specific Page Access Token GET https://graph.facebook.com/{{api_version}}/{{page_id}}?fields=name,access_token,instagram_business_account&access_token={{user_access_token}}

  4. Reels Publishing - Get IG Container Status GET https://graph.facebook.com/{{api_version}}/{{ig_container_id}}?fields=status_code,status&access_token={{page_access_token}}

  5. Reels Publishing - Publish Reel POST https://graph.facebook.com/{{api_version}}/{{ig_user_id}}/media_publish?creation_id={{ig_container_id}}&access_token={{page_access_token}}