Organizations 公司组织接口
JSON 格式
Name | Type | Read-only | Comment |
---|---|---|---|
id | integer | yes | 公司组织id,由系统自动分配 |
url | string | yes | 资源url |
name | string | no | 组织名称 |
domain | string | no | 域名后缀,格式为{domain}.com。创建用户时, 用户邮箱若匹配上domain字段,则自动加入组织 |
description | string | no | 组织描述 |
group_id | integer | no | 分配公司组织的工单给指定客服组 |
created_at | date | yes | 组织创建时间 |
JSON 示例
{
"id": 741,
"url": "https://support.kf5.com/apiv2/organizations/741.json",
"name": "销售部门",
"created_at": "2014-12-22 16:54:31",
"domain": "kf5sale.com",
"description": "",
"group_id": 156
}
公司组织列表
GET /apiv2/organizations.json
Query参数
Name | Required | Type | Comment |
---|---|---|---|
created_start | 否 | string | 按创建时间筛选,开始时间 |
created_end | 否 | string | 按创建时间筛选,结束时间 |
updated_start | 否 | string | 按更新时间筛选,开始时间 |
updated_end | 否 | string | 按更新时间筛选,结束时间 |
created_order | 否 | string | 按创建时间排序,可选值:asc、desc |
updated_order | 否 | string | 按更新时间排序,可选值:asc、desc |
备注:按创建和更新时间进行筛选的参数 created_start、created_end、updated_start、updated_end,支持日期格式(如 2016-01-01 00:00:00)和时间戳(秒级别的整型)。 |
调用权限
agents
curl 示例
curl https://{subdomain}.kf5.com/apiv2/organizations.json \
-v -u {email_address}:{password}
返回示例
Status: 200 OK
{
"organizations": [
{
"id": 2014,
"name": "One Organization",
...
},
{
"id": 2015,
"name": "Other Organization",
...
}
]
}
查看公司组织
GET /apiv2/organizations/{id}.json
调用权限
agents
curl 示例
curl https://{subdomain}.kf5.com/apiv2/organizations.json \
-v -u {email_address}:{password}
返回示例
Status: 200 OK
{
"organization": {
"id": 2014,
"name": "One Organization",
...
}
}
创建公司组织
POST /apiv2/organizations.json
调用权限
admin
curl 示例
curl https://{subdomain}.kf5.com/apiv2/organizations.json \
-H "Content-Type: application/json" -d '{"organization": {"name": "My Organization"}}' \
-v -u {email_address}:{password}
返回示例
Status: 200 OK
{
"organization": {
"id": 1234,
"name": "My Organization",
...
}
}
修改公司组织
PUT /apiv2/organizations/{id}.json
调用权限
admin
curl 示例
curl https://{subdomain}.kf5.com/apiv2/organizations/{id}.json \
-H "Content-Type: application/json" -d '{"organization": {"description": "Something interesting"}}' \
-v -u {email_address}:{password} -X PUT
返回示例
Status: 200 OK
{
"organization": {
"id": 2014,
"name": "One Organization",
...
}
}
删除公司组织
DELETE /apiv2/organizations/{id}.json
调用权限
admin
curl 示例
curl https://{subdomain}.kf5.com/apiv2/organizations/{id}.json \
-v -u {email_address}:{password} -X DELETE
返回示例
Status: 200 OK