Webhook

A webhook is a special type of synthetic test used to call out to other computer systems to obtain information instead of asking the user.

Webhook settings

Setting

Description

url

URL of the webhook handler

Must be HTTPS

Example:

"url" : "https://secret-basin-59856.herokuapp.com/webhook"

username

Basic authentication username

Optional (but required if password defined)

Example:

"username" : "wonka"

password

Basic authentication password

Optional (but required if username defined)

Example:

"password" : "123456" (use a much stronger password!)

headers

List of HTTP headers to pass to webhook handler

You can use these to send the webhook handler additional application-specific data Do NOT use header keys that might clash with established HTTP header names

Example:

"headers": [ {"key" : "key1", "value" : "value1"}, {"key" : "key2", "value" : "value2"} ]

post
Webhook handler

https://api.acme.com/v1/webhook
Implement this web POST method to connect eXvisory webhook invocations to third party computer systems. The method must be accessible from the public Internet. The request is automatically created by the eXvisory framework. When you implement this method interpret the supplied request parameters to return an appropriate webhook response.
Request
Response
Request
Headers
Authorization
optional
string
Base-64 encoded basic authentication header
key1
optional
string
Optional header(s) from webhook settings
Body Parameters
token
required
string
Identifies the calling eXvisory test Format: x_test_class_label[_variant] Example: x_test_cat_picture
facts
required
object
Currently established facts (not ordered) Example: facts: { bed_mice_eliminator: 'UNKNOWN', cat_own: true, cat_own_usr: 'Yes (I have a cat)', cat_eliminator: 'UNKNOWN', exvisory_version: '1.0.1.214', cat_name: 'Hooded Paw', bed_mice_user: 'Martin' }
Response
200: OK
Return eXvisory logic result (e.g. URL of random cat photo)
{
"result" : "https://cdn2.thecatapi.com/images/b5u.jpg"
}
400: Bad Request
To signal an error return a non-200 HTTP status code or add an error field.
{
"result" : "error",
"error" : "No more cat photos :("
}