Webhooks
Webhook 日志
查看最近的 Webhook 投递记录
GET
/
api
/
v1
/
webhooks
/
logs
Webhook 日志
curl --request GET \
--url https://api.example.com/api/v1/webhooks/logsimport requests
url = "https://api.example.com/api/v1/webhooks/logs"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v1/webhooks/logs', 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/logs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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/logs"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/webhooks/logs")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/webhooks/logs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"id": 123,
"event_type": "<string>",
"payload": {},
"response_status": 123,
"attempts": 123,
"created_at": "<string>"
}Webhook 日志
最近的投递尝试,最新的排在最前——我们发送了什么,您的服务器回应了什么。查询参数
integer
页码,从
1 开始。默认 1。integer
每页条数,
1–100。默认 50。响应
记录数组。number
日志条目 ID。
string
投递的事件,例如
order.updated。object
实际发送的完整信封,
event / data / timestamp——与计算签名所用的字节完全一致。number
您的服务器返回的 HTTP 状态码。
0 表示根本没有收到 HTTP 响应——连接、TLS 握手或读取失败或超时。number
三次尝试中实际进行了几次。
1 表示第一次就成功。string
投递结束的时间,ISO-8601。
示例
curl https://api.tronrental.com/v1/webhooks/logs \
-H "X-API-Key: your_api_key"
Response
[
{
"id": 105,
"event_type": "order.updated",
"payload": {
"event": "order.updated",
"data": {
"id": 247033,
"type": "energy",
"status": "filled",
"target_address": "TXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"volume": 65000,
"expected_volume": 65000,
"delivered_volume": 65000,
"price_trx": "2.75",
"delegate_txid": "a1b2c3d4e5f6...",
"undelegate_txid": null,
"reclaim_at": "2026-09-15T07:44:56+00:00"
},
"timestamp": "2026-09-14T14:51:16.986341+00:00"
},
"response_status": 200,
"attempts": 1,
"created_at": "2026-09-14T14:51:16.986341Z"
}
]
在用这份日志排查之前,有两点需要知道:
- 日志列出的是归属于您API 密钥的投递,因此
subscription.transfer和package.*的投递目前不会出现在这里,即使它们确实已经发送。 - 无法解析的 URL,或解析到私有地址的 URL,完全不会产生记录——空日志无法区分「没有事件」和「地址被拒绝」。如果您预期有流量却什么也看不到,请到 Dashboard → API 检查 URL。
⌘I
Webhook 日志
curl --request GET \
--url https://api.example.com/api/v1/webhooks/logsimport requests
url = "https://api.example.com/api/v1/webhooks/logs"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v1/webhooks/logs', 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/logs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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/logs"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/webhooks/logs")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/webhooks/logs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"id": 123,
"event_type": "<string>",
"payload": {},
"response_status": 123,
"attempts": 123,
"created_at": "<string>"
}