Skip to content

Direct ​

What the person sees. Direct messages: the inbox, a conversation, the recipient picker for a new message or a group, a conversation's details with its shared media, the group name editor and a participant's nickname editor.

What you do. You open the inbox (DirectInboxScreen) and a conversation (DirectThreadScreen), write and react to messages, start a one-to-one conversation or a group through the recipient picker (DirectRecipientPickerScreen), look at a conversation's details (DirectThreadDetailsScreen) and its shared media (DirectThreadSharedMediaScreen), rename a group (DirectGroupNameAndPhotoEditorScreen) and give a participant a nickname (DirectThreadNicknameChangeScreen).

The inbox is the feed's Direct tab; a conversation is also reached from a profile's "Message" button.

Every example starts from session.json, the session Your first program saved, and names the screen it expects (screen: FeedTimelineScreen). The examples show the success path: errors are answered as in Errors, and challenges by your otherwise constant (Challenges: answer them once with otherwise).

ts
import { AndroidIgpapi, FeedTimelineScreen } 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'));

The pages of this area ​

PageThe screen
The Direct inboxDirectInboxScreen, the feed's Direct tab
A conversationDirectThreadScreen, a conversation and its messages
"New message": the recipient pickerDirectRecipientPickerScreen, "New message" and the new group
A conversation's detailsDirectThreadDetailsScreen, a conversation's details hub
A conversation's shared mediaDirectThreadSharedMediaScreen, the thread's shared media
The group name and photo editorDirectGroupNameAndPhotoEditorScreen
A participant's nickname editorDirectThreadNicknameChangeScreen

The matrix ​

#The person...Starts onActionsResult
1Opens the Direct tabthe feedopenDirectTab(), threadsThe inbox with its thread previews
2Opens a conversationthe inboxthe thread item's open(), messages, participantsThe conversation and its messages
3Writes a messagea conversationsendMessage(text)The text broadcast to the conversation
4Reacts to a messagea conversationthe message's react('like')The reaction broadcast on that message
5Starts a one-to-one conversationthe inboxopenNewMessage(), search(query), the recipient's or the thread's openThread()The picker, its ranked recipients, then the conversation
6Creates a group chatthe inboxopenNewMessage(), startGroupChat(), search(query), createGroup(rows)The created group's conversation
7Writes to someone from their profilea profileopenDirectThread(), sendMessage(text)The one-to-one conversation with that user
8Looks at a conversation's details and mediaa conversationopenThreadDetails(), openSharedMedia()The details hub, then the shared media list
9Renames a groupa group conversationopenThreadDetails(), openSharedMedia(), openGroupNameEditor(), changeName(name)The group's new title
10Gives a participant a nicknamea conversationthe participant's openNicknameEditor(), changeNickname(nickname)The nickname changed

Reading new messages ​

A conversation is a snapshot of what Instagram answered when you opened it. To read messages that arrived later, open the inbox and the conversation again.

The group name ​

The group name editor is opened from the shared media list (openGroupNameEditor()), which follows the conversation's details (scenario 9).

What these screens do not offer ​

Message requests (the inbox reads the main list only), sending photos or other media from a conversation, unsending a message, muting a conversation, deleting a chat, and leaving, hiding, restricting or blocking from a group's options. The app has them; the Simulator has no action for them.

Where the examples live ​

Each directory's README carries the examples of its own screen:

  1. Open the inbox — inbox/
  2. Open a conversation, write a message, react, write from a profile — thread/
  3. Start a one-to-one conversation, create a group chat — recipient-picker/
  4. Look at the details and the shared media — details/, shared-media/
  5. Rename a group — group-editor/
  6. Give a participant a nickname — nickname/

The pages of this site are the README files of the repository. The API reference is generated from the source.