Migrating conversations API actions
Bird’s Conversations API simplifies managing conversations across channels by unifying communication workflows into a centralized framework. Whether you’re transitioning from legacy systems or optimizing your customer engagement strategy, this guide provides a seamless path to migration.
This guide covers:
Understanding participants in conversations
In Bird CRM, a participant is an entity that is part of a conversation. Each participant is associated with a specific participant type, which determines the role and identity of the participant within the conversation. Participants can represent various entities, including users, contacts, access keys, and automated flows.
Participant types and use cases
Definition: Represents a customer or end user engaging in the conversation.
Use Case: When a customer initiates or responds to messages via channels like WhatsApp, SMS, or Email.
Example: A customer sends a message, and their phone number is linked to the conversation as a contact.
How participants are assigned
Contact: Automatically assigned when a customer starts a conversation (participantType: “contact”).
User: Assigned when an agent or user interacts with the conversation (participantType: “user”).
AccessKey: Assigned when an API integration interacts with the conversation (participantType: “accessKey”).
Flow: Assigned when automated flows engage in the conversation (participantType: “flow”).
Examples in API Payloads
Sending messages in the Bird CRM
In the Bird CRM, starting a new conversation with an initial message is straightforward using Bird’s Conversations API. This method initiates a new conversation, assigns participants, and sends a message in a single request.
Endpoint for creating a new conversation with an initial message
Request URL
Replace {workspace_id} with your specific workspace ID.
Request payload structure:
participants: Specifies participants in the conversation.
type: The type of participant (e.g., "contact").
identifierValue: The unique identifier of the participant (e.g., phone number).
identifierKey: The type of identifier (e.g., "phonenumber").
name: Optional. Assigns a name to the conversation.
channelId: The unique ID of the channel where the conversation will take place.
initialMessage: Contains the details of the initial message to be sent in the conversation.
recipients: List of recipients for the initial message.
type: Specifies the recipient type (e.g., "to").
identifierValue: The recipient’s identifier (e.g., phone number).
identifierKey: Specifies the type of identifier (e.g., "phonenumber").
body: Details of the message content.
type: Type of message, such as "text".
text: Actual message content.
Expected Response
A successful request will return a JSON response with details about the newly created conversation, including conversation ID, participant information, and message status.
Key response fields:
id: Unique identifier for the created conversation.
status: Current conversation status (e.g., "active").
featuredParticipants: Details about all participants in the conversation.
lastMessage: Information about the latest message, including content and status.
createdAt / updatedAt: Timestamps for when the conversation was created and last updated.
By using this method, customers can initiate a new conversation in a single request, simplifying customer engagement and enabling seamless interactions. For more details, refer to the Conversations Messaging API documentation.
Replying to an existing conversation
In Bird CRM, replying to an existing conversation involves posting a message within an established conversation. This enables continuous engagement with participants, ensuring seamless communication flow.
Endpoint for Replying to a Conversation
Request URL
Replace {workspace_id} with your specific workspace ID and {conversation_id} with the ID of the existing conversation.
Request Payload Structure
body: Contains the message content for the reply.
type: Specifies the message type, such as "text".
text: Actual message content to be sent within the conversation.
participantId: Unique identifier of the participant sending the message. This ID is automatically added as a participant in the conversation creation response and should now be included explicitly in the request payload, with
participantType: "user"
.participantType: Specifies the type of participant, such as accessKey for platform agents or users sending the message.
Expected response
A successful request returns a JSON response with details of the message added to the conversation:
Key details:
id: Unique identifier for the message within the conversation.
conversationId: ID of the conversation to which the message belongs.
sender: Contains information about the participant who sent the message, including ID, type, and display name.
status: Status of the message (e.g., "accepted").
body: Contains the message content, including type and text.
createdAt and updatedAt: Timestamps indicating when the message was created and last updated.
Best practices for replying to conversations
Use the Correct Participant Identifiers: Ensure the participantId corresponds to the platform user or agent sending the message, as identified in the response of the conversation creation step.
Specify Accurate Message Types: When sending text, media, or other content types, always specify the correct message type under "body".
Maintain Consistency in Conversation Flow: Utilize the conversationId to keep replies within the appropriate conversation thread, ensuring a coherent communication history.
Using this method, customers can efficiently engage with participants in existing conversations, ensuring continuous communication without initiating a new conversation. For more information on message replies, refer to the Conversations Messaging API documentation.
Managing conversations
The Bird CRM offers tools for managing conversations, including listing, retrieving, updating, and finding conversations linked to specific contacts. Here’s a detailed overview of each action.
List conversations
This API allows you to retrieve all conversations associated with your workspace. Results include both active and archived conversations for comprehensive tracking.
Endpoint:
GET /workspaces/{workspace_id}/conversations
Key details:
nextPageToken for pagination to fetch the next page of results.
featuredParticipants lists participants prominently displayed in the conversation.
lastMessage provides a preview of the most recent message sent in each conversation.
Get conversation
To access detailed information about a specific conversation, utilise the following endpoint:
Endpoint:
GET /workspaces/{workspace_id}/conversations/{conversation_id}
Update conversation
To modify attributes of an existing conversation, including handling custom data and metadata, use the following endpoint:
Endpoint:
PATCH /workspaces/{workspace_id}/conversations/{conversation_id}
Get all conversations linked to a aontact
The Bird CRM allows you to retrieve all conversations associated with a specific contact for streamlined interaction tracking.
Endpoint
Key details:
Replace
workspace_id
andparticipant_id
with the corresponding identifiers for your workspace and contact.channelId can be added as a query parameter to filter conversations linked to a specific communication channel.
Include status as an optional query parameter to refine search results based on the status of a conversation. This allows for more precise targeting by enabling filters like active or closed
Attributes in the response provide customizable metadata, such as ticket IDs or department details, enabling efficient context-based management.
For additional features and advanced usage, visit the Conversations Management API documentation.
Last updated