Queue a test event for an endpoint
curl --request POST \
--url https://api-sandbox.unifystays.com/webhooks/endpoints/{endpoint_id}/test \
--header 'x-api-key: <api-key>'import requests
url = "https://api-sandbox.unifystays.com/webhooks/endpoints/{endpoint_id}/test"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://api-sandbox.unifystays.com/webhooks/endpoints/{endpoint_id}/test', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-sandbox.unifystays.com/webhooks/endpoints/{endpoint_id}/test",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-sandbox.unifystays.com/webhooks/endpoints/{endpoint_id}/test"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-sandbox.unifystays.com/webhooks/endpoints/{endpoint_id}/test")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.unifystays.com/webhooks/endpoints/{endpoint_id}/test")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"event_id": "evt_3bc2fa3d35cc4bbf98359b3fb85a4fb2",
"delivery_id": "1842"
}Webhook endpoints
Send Test Webhook
Queue a signed webhook.test event for an active endpoint.
POST
/
webhooks
/
endpoints
/
{endpoint_id}
/
test
Queue a test event for an endpoint
curl --request POST \
--url https://api-sandbox.unifystays.com/webhooks/endpoints/{endpoint_id}/test \
--header 'x-api-key: <api-key>'import requests
url = "https://api-sandbox.unifystays.com/webhooks/endpoints/{endpoint_id}/test"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://api-sandbox.unifystays.com/webhooks/endpoints/{endpoint_id}/test', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-sandbox.unifystays.com/webhooks/endpoints/{endpoint_id}/test",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-sandbox.unifystays.com/webhooks/endpoints/{endpoint_id}/test"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-sandbox.unifystays.com/webhooks/endpoints/{endpoint_id}/test")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.unifystays.com/webhooks/endpoints/{endpoint_id}/test")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"event_id": "evt_3bc2fa3d35cc4bbf98359b3fb85a4fb2",
"delivery_id": "1842"
}Returns
202 Accepted with an event_id and delivery_id. The test uses the
same signing, timeout, logging, and retry system as booking events.
Use Get Webhook Delivery with the
returned delivery ID to inspect every attempt. A paused or disabled endpoint
must be reactivated before you can send a test.Authorizations
Environment-specific API key created in the Unifystays portal
Headers
Path Parameters
Webhook endpoint UUID.
Example:
"8b95a9e0-4af3-4c6d-92df-84b64256d27f"
Response
202 - application/json
Test event and delivery queued successfully.