1. 1.子账号是壹耘平台提供给会员管理其客户的账号,会员可以使用子账号的各个功能,轻松地管理每一个独立的客户。
  2. 2.子账号与指定的应用关联,请勿跨应用使用。
  3. 3.您可以使用主账号和子账号调用API,但是子账号不能访问主账号或者其他子账号的资源。

新增子账号

请求URL

  1. POST ${BASE_URL}/management/subaccount

请求参数列表

参数 有效值范围 说明
callbackUrl http url 用于子账号接收平台事件的url,如果为空,事件回调会发给应用的回调url
remark 字符串 备注,例如:备注您的客户的名称
quotas Array 配额数组,默认为空不限制配额
quotas.type 字符串 配额类型,默认不限制配额
quotas.value 整数 默认-1代表无限制

响应参数列表

参数 有效值范围 说明
code 数字文本 状态码,全0表示正确
msg 文本 返回情况说明
data JSON 对象 返回数据对象,参见data对象属性列表

参数详解

data对象属性列表

属性 有效值范围 说明
id UUID 子账号id
certId 字符串 鉴权子账号
secretKey 字符串 鉴权密钥
appId UUID 关联的应用Id
parentId UUID 主账号Id
callbackUrl http url 子账号回调地址,如果为空,事件回调会发给应用的回调url
enabled int 是否启用,默认启用,1启用,0禁用
remark 字符串 备注

示例

请求:

  1. POST ${BASE_URL}/management/subaccount HTTP/1.1
  2. Host: api.yunhuni.com
  3. Content-Type: application/json
  4. Accept-Type: application/json
  5. Content-Length: xxx
  6. {
  7. "callbackUrl":"http://api.yoururl.com/callback",
  8. "remark":"客户1",
  9. "quotas":[
  10. {"type":"CallQuota",value:1000}
  11. ]
  12. }

响应:

  1. HTTP/1.1 200 OK
  2. Content-Type: application/json
  3. Content-Length: xxx
  4. {
  5. "code": "000000",
  6. "msg": "请求成功",
  7. "data": {
  8. "id":"rhreherherhgwgweg1304561",
  9. "certId":"erhehejtrtj",
  10. "secretKey":"gwer4h56e4h1eh",
  11. "appId":"gwegwegwehwherherh",
  12. "parentId":"41586tytymtyrth",
  13. "callbackUrl":"http://api.yoururl.com/callback",
  14. "enabled":1,
  15. "remark":"客户1"
  16. }
  17. }

修改子账号

请求URL

  1. PUT ${BASE_URL}/management/subaccount/{id}

请求参数列表

参数 有效值范围 说明
callbackUrl http url 用于子账号接收平台事件的url,如果为空,事件回调会发给应用的回调url
enabled int 是否启用,默认1,1启用,0禁用,必填
remark 字符串 备注,例如:备注您的客户的名称

响应参数列表

参数 有效值范围 说明
code 数字文本 状态码,全0表示正确
msg 文本 返回情况说明
data JSON 对象 返回数据对象,参见data对象属性列表

参数详解

data对象属性列表

属性 有效值范围 说明
id UUID 子账号id
certId 字符串 鉴权子账号
secretKey 字符串 鉴权密钥
appId UUID 关联的应用Id
parentId UUID 主账号Id
callbackUrl http url 子账号回调地址,如果为空,事件回调会发给应用的回调url
enabled int 是否启用,默认启用,1启用,0禁用
remark 字符串 备注

示例

请求:

  1. PUT ${BASE_URL}/management/subaccount/rhreherherhgwgweg1304561 HTTP/1.1
  2. Host: api.yunhuni.com
  3. Content-Type: application/json
  4. Accept-Type: application/json
  5. Content-Length: xxx
  6. {
  7. "callbackUrl":"http://api.yoururl.com/callback",
  8. "remark":"客户1"
  9. }

响应:

  1. HTTP/1.1 200 OK
  2. Content-Type: application/json
  3. Content-Length: xxx
  4. {
  5. "code": "000000",
  6. "msg": "请求成功",
  7. "data": {
  8. "id":"rhreherherhgwgweg1304561",
  9. "certId":"erhehejtrtj",
  10. "secretKey":"gwer4h56e4h1eh",
  11. "appId":"gwegwegwehwherherh",
  12. "parentId":"41586tytymtyrth",
  13. "callbackUrl":"http://api.yoururl.com/callback",
  14. "enabled":1,
  15. "remark":"客户1"
  16. }
  17. }

删除子账号

请求URL

  1. DELETE ${BASE_URL}/management/subaccount/{id}

响应参数列表

参数 有效值范围 说明
code 数字文本 状态码,全0表示正确
msg 文本 返回情况说明
data boolean 成功true,失败false

示例

请求:

  1. DELETE ${BASE_URL}/management/subaccount/rhreherherhgwgweg1304561 HTTP/1.1
  2. Host: api.yunhuni.com
  3. Content-Type: application/json
  4. Accept-Type: application/json
  5. Content-Length: xxx

响应:

  1. HTTP/1.1 200 OK
  2. Content-Type: application/json
  3. Content-Length: xxx
  4. {
  5. "code": "000000",
  6. "msg": "请求成功",
  7. "data": true
  8. }

子账号查询

  1. 分页查询应用的子账号列表。

请求URL

  1. GET ${BASE_URL}/management/subaccount

请求参数列表

