Instagram Content Publishing API

Written by Melissa Evans

Concrete Social Instagram Content Publishing API uses Facebook Instagram Content Publishing API which is a subset of Instagram Graph API endpoints that allow you to publish media objects. Publishing media objects with this API is a two step process — you first create a media object container, then publish the container on your Business Account.


In order to begin using this API would you need to create an account, generate API key and implement authentication flow for your users. Please note that this API does not offer you access to access keys of Facebook users or Business Profiles. This is purely a content publishing solution.

Instagram Content Publishing API

Common Uses

Publishing Photos

Publishing photos is a one-step process. Simply call /publish endpoint and pass image url.

For example, let’s say you have a photo at…

https://www.example.com/images/bronz-fonz.jpg

… that you want to publish with the hashtag “#BronzFonz” as its caption. You could use the /user/media edge to create the container like this:

POST https://concretesocial.io/1.0/publish
  ?media_url=https//www.example.com/images/bronz-fonz.jpg
  &media_type=image
  &profiles=["5c21013a8c93b0050877659d"]
  &caption=#BronzFonz

Publishing Videos

For example, let’s say you have a video at…

https://www.example.com/videos/hungry-fonzes.mov

… that you want to publish with the hashtag “#Heyyyyyyyy!” as its caption. You could use the /user/media edge to create the container like this:

POST https://concretesocial.io/1.0/publish
  ?media_type=VIDEO
  &mediaurl=https//www.example.com/videos/hungry-fonzes.mov
  &profiles=["5c21013a8c93b0050877659d"]    
  &caption=#Heyyyyyyyy!

Publishing Photos w/ Tagged Users

You can tag public Instagram Users in a photo and they will receive a notification when you publish the media container.

To do this, follow the Publishing Photos steps above, but when creating the media container, include the user_tags parameter and an array of objects indicating the Users in the photo as well as their x/y coordinates within the photo itself.

For example, let’s say you want to publish a photo that depicts two of your Instagram friends who you want to tag. You could use the /user/media edge to create the container like this:

POST https://concretesocial.io/1.0/publish
  ?media_url=https://www.example.com/images/bronzed-fonzes.jpg
  &media_type=image  
  &profiles=["5c21013a8c93b0050877659d"]
  &caption=#BronzedFonzes!
  &user_tags=
   [
     {
       username:'kevinhart4real',
       x: 0.5,
       y: 0.8
     },
     {
       username:'therock',
       x: 0.3,
       y: 0.2
     }
   ]

Notes

  • The user_tags value must be an array of objects formatted with JSON.
  • You can only tag Users with public Instagram accounts.
  • The object must contain all three properties (username, x, and y) for each user.
  • x and y values must be float numbers that originate from the top-left of the image, with a range of 0.0–1.0.

Publishing Photos w/ Locations

You can use our Places Search API to get the ID of the Page associated with any Place that has been entered into our Places Graph. If you include the Page’s ID when publishing a photo, the photo will be tagged with the Place’s location.

To do this, first query the Places Graph API and include the page field to get the ID of the Page associated with the Place. For example, let’s say you took a photo just outside New York City’s Guggenheim Museum. You could get the Guggenheim’s Page ID like this:

GET https://concretesocial.io/1.0/search/place?
  type=place
  &fields=page
  &q=guggenheim

This would return an array of objects with “guggenheim” in their name, one of which is for the Guggenheim in New Your City:

... 
{
 "page": {
  "name": "Solomon R. Guggenheim Museum",
  "id": "7640348500"  // This is the page ID, which you can use for location tagging
 },
 "id": "10150113890778501"
},
...

Once you have the ID of the Page associated with the Place, follow the Publishing Photos steps above and use the location_id parameter to pass us the page ID when creating your media object container.

POST https://concretesocial.io/1.0/publish
    ?media_url=https://www.example.com/images/bronzed-fonzes.jpg
    &media_type=image  
    &caption=Exhibiting!
    &profiles=["5c21013a8c93b0050877659d"]  
    &location_id=7640348500

Publishing Follow Up Comment

Sometimes you would prefer not to clutter your media (image or video) and instead prefer to publish that extra content as a follow comment

Just add ‘comment’ parameter to your request.

POST https://concretesocial.io/1.0/publish
  ?media_type=VIDEO
  &mediaurl=https//www.example.com/videos/hungry-fonzes.mov
  &profiles=["5c21013a8c93b0050877659d"]    
  &caption=#Heyyyyyyyy!
  &comment=This is my additional comment

Limitations

Facebook will cURL your media object using the passed in URL, so the object must be on a public server.

We do not support:

  • Extended JPEG formats such as MPO and JPS
  • Stories
  • Shopping tags
  • Branded content tags
  • Filters
  • Multi-image posts