Imports 导入接口

工单导入

POST /apiv2/imports/tickets.json
调用权限

admin

请求参数
{
  "ticket": {
    "requester_id": 11,
    "title": "工单标题",
    "assignee_id": 18,
    "group_id": 10,
    "source": "web",
    "tags": [ "import", "tag1" ],
    "created_at": "2013-06-25 10:15:18",
    "comments": [
      { "author_id": 11, "content": "This is a comment", "created_at": "2013-06-25 10:15:18" },
      { 
	      "author_id": 18, 
	      "content": "This is a private comment",
	      "public": false, 
	      "created_at": "2013-06-25 10:20:50"  
      }
    ]
  }
}

导入接收数据为单个工单数据,批量导入时请循环调用接口。如果在导入时出错,可以方便处理出错数据

工单在导入时,触发器等系统规则对该条工单不生效

导入时允许设置工单的created_at,updated_at等时间字段

允许设置工单回复comments的创建时间created_at, 注意comments数据必须包含author_id,content字段值

请在导入前确认工单及回复所涉及的用户全部存在于云客服平台里,如果没有请调用 用户接口 Users API 进行创建

了解更多关于工单的操作请看 工单(客服) 接口 Tickets API

curl 示例
 curl https://{subdomain}.kf5.com/apiv2/imports/tickets.json \
  -v -u {email_address}:{password} -X POST \
  -d '{"ticket": {"requester_id":733,"title": "Help", "comments": [{ "author_id": 733, "content": "This is a comment" }]}}' \
  -H "Content-Type: application/json"
返回示例
Status: 201 Created
Location: https://{subdomain}.kf5.com/apiv2/tickets/{id}.json

{
  "ticket": {
    {
      "id":      1234,
      "title": "Help",
      ...
    }
  }
}