参数 有效值范围 说明
pageNo 正整数 页数,默认1
pageSize 1-1000 每页数据条数,默认10

响应参数列表

参数 有效值范围 说明
code 数字文本 状态码,全0表示正确
msg 文本 返回情况说明
data JSON 对象 返回数据对象,参见data对象属性列表

参数详解

data对象属性列表

属性 有效值范围 说明
pageSize 整数 每页条数
startIndex 整数 当前页第一条数据的索引
totalCount 整数 总条数
totalPageCount 整数 总页数
currentPageNo 整数 当前页
result Array 列表数据
result.id UUID 子账号id
result.certId 字符串 鉴权子账号
result.secretKey 字符串 鉴权密钥
result.appId UUID 关联的应用Id
result.parentId UUID 主账号Id
result.callbackUrl http url 子账号回调地址
result.enabled int 是否启用,默认启用,1启用,0禁用
result.remark 字符串 备注

示例

请求:

  1. GET {BASE_URL}/management/subaccount?pageNo=1&pageSize=10 HTTP/1.1
  2. Host: api.yunhuni.com
  3. Content-Type: application/json
  4. Accept-Type: application/json
  5. Content-Length: xxx

响应:

  1. HTTP/1.1 200 OK
  2. Content-Type: application/json
  3. Content-Length: xxx
  4. {
  5. "code": "000000",
  6. "msg": "请求成功",
  7. "data": {
  8. "pageSize": 10,
  9. "startIndex": 1,
  10. "totalCount": 1,
  11. "totalPageCount": 1,
  12. "currentPageNo": 1,
  13. "result": [
  14. {
  15. "id":"rhreherherhgwgweg1304561",
  16. "certId":"erhehejtrtj",
  17. "secretKey":"gwer4h56e4h1eh",
  18. "appId":"gwegwegwehwherherh",
  19. "parentId":"41586tytymtyrth",
  20. "callbackUrl":"http://api.yoururl.com/callback",
  21. "enabled":1,
  22. "remark":"客户1"
  23. }
  24. ]
  25. }
  26. }
  27. }

子账号详情

  1. 查询子账号详情,包括子账号配额。

请求URL

  1. GET ${BASE_URL}/management/subaccount/{id}

请求参数列表

参数 有效值范围 说明
id UUID 必填

响应参数列表

参数 有效值范围 说明
code 数字文本 状态码,全0表示正确
msg 文本 返回情况说明
data JSON 对象 返回数据对象,参见data对象属性列表

参数详解

data对象属性列表

属性 有效值范围 说明
id UUID 子账号id
certId 字符串 鉴权子账号
secretKey 字符串 鉴权密钥
appId UUID 关联的应用Id
parentId UUID 主账号Id
callbackUrl http url 子账号回调地址
enabled int 是否启用,默认启用,1启用,0禁用
remark 字符串 备注
quotas Array 配额数组,默认为空不限制配额
quotas.type 字符串 配额类型,默认不限制配额
quotas.value 整数 默认-1代表无限制

示例

请求:

  1. GET {BASE_URL}/management/subaccount/egwgwegweg11123 HTTP/1.1
  2. Host: api.yunhuni.com
  3. Content-Type: application/json
  4. Accept-Type: application/json
  5. Content-Length: xxx

响应:

  1. HTTP/1.1 200 OK
  2. Content-Type: application/json
  3. Content-Length: xxx
  4. {
  5. "code": "000000",
  6. "msg": "请求成功",
  7. "data": {
  8. "id":"rhreherherhgwgweg1304561",
  9. "certId":"erhehejtrtj",
  10. "secretKey":"gwer4h56e4h1eh",
  11. "appId":"gwegwegwehwherherh",
  12. "parentId":"41586tytymtyrth",
  13. "callbackUrl":"http://api.yoururl.com/callback",
  14. "enabled":1,
  15. "remark":"客户1",
  16. "quotas":[
  17. {
  18. "type":"CallQuota",
  19. "value":1111
  20. }
  21. ]
  22. }
  23. }
  24. }

设置子账号配额

  1. `配额是会员提供给其客户使用服务的额度`

请求URL

  1. PUT ${BASE_URL}/management/subaccount/{id}/quotas

请求参数列表

参数 有效值范围 说明
quotas Array 配额数组,必填
quotas.type 字符串 配额类型,必填
quotas.value 整数 默认-1代表无限制

示例

  1. {
  2. "quotas":[
  3. {"type":"AgentQuota",value:1000}
  4. ]
  5. }

响应参数列表

参数 有效值范围 说明
code 数字文本 状态码,全0表示正确
msg 文本 返回情况说明
data boolean 成功true,失败false

示例

请求:

  1. PUT ${BASE_URL}/management/subaccount/rhreherherhgwgweg1304561/quotas HTTP/1.1
  2. Host: api.yunhuni.com
  3. Content-Type: application/json
  4. Accept-Type: application/json
  5. Content-Length: xxx
  6. {
  7. "quotas":[
  8. {"type":"AgentQuota",value:1000}
  9. ]
  10. }

响应:

  1. HTTP/1.1 200 OK
  2. Content-Type: application/json
  3. Content-Length: xxx
  4. {
  5. "code": "000000",
  6. "msg": "请求成功",
  7. "data": true
  8. }

子账号配额类型

名称 说明
CallQuota 通话时长配额,单位:分钟
AgentQuota 呼叫中心坐席配额,单位:个