Test Trigger with External Service

Prev Next
Post
/api/v1/livechat/triggers/external-service/test
Premium tag

Test your Livechat trigger setup with external service using this endpoint. Make sure that you have created the trigger. Permission required: view-livechat-manager. Rate limit applies: 15 requests per 60000 milliseconds.

Header parameters
X-Auth-Token
stringRequired

The authToken of the authenticated user.

ExampleRScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
X-User-Id
stringRequired

The userId of the authenticated user.

ExamplerbAXPnMktTFbNpwtJ
Body parameters
Example 1
{
  "webhookUrl": "https://webhook.site/2f5df6a1-592c-4d9f-8f36-ab15ca3caf23",
  "timeout": "10000",
  "fallbackMessage": "Request timeout"
}
object
webhookUrl
string Required

Enter the external webhook URL.

Examplehttps://webhook.site/2f5df6a1-592c-4d9f-8f36-ab15ca3caf23
timeout
string Required

Enter the time in milliseconds to wait for the external service to respond before cancelling the request.

Example10000
fallbackMessage
string Required

Enter the message to send after the timeout ends.

Default"Request timeout"
Responses
200

OK

Rocket.Chat sends a request to the webhook containing a payload of the visitor metadata. The webhook returns the response as demonstrated in this example.

Example 1
{
  "triggerId": "test-trigger",
  "response": {
    "statusCode": 200,
    "contents": [
      {
        "msg": "Welcome to our support center, Morgan! How can we assist you today?",
        "order": 0
      },
      {
        "msg": "Feel free to ask any questions you have. We're here to help!",
        "order": 1
      }
    ]
  },
  "success": true
}
Expand All
object
triggerId
string
response
object
statusCode
integer
contents
Array of object
object
msg
string
order
integer
success
boolean
400

Bad Request

Example 1
{
  "success": false,
  "error": "must have required property 'webhookUrl' [invalid-params]",
  "errorType": "invalid-params"
}
object
success
boolean
error
string
errorType
string
401

Unauthorized

Authorization Error
{
  "status": "error",
  "message": "You must be logged in to do this."
}
object
status
string
message
string
Tags