帮我吧文档:数据接口:客服:客服组

客服分组接口


JSON格式

名称 类型 只读 必填 注释
sgId int 客服分组ID,系统自动生成
url varchar 该客服分组的资源url
sgName varchar 客服分组名称

JSON示例

{
     "sgId": 1,
     "url": "https://www.bangwo8.com/api/v1/supportgroups/1.json",
     "sgName": "北京办"
}

获取客服分组列表

GET /api/v1/supportgroups.json

调用者权限

管理员

调用示例

curl https://www.bangwo8.com/api/v1/supportgroups.json \
  -v -u {account}:{password}

返回值示例

Status: 200 OK

{
	"supportgroups": [
		{
			"sgId": 1,
			"sgName": "北京办"
		},
		{
			"sgId": 2,
			"sgName": "上海办"
		}
	]
}

查看指定客服分组信息

GET /api/v1/supportgroups/{id}.json

调用者权限

管理员

调用示例

curl https://www.bangwo8.com/api/v1/supportgroups/{id}.json \
  -v -u {account}:{password}

返回值示例

Status: 200 OK

{
  "supportgroup": {
    "sgId":   1,
    "sgName": "北京办"
  }
}

获取多个客服分组信息

GET /api/v1/supportgroups/show_many.json?ids={ids}

调用者权限

管理员

调用示例

curl https://www.bangwo8.com/api/v1/supportgroups/show_many.json?ids=1,2,3 \
  -v -u {account}:{password}

返回值示例

Status: 200 OK

{
  "supportgroups": [
    {
      "sgId": 1,
      "sgName": "北京办"
    },
    {
      "sgId": 2,
      "sgName": "上海办"
    }
  ]
}

创建客服分组

POST /api/v1/supportgroups.json

调用者权限

管理员

调用示例

curl -v -u {account}:{password} https://www.bangwo8.com/api/v1/supportgroups.json \
  -H "Content-Type: application/json" -X POST -d '{"supportgroup": {"sgName": "北京办"}}'

说明:创建客服分组时,cgName必填。

返回值示例

Status: 200 OK
Location: https://www.bangwo8.com/api/v1/supportgroups/{id}.json

{
  "supportgroup": {
    "sgId":   1,
    "sgName": "北京办"
  }
}

修改客服分组信息

PUT /api/v1/supportgroups/{id}.json

调用者权限

管理员

调用示例

curl -v -u {account}:{password} https://www.bangwo8.com/api/v1/supportgroups/123.json \
  -H "Content-Type: application/json" -X PUT -d '{"supportgroup": {"sgName": "上海办"}}'

返回值示例

Status: 200 OK

{
  "supportgroup": {
    "sgId":   1,
    "sgName": "北京办"
  }
}

页面工具