Webhooks
測試 Webhook
發送一個測試事件,以驗證你的 Webhook 端點是否可訪問,以及簽名驗證是否正常工作。
POST
/
api
/
v1
/
webhooks
/
{id}
/
test
測試 Webhook
curl --request POST \
--url https://api.example.com/api/v1/webhooks/{id}/testimport requests
url = "https://api.example.com/api/v1/webhooks/{id}/test"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/api/v1/webhooks/{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.example.com/api/v1/webhooks/{id}/test",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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.example.com/api/v1/webhooks/{id}/test"
req, _ := http.NewRequest("POST", url, nil)
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.example.com/api/v1/webhooks/{id}/test")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/webhooks/{id}/test")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body路徑參數
string
必填
該 Webhook 的 UUID。
行為說明
派發一個completion.created 事件,其數據負載中包含 _test: true。此次投遞會使用與真實事件相同的 HMAC 簽名、SSRF 檢測和重試邏輯。
示例
curl -X POST https://www.hitheo.ai/api/v1/webhooks/WEBHOOK_ID/test \
-H "Authorization: Bearer $THEO_API_KEY"
await theo.testWebhook("WEBHOOK_ID");
響應
{ "sent": true }
你的服務器收到的測試事件負載
{
"id": "evt_abc123...",
"type": "completion.created",
"created": "2026-04-15T12:00:00.000Z",
"data": {
"_test": true,
"message": "This is a test event from Theo. If you received it, your webhook is working!"
}
}
可通過投遞日誌查看該測試事件是否投遞成功。
這個頁面有幫助嗎?
測試 Webhook
curl --request POST \
--url https://api.example.com/api/v1/webhooks/{id}/testimport requests
url = "https://api.example.com/api/v1/webhooks/{id}/test"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/api/v1/webhooks/{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.example.com/api/v1/webhooks/{id}/test",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$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.example.com/api/v1/webhooks/{id}/test"
req, _ := http.NewRequest("POST", url, nil)
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.example.com/api/v1/webhooks/{id}/test")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/webhooks/{id}/test")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body