Groups 客服组接口

JSON格式

NameTypeRead-onlyComment
idintegeryes客服组id,由系统自动分配
urlstringyes资源url
namestringyes客服组名称
created_atdateyes创建时间
agentsarrayyes客服组里的客服用户列表

JSON示例

{
	"id": 165,
	"url": "https://support.kf5.com/apiv2/groups/165.json",
	"name": "支持组",
	"created_at": "2013-05-01 11:52:06",
	"agents": [
	{
		"id": 886,
		"url": "https://support.kf5.com/apiv2/users/886.json",
		"username": "support@kf5.com",
		"name": "客服小叶"
	},
	{
		"id": 733,
		"url": "https://support.kf5.com/apiv2/users/733.json",
		"username": "agent@kf5.com",
		"name": "agent"
	}
	]
}

客服组列表

GET /apiv2/groups.json

还可以调用API:

GET /apiv2/users/{user_id}/groups.json
调用权限

agent

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

{
  "groups": [
    {
      "id":         211
      "name":       "group1",
      ...
    },
    {
      "id":         122
      "name":       "group2",
      ...
    }
  ]
}

查看客服组

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

agent

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

{
  "group": {
      "id":         211
      "name":       "group1",
      ...
   }
}

创建客服组

POST /apiv2/groups.json
调用权限

admin

Note:如果要设置客服组里的客服,可以设置agents参数,类型为数组,元素值为客服id,如:

{"agents":[123,232]}
curl 示例
curl https://{subdomain}.kf5.com/apiv2/groups.json \
  -H "Content-Type: application/json" -d '{"group": {"name": "My Group"}}'
  -v -u {email_address}:{password} -X POST
返回示例
Status: 201 Created
Location: https://{subdomain}.kf5.com/apiv2/groups/{id}.json

{
  "group": {
      "id":         234,
      "name":       "My Group",
      ...
   }
}

修改客服组

PUT /apiv2/groups/{id}.json
调用权限

admin

curl 示例
curl https://{subdomain}.kf5.com/apiv2/groups/{id}.json \
  -H "Content-Type: application/json" -d '{"group": {"name": "Interesting Group"}}' \
  -v -u {email_address}:{password} -X PUT
返回示例
Status: 200 OK

{
  "group": {
      "id":         234,
      "name":       "Interesting Group",
      ...
   }
}

删除客服组

DELETE /apiv2/groups/{id}.json
调用权限

admin

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