Social Media Marketing

How to Publish a Story

[ad_1]

We are excited to announce Ayrshare as the first API platform to post directly to Instagram stories via API.

Instagram Stories provide a flexible and powerful way to connect with your audience and strengthen your brand. A story allows you to share photos and videos that only last for 24 hours. This could include photos of your latest product, a photo of an upcoming event, or short video clips that answer common questions. Stories are a great way to try out different types of content and engage with your followers.

Ayrshare streamlines this process by allowing you to schedule your stories in advance using our Instagram Stories API – see the end of this blog post for details.

Publish Directly to the Instagram Stories API

You can directly publish video or photo stories by making a few calls to the Instagram Stories API.

Before You Begin, Get Permissions

Assuming you have permission for the Facebook app, you will need both Facebook to allow permissions for your app and your users to authorize access to their account – how to get an access token.

The permissions required for publishing Instagram stories are:

  • instagram_basic
  • instagram_manage_insights
  • pages_read_engagement
  • pages_show_list

If the token comes from whose User The page role was assigned via Business Manageri.e. your user is using Meta Business Suite, one of the following permissions is also required:

  • ads_management
  • pages_read_engagement
  • business_management

You will add this to your list of requested user permissions when you make an OAuth call. See the links for details about the process.

Video publishing

Let’s start by publishing the video. Assuming you have access to the Facebook app, the required permissions, and have generated an authorization token for your user, you can make a single POST call with your video URL to publish the story:

POST 
  ?video_url={video-url}
  &media_type=STORIES
  &access_token={access-token}

Be sure to enter the Instagram User ID you received when authorizing the user, access token, and video URL.

The main difference between publishing a standard video* or a Reel is this media_type parameter value. To use Reels REELS and media consumption STORIES.

*From November 9, 2023, i VIDEO media_type parameter is no longer supported by the Facebook Graph API. Use instead of REELS amount of both Reels and regular videos.

Photo Publishing

Publishing a photo story is as easy as videos:

POST 
  ?image_url={image-url}
  &media_type=STORIES
  &access_token={access-token}

You will need to enter the Instagram user ID you received when you authenticated the user, the access token, the image URL, and STORIES media_type.

JSON response

After successfully posting the media, you will receive the following JSON response containing the reference ID of the published media:

{
  "id": "17889455560051444"
}

If an error occurred, you will receive a JSON object containing the error.

Posting Instagram Stories via Airshare API

If you don’t want to go through the hassle of getting approved, integrating, and supporting Facebook or Instagram APIs, you can use Ayrshare’s Social Media APIs. First by signing up for Ayrshare, getting your API key, and linking your Instagram account, you can easily post your first photo or Video Story on Instagram.

POST 
{   
    "post": "The description of the video",
    "mediaUrls": ["    
    "instagramOptions": {
        "stories": true,
    }
}

Just insert one of your photos or video, send some post text – note that Instagram does not currently accept News text – and set the parameter. stories: true. POST this JSON to and your Story will be published.

Remember that Stories only last for 24 hours and then they disappear.

If you want to learn more about publishing on Instagram check out our other article on publishing Instagram Reels with API.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button