Textchat V2 API
API Specification of the Parloa TextchatV2 API
The Parloa Textchat V2 API provides a simple request-response mechanism to integrate a Parloa text chat bot into your application or chat system. Utilize a single endpoint for sending TextchatV2Request
events and receiving TextchatV2Response
, facilitating easy conversation management.
Conversation Protocol
Initiate a Conversation: Send a
TextchatV2LaunchEvent
to begin, receiving a welcome message in response.Continue Conversing: Utilize
TextchatV2MessageEvent
for user responses. The conversation remains active until the bot setsendConversation
to true or aTextchatV2QuitEvent
is sent.
Authentication
To authenticate against the textchat bot, invoke the dialoghook webhook with a Bearer token containing the apiToken
generated during the textchat bot's release creation.
Prerequisites
Register on the Parloa developer platform to get an API key.
Ensure your server supports HTTP POST requests.
Be familiar with JSON payloads, as this API requires them.
Endpoint
URL:
https://app.parloa.com/dialoghook?dialog=<releaseId>&platform=textchatV2
Method: POST
Request
Query Parameters
dialog
(Required, string) â ThereleaseId
of your Textchat V2 release.platform
(Required, string) â For this API, you must set the platform to "textchatV2".
Body Parameters
apiVersion
(Required) â The version of the API you are using.event
(Required, TextchatV2Event) â The type of event. This can be one of the following â Define the event type. This could be one of the following:TextchatV2LaunchEvent
: To indicate that a user wants to start a new chat.TextchatV2MessageEvent
: To signal that a user has sent a new message.TextchatV2QuitEvent
: To notify that a user has left the chat.
requesterId
(Required, string) â An identifier for Parloa to recognize a user. Typically, this would be something like a user ID.sessionId
(Required, string) â The conversationId of the chat widget. Parloa uses this to maintain the state of the chat between a user and a Parloa bot.context
(Optional, Array with a maximum of 100 items) â Additional context information to pass to the Parloa bot.TextchatV2ContextItem
key (Required, string) â The identifier for a context field that the bot can access.
value (Required) â The actual context item value.
Request Headers
Authorization
â Your API key.accept
- application/json.Content-Type
- application/json.
Response
When you send a request to TextchatV2, the service returns a JSON-formatted response that you can parse to extract necessary information.
Response Codes
200 OK: Event successfully sent.
400 Bad Request: Invalid or incomplete request.
401 Unauthorized: Incorrect or missing API key.
404 Not Found: Specified chat session does not exist.
Making a POST Request
To initiate any interaction with Parloa's chatbot, send a POST request to https://app.parloa.com/dialoghook?dialog=<releaseId>&platform=textchatV2
. For every request, you must do the following:
Substitute
YOUR_API_KEY
with the API key you have from the Parloa developer platform.Insert relevant identifiers for
<user-id>
and<session-id>
.Replace
<release_id>
in the URL with your Textchat V2 release-specific ID.
Types of Requests
Starting a Conversation
To initiate a conversation, use the launch
event type, representing TextchatV2LaunchEvent
.
Sending a Message to the Bot
The message
event type is employed for ongoing conversations and represents TextchatV2MessageEvent
.
Sending a Message with Context to the Bot
In a continuous conversation, you can send additional context.
Ending the Conversation
The quit
event type signals to the bot that you wish to end the conversation.
Response Parameters
apiVersion
(Required, string) â The version of the API being used.conversationId
(Optional, string) â The ID of the current conversation.endConversation
(Required, boolean) â This field will be set to true if the conversation is intended to terminate with this response.releaseId
(Required, string) â The identifier for the specific release of the bot that generated this response.requesterId
(Required, string) â This is the same identifier you initially sent in your TextchatV2Request under requesterId. It's used to recognize participants in the conversation.responseElements
(Required, array) â This is where you'll find all the elements that make up the bot's response. Each element is an object that could contain various types of data or instructions.TextchatV2ResponseItem: This would contain additional details specific to each response item.
sessionId
(Required, string) â Just likerequesterId
, this is an echo back of the sessionId you sent in your TextchatV2Request. Parloa uses this to keep track of conversation states between a user and a Parloa bot.
For a detailed schema of the TextChat V2 API, click here.
Last updated