增加
场景描述
调用该接口增加角色。
接口方法
该接口仅支持POST方法,不支持PUT、GET和DELETE等方法。
接口URI
https://ip:port/agentgateway/resource/config/vdn/userclass?userClassId=6
其中,ip为CC-Gateway服务器地址,port为CC-Gateway服务器的HTTPS端口号。
|
序号 |
参数名 |
数据类型 |
选取原则 |
说明 |
|---|---|---|---|---|
|
1 |
userClassId |
number |
False |
角色编号。 取值的类型为整数,取值范围为1~255。 如果为空,则返回CTI分配的编号。 |
日志中的方法名
addUserClass
请求消息
- 消息头
表2 消息头参数说明 序号
名称
参数类型
是否必选
说明
1
Content-Type
string
True
消息主体编码方式,缺省值:application/json; charset=UTF-8
2
Guid
string
True
Guid的取值为C5 智能辅助类接口鉴权方式接口返回的guid。
- 消息体
表3 消息体参数说明 序号
名称
参数类型
是否必选
说明
1
name
string
True
角色名。
最大长度为20字节,不含"[]'&()=;<>,特殊字符。
2
roles
array
True
设置角色权限的数组,数组的每一位对应一个权限位,每一位的取值类型为整数,取值如下:
- 0:表示不具有权限
- 1:表示具有权限
不能为空。
角色权限的数组长度必须为32、64或128。
权限位说明请参见角色权限位说明,同时需要注意关联权限的同步设置。
响应消息
报文样例
- 消息头
Content-Type:application/json; charset=UTF-8 Guid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.AgentGateway1
- 请求参数
{ "name": "TEST11", "roles": [ 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0 ] } - 响应参数
{ "result": { "userClassId": 6 }, "message": "success", "retcode": "0" }