获取 Webhook GET
通过唯一标识符获取指定 Webhook 的详细信息。
端点
GET https://api.pocketalert.app/v1/webhooks/{tid}身份验证
请求
路径参数
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
tid | string | ✅ | Webhook 唯一标识符 |
请求头
| 请求头 | 必填 | 说明 |
|---|---|---|
Token | ✅ | 你的 API 密钥 |
Authorization | ✅ | Bearer <jwt-token> |
请求示例
bash
curl -X GET "https://api.pocketalert.app/v1/webhooks/kblf7mh9j8jjyeh4fx" \
-H "Token: your-api-key"javascript
const tid = 'kblf7mh9j8jjyeh4fx';
const response = await fetch(`https://api.pocketalert.app/v1/webhooks/${tid}`, {
headers: { 'Token': 'your-api-key' }
});
const webhook = await response.json();python
import requests
tid = 'kblf7mh9j8jjyeh4fx'
response = requests.get(
f'https://api.pocketalert.app/v1/webhooks/{tid}',
headers={'Token': 'your-api-key'}
)
print(response.json())php
$tid = 'kblf7mh9j8jjyeh4fx';
$response = Http::withHeaders([
'Token' => 'your-api-key',
])->get('https://api.pocketalert.app/v1/webhooks/'.$tid);
return $response->json();响应
成功响应
200 OK
返回 Webhook 对象
| 字段 | 类型 | 说明 |
|---|---|---|
tid | string | Webhook 唯一标识符 |
name | string | Webhook 名称 |
url | string | Webhook URL 标识段 |
message | string | 消息模板 |
is_active | boolean | Webhook 是否处于启用状态 |
created_at | string | 创建时间戳 |
json
{
"tid": "kblf7mh9j8jjyeh4fx",
"name": "GitHub Push",
"url": "cs994rqfkk8ljngt",
"message": "Push to %repository.name%: %head_commit.message%",
"is_active": true,
"created_at": "01.09.2023 22:38:48"
}错误响应
| 状态码 | 说明 |
|---|---|
401 | 未授权 — 令牌无效或缺失 |
404 | 未找到 — Webhook 不存在 |