Get widget
获取小部件
GET
/v1/widgets/id
按 ID 返回单个小部件。路径参数 id 为资源主键;响应体字段以本文示例为准(可替换为你的 OAS 示例)。
Path 参数
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
id |
path | string | 必填 | 小部件 ID |
Header 参数
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
Authorization |
header | string | 必填 | Bearer <token> |
请求示例
curl(静态示例;本页无试调表单)
curl -sS 'https://api.example.com/v1/widgets/wdg_42' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Accept: application/json'
fetch
fetch('https://api.example.com/v1/widgets/wdg_42', {
headers: {
'Authorization': 'Bearer YOUR_TOKEN',
'Accept': 'application/json'
}
}).then(r => r.json())
响应
200 成功
application/json
{
"id": "wdg_42",
"name": "Demo Widget",
"status": "active",
"updated_at": "2026-11-02T08:00:00Z"
}
404 未找到
ID 不存在或不在当前鉴权范围。
{
"error": {
"code": 404,
"message": "Widget not found"
}
}
这篇文档对你有帮助吗?
谢谢你的反馈!