Appearance
Publishing
What the person sees. What follows the feed's create button: pick photos in the gallery, edit them, write a caption on "New post" and share; pick or record a video for a reel, edit it, add a song and share; pick a photo or a video for a story, add music and share it, either straight to "Your story" or through the share sheet. The screens mirror the app's creation mode selector (POST, STORY, REEL); Live is not available.
What you do. You walk those screens from the feed to the share screen, and the share answers what was published.
The scenarios are on the mode pages: a post publishes a photo, a carousel, a carousel with a video and a video picked in the post mode; a Reel the Reel, with and without a song; a story the story photo and video, the share sheet and the song. Every example starts from session.json, the session Your first program saved, and shows the success path: errors are answered as in Errors, and challenges by your otherwise constant (Challenges). Each assumes this setup:
ts
import {
AndroidIgpapi,
FeedTimelineScreen,
PostingReelEditorScreen,
PostingStoryVideoEditorScreen,
} from '@igpapi/android';
import { Effect } from 'effect';
import { readFile } from 'node:fs/promises';
// A checkpoint read back from your storage (see "Keep a session").
const saved = JSON.parse(await readFile('session.json', 'utf8'));Which page for which result
- A post: a photo, a carousel, a carousel with a video, a video picked in the post mode.
- A Reel: the Reel, in the reel mode and with a song mixed in.
- A story: a photo or a video with "Your story", the share sheet, a song.
- Music for Reels and stories: how a song is searched, listened to and picked, and how its volume is set.
- The creation camera and gallery: how the story and Reel modes open and how the mode is switched.
- The gallery picker: the post mode's gallery picker the feed's create button opens.
Media requirements
- Photos and videos. A photo is a JPEG or a PNG; a video is an MP4. The format is read from the file's bytes, not from its name.
- No crop. A post's or a Reel's photo is uploaded in its own shape: crop it to the frame you want before
pickPhoto. A story photo is cut to the story's 9:16 frame, centred. - Rejected files. A file the app's picker does not offer, or one that carries a content-credentials manifest, an IPTC record or a generated-media source type, is refused with
PostingMediaFormatError(Errors). Offer another file. - A file lives as long as its creation flow. A checkpoint carries no files, so a flow continued from one is answered with
PostingMediaNotInProcessError(a song:PostingSongNotInProcessError): pick the file again.
What share() returns
- A post and a Reel:
{ id, status, mediaIds, code? }.idis the post's or Reel's id,statusisCOMPLETEDorPENDINGwhile Instagram still processes it, andcodeis the short code inhttps://www.instagram.com/p/<code>/when Instagram's answer carries it. - A story:
{ mediaId, code? }: the story's media id and its short code when the answer carries it.
The shapes differ because the story is a single item and the post and the Reel can hold several.