Coversation Starter for Botpress
Webchat API
https://webchat.botpress.cloud/11cf5d84-ba87-4ff7-8393-914d3e60c257
Webhook API
https://webhook.botpress.cloud/b4deb74d-8be2-4373-90e1-c28bebcbf58d
Replace YOUR_USER_KEY and YOUR_WEBHOOK_SECRET with the applicable credentials.
Chat Operations
Create User
POST /users
Submit a request to create a webchat user.
Headers
| Name | Value | Description |
|---|---|---|
Content-Type |
application/json |
Request body format. |
Request body
The supplied request sends an empty JSON object.
{}
Curl
curl --location --request POST \
--url 'https://webchat.botpress.cloud/11cf5d84-ba87-4ff7-8393-914d3e60c257/users' \
--header 'Content-Type: application/json' \
--data '{}'
Responses
No response sample was supplied. HTTP status codes and response fields are not documented here.
Create Conversation
POST /conversations
Submit a request to create a conversation using the supplied user key.
Headers
| Name | Value | Description |
|---|---|---|
x-user-key |
YOUR_USER_KEY |
User credential for the request. |
Content-Type |
application/json |
Request body format. |
Request body
The supplied request sends an empty JSON object.
{}
Curl
curl --location --request POST \
--url 'https://webchat.botpress.cloud/11cf5d84-ba87-4ff7-8393-914d3e60c257/conversations' \
--header 'x-user-key: YOUR_USER_KEY' \
--header 'Content-Type: application/json' \
--data '{}'
Responses
No response sample was supplied. HTTP status codes and response fields are not documented here.
Webhook Operations
Submit Buyer and Seller Details
POST https://webhook.botpress.cloud/b4deb74d-8be2-4373-90e1-c28bebcbf58d
Send a name, seller identifier and buyer identifier to the configured webhook.
Headers
| Name | Value | Description |
|---|---|---|
Content-Type |
application/json |
Request body format. |
x-bp-secret |
YOUR_WEBHOOK_SECRET |
Secret configured for the webhook. |
Request body parameters
| Name | Type | Description |
|---|---|---|
name |
string | Name supplied to the webhook. Example: rahul. |
seller_id |
string | Seller identifier. Example: 14321376. |
buyer_id |
string | Buyer identifier. Example: 65857057. |
Curl
curl --location --request POST \
--url 'https://webhook.botpress.cloud/b4deb74d-8be2-4373-90e1-c28bebcbf58d' \
--header 'Content-Type: application/json' \
--header 'x-bp-secret: YOUR_WEBHOOK_SECRET' \
--data '{
"name": "rahul",
"seller_id": "14321376",
"buyer_id": "65857057"
}'
Responses
No response sample was supplied. HTTP status codes, response fields and downstream processing are not documented here.
The supplied webhook request does not include a user or conversation identifier. How these details are associated with a webchat conversation is not established by this sample.
Message Operations
Send Text Message
POST /messages
Submit a text message to the specified conversation using the user key.
Headers
| Name | Value | Description |
|---|---|---|
x-user-key |
YOUR_USER_KEY |
User credential for the request. |
Content-Type |
application/json |
Request body format. |
Request body parameters
| Name | Type | Description |
|---|---|---|
conversationId |
string | Identifier of the conversation receiving the message. Replace the example with your conversation identifier. |
payload |
object | Message content. |
payload.type |
string | text in this example. |
payload.text |
string | Text to send. |
Curl
curl --location --request POST \
--url 'https://webchat.botpress.cloud/11cf5d84-ba87-4ff7-8393-914d3e60c257/messages' \
--header 'x-user-key: YOUR_USER_KEY' \
--header 'Content-Type: application/json' \
--data '{
"conversationId": "conv_01M527QRHTG4M0MBPYHCAPDQ0B",
"payload": {
"type": "text",
"text": "i need cnc cutting machine"
}
}'
Responses
No response sample was supplied. HTTP status codes, response fields and bot reply delivery are not documented here.