Jamdesk Documentation logo

请求与响应示例

了解如何使用 RequestExample 和 ResponseExample 组件,通过 Acme 支持工单工作流记录 API。

GEThttps://jamdesk-docs.jamdesk.app/api/playground/demo/tickets/{ticket_id}

使用 RequestExampleResponseExample 展示实际 API 用法,并将其与端点文档结合。组件支持多种语言、响应状态和内联说明。

示例:获取支持工单

此示例记录了 Acme Support API 的简单 GET /tickets/{ticket_id} 端点。

请求

使用参数字段描述端点所需的内容。代码示例显示在右侧边栏中。

ticket_idstringrequired

创建工单时返回的唯一工单标识符。

curl -X GET https://api.acme.com/v1/tickets/tkt_9S8L2 \
  -H "Authorization: Bearer $ACME_TOKEN"

响应

使用响应字段记录 API 返回的最重要属性。

idstringrequired

唯一工单标识符。

statusstring

当前工单状态(openpendingresolved)。

created_atstring

工单创建时间的 ISO 8601 时间戳。

{
  "id": "tkt_9S8L2",
  "customer_id": "cus_2X9W8",
  "subject": "Export stuck on step 3",
  "priority": "high",
  "status": "open",
  "created_at": "2026-02-04T16:12:00Z"
}

提示

  • 至少包含一个成功响应和一个错误响应。
  • 使用真实的标识符和时间戳,让示例更贴近实际。
  • 保持负载简洁,方便读者快速浏览。

相关页面

API Playground

在端点页面启用交互式 API 测试

OpenAPI Example

查看自动生成的端点页面

Examples Component

了解组件属性和格式设置规则

Fields Component

记录请求和响应架构