Instagram Publishing API - Quick Start Guide

Written by Chris Bovan

Concrete Social Instagram Publishing API offers the ability to create apps that publish images and videos directly to Instagram Business profiles, using official Instagram Publishing API. In this article, we present 4 quick steps to getting up and running with it in just a few minutes.

Before we get started, we wanted to point out a few things:

  • Complete documentation can be found here
  • We have created 2 fully functional sample apps in Node.js and ASP.NET available for you to download and use to kick start your project.
  • You can also manually connect a few profiles and then test publishing using our API console

Let’s get started

Step 1: Start authorization workflow

Before you are able to actually publish, you must implement authorization workflow allowing your users to connect their Instagram Business Profiles.

Direct the user using an authorization link to the authorization flow:

https://concretesocial.io/1.0/authorize?client_id=****&redirect_url=http://yoursite.com/callback
  • You will find your client_id in the API section of your account.
  • Please replace yoursite.com with your own domain. It must be a secure site.

Once the user clicks on this link, they will be taken to a standard Facebook authorization flow:

Instagram Publishing API Authorization

The user clicks Continue and is taken to the 2nd step of the authorization Facebook

Instagram Publishing API Authorization

User clicks OK and is now sent back to the location that you have specified in redirect_url parameter earlier

http://yoursite.com/callback?code=5c6d738d95adecbbfe7a35aa

Step 2: Retrieve profiles

Note that the result of the authrization workflow was a redirect back your site with a code parameter.

You will now use this one time code to request available business profiles

https://concretesocial.io/1.0/code?client_id=***&client_secret=***&code=5c6d738d95adecbbfe7a35aa 
  • client_id and client_secret can be found in the API section of your account.

In response to this request you will receive a list of available business profiles


{
  "profiles": [
    {
      "id": "5c29196d8c93b005087765a6",
      "followers_count": 13004721,
      "follows_count": 1003,
      "media_count": 24721,
      "website": "https://on.nfl.com/upNkkS",
      "name": "nfl",
      "username": "nfl",
      "profile_picture_url": "https://scontent-lga3-1.cdninstagram.com/vp/015d5614ce3a396806104eece609f6c5/5CBEFCEA/t51.2885-19/s320x320/43654668_302504220344557_8157444699691417600_n.jpg?_nc_ht=scontent-lga3-1.cdninstagram.com"
    },
    {
      "id": "5c29196d8c93b005087765a8",
      "followers_count": 33091912,
      "follows_count": 62,
      "media_count": 292,
      "website": "https://www.nhl.com",
      "name": "nhl",
      "username": "nhl",
      "profile_picture_url": "https://scontent-lga3-1.cdninstagram.com/vp/47997c471eb72be32cc54a7df4dd377e/5CC6E065/t51.2885-19/s320x320/47105447_354774961993485_6229089930946019328_n.jpg?_nc_ht=scontent-lga3-1.cdninstagram.com"
    }
  ]
}

You will now use this information to present to your users and let them pick which profiles they intend to ask you to publish to for them.

Step 3: Activate profiles

Now that user has specified which profiles they wish to publish to, you need to activate selected profiles for publishing like so:

curl --request POST \
  --url https://concretesocial.io/1.0/profiles \
  --data '{"client_id" : "***", "client_secret" : "***", 
              "ids":"5c29196d8c93b005087765a6,5c29196d8c93b005087765a8"}'  

Step 4: Publish your first post!

Now, that profiles are activated you can use them to schedule posts:

curl --request POST \
  --url https://concretesocial.io/1.0/publish \
  --data '{ "client_id" : "***", 
            "client_secret" : "***", 
            "caption":"Wonderful",
            "media_type" : "image",
            "media_url" : "https://cdn.pixabay.com/photo/2018/10/28/16/11/landscape-3779159_1280.jpg", 
            "profiles" : ['5c29196d8c93b005087765a6']}'      

Next steps

Please visit our documentaion page for complete details and available options for each of the above steps and other features available within our API.