创建工单
开发者可以通过 API 创建工单,工单创建后,会返回工单 ID。
请求方式
POST
调用地址
https://livedesk-api.engagelab.com/V2/accounts/tickets
调用验证
详情参见 API 概述的鉴权方式说明。
请求
请求示例
curl -X POST 'https://livedesk-api.engagelab.com/V2/accounts/tickets' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic base64(api_key:api_secret)' \
-d '{
"title": "打印机卡纸,无法打印",
"description": "客户反映A4纸卡在出纸口,急需处理。",
"attachments": [
{
"file_url": "https://example.com/files/error.jpg"
}
],
"requester": {
"euid": "contact_12345",
"channel_contacts": {
"channel_id": "inbox_100",
"contact_id": "-1001234567890",
"sub_contact_id": "23232323",
"followers": [
{
"id": "7562646527",
"name": "张三"
}
]
}
},
"submitter": {
"id": "u_12345"
},
"assignment_team": "IT支持",
"priority": "high",
"ticket_type": "incident",
"custom_fields": {
"device_sn": "PRN-2024-001",
"location": "北京总部-3楼打印室"
}
}'
curl -X POST 'https://livedesk-api.engagelab.com/V2/accounts/tickets' \
-H 'Content-Type: application/json' \
-H 'Authorization: Basic base64(api_key:api_secret)' \
-d '{
"title": "打印机卡纸,无法打印",
"description": "客户反映A4纸卡在出纸口,急需处理。",
"attachments": [
{
"file_url": "https://example.com/files/error.jpg"
}
],
"requester": {
"euid": "contact_12345",
"channel_contacts": {
"channel_id": "inbox_100",
"contact_id": "-1001234567890",
"sub_contact_id": "23232323",
"followers": [
{
"id": "7562646527",
"name": "张三"
}
]
}
},
"submitter": {
"id": "u_12345"
},
"assignment_team": "IT支持",
"priority": "high",
"ticket_type": "incident",
"custom_fields": {
"device_sn": "PRN-2024-001",
"location": "北京总部-3楼打印室"
}
}'
Este bloque de código se muestra en una ventana flotante
请求头
| 字段 | 类型 | 描述 |
|---|---|---|
| Authorization | string | 使用 Authorization: Basic base64(API Key:API Secret) 进行身份验证。请前往 API 密钥页面 获取 API Key 和 API Secret,并将两者以冒号连接后进行 Base64 编码。 |
| Content-Type | application/json | 数据类型,取值为 application/json。 |
请求体参数
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
| title | String | 是 | 工单标题。 |
| description | String | 否 | 工单内容描述,支持md格式。 |
| attachments | Array | 否 | 附件数组,需先通过 /upload 上传。 |
| file_url | String | 是 | 文件地址。 |
| requester | Object | 是 | 请求者信息。 |
| euid | String | 否 | 联系人唯一ID。 |
| channel_contacts | Object | 否 | 渠道联系人映射(与 euid 至少存在一个)。 |
| channel_id | String | 是 | 渠道ID。 |
| contact_id | String | 是 | 渠道联系人ID(如TG 的 chat_id)。 |
| sub_contact_id | String | 否 | 渠道子联系人ID(如 TG 的 topic_id / Email thread_id)。 |
| followers | Array | 否 | 关注者ID信息(用于渠道内推送/通知),包含id和name字段。 |
| submitter | Object | 否 | 提交者ID(内部成员账号ID),包含id字段。 |
| assignment_team | String | 否 | 分配团队名称(需已存在)。 |
| priority | String | 否 | 优先级:high/medium/low,不传默认为medium。 |
| ticket_type | String | 否 | 工单类型:problem/incident/question/task/None,不传默认为None。 |
| custom_fields | Object | 否 | 自定义字段(来源信息等),使用key-value格式。 |
响应示例
成功响应
{
"code": 0,
"message": "Success",
"data": {
"ticket_id": "tk_20251104_789abc",
"message": "Ticket created successfully"
}
}
{
"code": 0,
"message": "Success",
"data": {
"ticket_id": "tk_20251104_789abc",
"message": "Ticket created successfully"
}
}
Este bloque de código se muestra en una ventana flotante
响应参数
| 字段 | 类型 | 必填 | 描述 |
|---|---|---|---|
| ticket_id | String | 否 | 工单ID. |
| message | String | 否 | 返回消息内容。eg:"Ticket created successfully" |










