Typebot
Integration with Typebot via the endpoint "/api/v2/instance/{instanceId}/typebot-integration" is a functionality designed to connect a specific instance with Typebot , a conversational bot platform. This integration allows the implementation and management of interactive bots, improving interaction and engagement with users.
Typebot Integration Overview
Main Features:
1. Integration Configuration (POST)
- Objective: Set up a new integration with Typebot.
- Main Parameters:
publicId
: ID or name of the Typebot.typebotURL
: Typebot host URL.enabled
: Enable or disable integration.
- Expected Response: Success (201) with integration details.
2. Integration Recovery (GET)
- Objective: Obtain details of the configured integration.
- Parameters:
instanceId
(instance ID). - Expected Response: Success (200) with integration information.
3. Integration Update (PUT)
- Purpose: Update the settings of an existing integration.
- Main Parameters: Same as POST.
- Expected Response: Success (201) with updated details.
4. Integration Removal (DELETE)
- Objective: Remove integration from a specific instance.
- Parameters:
instanceId
(instance ID). - Expected Response: Success (200).
5. Session Management
- Endpoint
/session
(GET): Find sessions bykeyRemoteJid
andstatus
. - Endpoint
/session/{sessionId}
(PATCH): Update session status bysessionId
.
Integration Process
- Initial Configuration: Through a POST request, Typebot details are sent to the API, including ID, URL and integration status.
- Update and Management: Existing configurations can be updated (PUT) and details of existing integrations can be retrieved (GET).
- Session Management: Advanced session management is possible through specific endpoints, allowing greater control over Typebot interactions.
Key Components of the Request:
publicId
: ID or name assigned to Typebot.typebotURL
: Typebot host URL (default: https://typebot.io).enabled
: Enables or disables the integration.
Integration Process
- Configuration Request: A POST request is sent to configure the integration, including the
publicId
,typebotURL
, and integration status (enabled
). - Validation and Execution: The API validates the request and executes the configuration, establishing the connection between the instance and Typebot.
- Operation Feedback: Responses are sent indicating the success or failure of the operation.
Variables Available in the Bot Execution Scope
During bot execution, several variables are available in scope for use. Here are the variables and their descriptions:
instanceInstanceId
: ID of the connected WhatsApp instance. This is a unique string that identifies the WhatsApp instance that is currently connected.keyRemoteJid
: This is the reference of the phone number connected to the instance. It is a string that represents the phone number of the user interacting with the bot.keyId
: This is the ID of the message received in the WhatsApp chat. It is a unique string that identifies the specific message that was received.contentType
: This is the type of the message. It can be text, image, video, etc. It is a string that describes the content type of the message.messageId
: This is the message reference in the database. It is a unique string that identifies the message in the database.pushName
: This is the sender's name. It is the string that represents the name of the user sending the message.businessId
: This is the ID of the business the instance is linked to. It is a unique string that identifies the business. These variables can be used to customize the bot experience, respond to specific messages, identify the sender, etc.
Documentation and Examples
This integration with Typebot offers an efficient and interactive method to engage users and automate communication tasks by leveraging the advanced capabilities of modern conversational bots.