身份验证
请将 API 密钥作为 bearer 令牌发送。该密钥必须具有 tickets.reply 权限;缺少该权限的密钥将被拒绝并返回 403 状态码,而非 404。
您的组织 ID 应填在此处
此端点接受 org_id 作为 JSON 正文中的一个字段。
您的组织ID位于控制面板的API密钥屏幕上,就在密钥本身的旁边。这是您在每次调用时使用的相同ID。
免费试用
将尖括号中的内容替换为您自己的值,并将键占位符替换为您仪表板中的一个键。
curl -X POST https://api.zinndigital.com/v1/tickets \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "subject": <string>, "body": <string> }'已登录?您仪表板中的 API 控制台会自动填入您真实的组织 ID 和您自己的密钥,并针对实时 API 运行请求,以便您查看实际的响应。 在 API 控制台中打开此端点
详细信息
Opens a ticket in `open` with the supplied `body` as its first message, and publishes `ticket.created` (which sends the customer a localized acknowledgement via the notification consumer). `channel` is server-decided — it is not accepted from the client. A supplied `site_id` or `invoice_id` must belong to the same org or the request is a `404`. Requires `tickets.reply`.
请求正文
| 名称 | 类型 | 必填 | 内容简介 |
|---|---|---|---|
subject | string | 是 | — |
body | string | 是 | The customer's description — becomes the first message in the thread. |
priority | TicketPriority | 否 | How urgent the ticket is. The customer may propose one; staff decide. |
site_id | string | 否 | The site this is about. Must belong to the same org or the request is a 404. |
invoice_id | string | 否 | The invoice this is about. Must belong to the same org or the request is a 404. |
org_id | string | 否 | The organization to open it in. Required only when the caller holds `tickets.reply` in more than one org. |
on_behalf_of_org_id | string | 否 | The client org this is about — a reseller escalating to Zinn® on their client's behalf. Must be a **descendant** of the ticket's org or the request is a `404`; your client never… |
响应
| 名称 | 类型 | 必填 | 内容简介 |
|---|---|---|---|
id | Uuid | 是 | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
org_id | Uuid | 是 | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
subject | string | 是 | — |
status | TicketStatus | 是 | Where a ticket sits in its lifecycle. `open` = waiting on us; `pending` = waiting on the customer; `solved` = we believe it is resolved and a customer reply reopens it; `closed`… |
priority | TicketPriority | 是 | How urgent the ticket is. The customer may propose one; staff decide. |
channel | string | 是 | How the ticket reached us — `dashboard`, `api` or `staff`. Server-decided; an open string so a future channel is additive on both sides. |
site_id | object | 否 | — |
invoice_id | object | 否 | — |
on_behalf_of_org_id | object | 否 | The **client org** a reseller opened this ticket about. Null on every ordinary ticket. ⛔ Validated as a descendant of the ticket's own org and `404`d otherwise, so it can never… |
assignee_name | object | 是 | The owning agent's display name (first name), or null while unassigned. The customer sees a **name** so they know a person owns their ticket; the agent's id and email are staff-… |
first_response_at | object | 否 | — |
resolved_at | object | 否 | — |
closed_at | object | 否 | — |
last_message_at | object | 否 | — |
reopened_count | integer | 是 | — |
message_count | integer | 是 | Customer-visible messages in the thread — internal notes are not counted. |
created_at | string | 是 | — |
updated_at | string | 是 | — |
messages | TicketMessage[] | 是 | The customer-visible thread in chronological order. |
此端点可能返回的错误
401 · 403 · 404 · 422 · 429