Views 工单查看分类接口

JSON格式

NameTypeComment
idinteger查看分类id,由系统自动分配
urlstring资源url
titlestring查看分类名称
activeboolean查看分类是否启用
created_atdate查看分类创建时间
slas_idinteger若是slas查看分类,此字段会带有值

JSON 示例

{
  "view": {
    "id": 25,
    "title": "Recent updated",
    "active": true,
    "sla_id": 23842
  }
}

工单查看分类列表

GET /apiv2/views.json

返回当前客服的工单查看分类

也可以使用如下API:

返回当前客服可用的工单查看分类
GET /apiv2/views/active.json
调用权限

agent

curl 示例
curl https://{subdomain}.kf5.com/apiv2/views.json \
  -v -u {email}:{password}
返回示例
Status: 200 OK
{
  "views": [
    {
      "id":25,
      "title":"Recent Tickets",
      "active":true,
      ...
    },
    ...
  ],
  "count": 7,
  "next_page": null,
  "previous_page": null
}

获取指定查看分类

GET /apiv2/views/{id}.json
调用权限

agent

curl 示例
curl https://{subdomain}.kf5.com/apiv2/views/{id}.json \
  -v -u {email}:{password}
返回示例
Status: 200 OK

{
  "view": {
      "id":25,
      "title":"Recent Tickets",
      "active":true,
      ...
   }
}

获取指定查看分类里的工单

GET /apiv2/views/{id}/tickets.json
调用权限

agent

curl 示例
curl https://{subdomain}.kf5.com/apiv2/views/{id}/tickets.json \
  -v -u {email}:{password}
返回示例
Status: 200 OK

{
  "tickets": [
    {
      "id":      35436,
      "title": "Help I need somebody!",
      ...
    },
    {
      "id":      20057623,
      "title": "Not just anybody!",
      ...
    }
  ]
}

获取指定查看分类的工单个数

GET /apiv2/views/{id}/count.json
调用权限

agent

curl 示例
curl https://{subdomain}.kf5.com/apiv2/views/{id}/count.json \
  -v -u {email}:{password}
返回示例
Status: 200 OK

{
	"view_count": {
		"view_id": 1137,
		"count": 20
	}
}

获取多个查看分类的工单个数

GET /apiv2/views/count_many.json?ids={ids}
调用权限

agent

curl 示例
curl https://{subdomain}.kf5.com/apiv2/views/count_many.json?ids={ids} \
  -v -u {email}:{password}
返回示例
Status: 200 OK

{
	"view_counts": [
	 {
		"view_id": 1140,
		"count": 0
	 },
	 {
		"view_id": 1164,
		"count": 3
	 }
	]
}