Support & information center

Webhook formats

testRTC enables the use of webhooks to catch a rich set of events within the system. These include:

  1. testingRTC and upRTC test results, when a test run or a monitor run finishes
  2. qualityRTC network test results, when an end user conducts a network test
  3. watchRTC custom alerts, when certain configurable events occur

These webhooks can use different formats to fit the various third party systems you might be using.

Listed below are the formats supported and how to configure them.

URL only

If you place in the webhook the URL only, we will be sending it out as a JSON object.

Code language: JSON / JSON with Comments (json)

JSON object

The webhook configuration below sends the information as a JSON object in the body of the message.

{ "format": "json/object", "url": "https://dummy.url" }
Code language: JSON / JSON with Comments (json)

JSON text format

If you are planning to integrate the webhook with something like Slack or Zapier, then the best approach is to use a JSON text format, where we “stringify” the information.

{ "format": "json/text", "url": "https://dummy.url" }
Code language: JSON / JSON with Comments (json)

You can read more on sending test results via webhook to Slack.


Here is how to send our webhooks as CloudEvents v1.0 format:

{ "format": "cloudevent", "url": "https://dummy.url" }
Code language: JSON / JSON with Comments (json)

The above will send the webook to “url” formatting the body of the message as CloudEvents format.

Amazon SNS

If you plan on sending the webhook to Amazon Simple Notification Service, then you can use the following format:

{ "provider": "aws-sns", "secretAccessKey": "xxx", "region": "xxx", "accessKeyId": "xxx", "roleArn": "xxx", "topicArn": "xxx", "body": { "Server": "TestRTC", "Instance": "<%this.runName%>", "Severity": "TestRTC", "Message": `testRTC Alert for <%this.testName%> <%this.runName%> error:<%this.error%> url:<%this.resultUrl%> failure:<% this.failureScreenshot %>`, } }
Code language: JSON / JSON with Comments (json)

Custom body templating

If none of the above fits your needs, you can also format our webhook as you see fit using our body templating format. Here is an example for it:

{ "url": "", "body": { "testRunId": "<%this.testRunId%>", "testName": "<%this.testName%>", "userName": "<%this.userName%>", "projectName": "<%this.projectName%>", "projectId": "<%this.projectId%>", "status": "<%this.status%>", "concurrentUsers": "<%this.concurrentUsers%>", "numberOfProbesSuccess": "<%this.numberOfProbesSuccess%>", "numberOfProbesWarning": "<%this.numberOfProbesWarning%>", "numberOfProbesFailure": "<%this.numberOfProbesFailure%>", "totalTestTimeMin": "<%this.totalTestTimeMin%>", "score": "<%this.score%>", "runName": "<%this.runName%>", "runType": "<%this.runType%>", "error": "<%this.error%>", "additionalInfo": "<%this.additionalInfo%>", "failureReasons": "<%this.failureReasons%>", "failureScreenshot": "<%this.failureScreenshot%>", "resultUrl": "<%this.resultUrl%>" } }
Code language: JSON / JSON with Comments (json)

Available variables can be found here.

Filtering webhooks

For testingRTC and upRTC, you may want to invoke the webhook only in certain conditions, such as a failed test. For this purpose, you can use the #webhook-filter run option. To that end, you can add something like this to you test run options:

Code language: JavaScript (javascript)

The run option above means that the webhook will only be invoked if the test run ended with a status of error or warning.

Was this article helpful?

Related Articles