Callcenter API

坐席/队列业务类 REST API 接口使用说明

坐席管理

在 XSwitch 中,坐席跟用户使用同一条记录,坐席就是typeAGENT的用户。如果用户已存在,可以直接将用户的type改为AGENT即可,否则,创建一个座席等于创建一个用户。

特别注意

所有涉及密码的接口数据请自行修改为复杂密码,防止因为密码过于简单导致系统被攻击。

创建坐席所需信息说明如下:

参数说明
name名称,如张三,李四
login坐席工号,登录名
extn坐席对应的分机号
password坐席密码
extn_password分机密码,如空则与坐席密码相同
domain域名,默认为 xswitch.cn
context呼叫源,默认为 default
agent_info坐席其他参数信息
type类似,必须为AGENT

其它参数可以参见用户属性。

坐席参数 agent_info 对应值说明如下:

参数说明
hardware_phone_onlytrue/false,是否仅用于硬件话机,用于区分无界面呼叫中心
timeout呼叫坐席时的超时时间,单位为秒
simo并发通话数
lag延迟,接完一个电话后多长时间可以再接下一个电话
member_wait等待
max_no_answer最大无应答失败次数,超过该次数后不再对该坐席分配电话
warp_up_time接完一个电话后,再次进入队列等待时间
reject_delay_time拒接一个电话后,下次分配电话前的等待时间,默认为 n
busy_delay_time如果座席电话忙,下次分配电话前的等待时间,默认为 n
type坐席类型,callback|standBy,默认为callback
level等级
position位置
status状态 Out|Available|Available(On Demand)|On Break
token用户 Token,放在 HTTP 请求时的 Header 上

创建坐席

  • 请求 URL/api/users
  • 请求方式POST
  • 消息头Content-Type: application/json
  • Body 信息: 参见用户信息说明
  • 返回值: 座席 id id,分机 id extn_id

请求 Body:

{
  "name": "小樱桃",
  "login": "1234",
  "extn": "X1234!@#$",
  "password": "$VeryGoodPassw0rd",
  "extn_password": "$VeryGoodPassw0rd",
  "context": "context-1",
  "domain": "xswitch.cn",
  "type": "AGENT"
}

创建坐席时能传agent_info值,系统已默认自动加入agent_info的内置参数,默认如下,如需修改坐席agent_info需要调用PUT请求进行修改(详情参考修改某个坐席接口):

{
  "lag": "2",
  "simo": "1",
  "status": "On Break",
  "agent_type": "callback",
  "member_wait": "nowait",
  "wrap_up_time": "10",
  "max_no_answer": "3",
  "busy_delay_time": "60",
  "reject_delay_time": "10"
}

curl示例:

curl -XPOST -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" \
-H "Content-Type: application/json" \
-d '{"name":"小樱桃","login":"1234","password":"$VeryGoodPassw0rd","extn":"1234","extn_password":"$VeryGoodPassw0rd","context":"context-1","domain":"192.168.1.100","type":"AGENT"}' \
"192.168.1.100:8081/api/users"

返回值:

{
  "code": 200,
  "message": "success",
  "data": {
    "id": "32",
    "extn_id": "32"
  }
}

查询坐席

  • 请求 URL/api/users/$id 返回指定 ID 的坐席
  • 请求 URL/api/users 返回所有坐席
  • 请求方式GET
  • 返回值: 用户对象,如果找不到会返回 HTTP 状态码404
返回值结果
JSON 字符串成功
404失败

curl示例:

curl -H "X-XTRA-AUTH-ID:850a23ad-786e-467d-bce1-7067ddaa14b2" "192.168.0.122:8081/api/users/37"
  • 示例
GET /api/users/1

返回:

{
  "reject_delay_time": "10",
  "status": "On Break",
  "wrap_up_time": "10",
  "is_super": 0,
  "agent_type": "callback",
  "id": 37,
  "tel": "",
  "extn": "1006",
  "last_login_at": "",
  "login": "1006",
  "no_answer_delay_time": "30",
  "context": "context-1",
  "deleted_at": "",
  "name": "yxbtest",
  "ha1": "a18a5aaa9a668a1afc0dd6d7369fb06d",
  "max_no_answer": "3",
  "updated_at": "2022-10-25 20:23:07",
  "member_wait": "nowait",
  "email": "",
  "type": "AGENT",
  "simo": "1",
  "cid_name": "",
  "tel_enabled": 0,
  "busy_delay_time": "10",
  "auto_record": 0,
  "extn_id": 0,
  "lag": "2",
  "ha1b": "e06541327cc66ec5de190e4a7cbc42e3",
  "vm_password": "",
  "domain": "192.168.0.122",
  "cid_number": "",
  "created_at": "2022-10-25 20:23:07"
}
GET /api/users

返回:

{
  "data": [
    {
      "login": "system",
      "context": "",
      "ha1": "",
      "email": "",
      "auto_record": 0,
      "cid_name": "",
      "extn": "",
      "type": "",
      "updated_at": "2022-05-13 15:08:38",
      "deleted_at": "",
      "extn_id": 0,
      "cid_number": "",
      "created_at": "2022-05-13 15:08:37",
      "vm_password": "",
      "last_login_at": "",
      "is_super": 0,
      "tel_enabled": 0,
      "domain": "demo.xswitch.cn",
      "id": 0,
      "ha1b": "",
      "name": "SYSTEM",
      "tel": ""
    },
    {
      "login": "admin",
      "context": "context-1",
      "ha1": "fd4500fcb6ccd4ee87d5debac892ac59",
      "email": "",
      "auto_record": 0,
      "cid_name": "",
      "extn": "admin",
      "type": "",
      "updated_at": "2022-05-13 16:36:31",
      "deleted_at": "",
      "extn_id": 0,
      "cid_number": "",
      "created_at": "2022-05-13 15:08:37",
      "vm_password": "",
      "last_login_at": "2022-05-13 16:36:31",
      "is_super": 1,
      "tel_enabled": 0,
      "domain": "demo.xswitch.cn",
      "id": 1,
      "ha1b": "747e17632f2443bfdbef0113eba4a266",
      "name": "Admin",
      "tel": ""
    }
  ],
  "page": 1,
  "rowCount": 2,
  "pageCount": 1
}

查询坐席下的分机

  • 请求 URL/api/users/$id/extensions返回指定 ID 的坐席下的分机信息
  • 请求方式GET
  • 返回值: 用户对象,如果找不到会返回空
返回值结果
json 字符串成功
没有分机
  • curl 示例
curl -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" "192.168.1.100:8081/api/users/2/extensions"
  • 示例

GET /api/users/2/extensions

返回:

[
  {
    "auto_record": 0,
    "group_name": "",
    "cid_name": "",
    "call_transfer_type": 0,
    "force_breakdown": 1,
    "updated_at": "2022-05-13 17:31:55",
    "user_id": 32,
    "timeout": "",
    "domain": "demo.xswitch.cn",
    "forced_insert": 1,
    "id": 32,
    "vm_password": "",
    "eavesdropped": 1,
    "ringback": "",
    "context": "default",
    "ha1b": "31dafaedb546e6b421ac0fecbf497ebb",
    "force_insert": 1,
    "sync_enabled": 0,
    "ha1": "8cf122325404fe1ce0f33b055aa7f926",
    "display_order": "0",
    "called_limit": 1,
    "call_authority": 4,
    "priority": "99",
    "deleted_at": "",
    "created_at": "2022-05-13 17:31:55",
    "weblogin_disabled": 0,
    "codec": "",
    "intercepted_group_name": "",
    "intercepted": 2,
    "name": "220000",
    "forced_breakdown": 1,
    "description": "",
    "connect_phone": "",
    "extn": "220000",
    "type": "SIP",
    "extn_cidr": "",
    "password": "$VeryGoodPassw0rd",
    "enable_ringback": 0,
    "disabled": 0,
    "call_limit": 1,
    "voicemail": 0,
    "intercept": 2,
    "eavesdrop": 1,
    "cid_number": ""
  }
]

查询坐席下的队列

  • 请求 URL/api/users/$id/queue/name返回指定 ID 的坐席下的队列信息

  • 请求方式GET

  • 返回值: 用户对象,如果找不到会返回空

  • curl 示例

curl -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" "192.168.1.100:8081/api/users/2/queue/name"
  • 示例

GET /api/users/2/queue/name

坐席绑定了队列时返回:

[
  {
    "name": "queue1"
  },
  {
    "name": "queue2"
  }
]

坐席没有绑定队列时返回:

[]

修改某个坐席

  • 请求 URL/api/users/$id
  • 请求方式PUT
  • 消息头Content-Type: application/json
  • Body 信息: 参见用户信息说明
  • 返回值: 对象,包含被修改的用户的 ID,如: {"id": "3"}
  • 示例:
PUT http://192.168.1.100:8081/api/users/3

Body:

{
  "auto_record": "0",
  "context": "default",
  "domain": "xswitch.cn",
  "hardware_phone_only": "false",
  "name": "zhangsan",
  "vm_password": "5555",
  "lag": "2",
  "simo": "1",
  "status": "On Break",
  "agent_type": "callback",
  "member_wait": "nowait",
  "wrap_up_time": "10",
  "max_no_answer": "30",
  "busy_delay_time": "60",
  "reject_delay_time": "10"
}
  • curl 示例
curl -XPUT -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" \
-H "Content-Type: application/json" \
-d '{"auto_record":"0","context":"default","domain":"xswitch.cn","hardware_phone_only":"false","login":"20000","name":"lisi","vm_password":"5555","lag": "2",    "simo": "1","status": "On Break","agent_type": "callback","member_wait": "nowait","wrap_up_time": "10","max_no_answer": "30","busy_delay_time": "60","reject_delay_time": "10"}' \
192.168.1.100:8081/api/users/3

返回:

{
  "data": "3",
  "code": 200,
  "message": "success"
}
  • 其他说明:

如果在请求参数中包含用户的 ID,则会被忽略。

修改密码

  • 请求 URL/api/users/change_password
  • 请求方式PUT
  • 消息头Content-Type: application/json
  • Body 信息: 参见用户信息说明
  • 返回值status 200 OK
  • 示例
PUT http://192.168.1.100:8081/api/users/change_password

Body:

{
  "old_password": "$VeryGoodPassw0rd",
  "password": "$VeryGoodPassw0rd-MoreComplex",
  "id": "183"
}
  • curl 示例
curl -XPUT -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" \
-H "Content-Type: application/json" \
-d '{"id":"183","old_password": "X1234!@#$","password":"$VeryGoodPassw0rd"}' \
"192.168.1.100:8081/api/users/change_password"

返回:

{
  "data": "{}",
  "code": 200,
  "message": "success"
}

删除坐席

  • 请求 URL/api/users/$id
  • 请求方式DELETE
  • 消息头: 无
  • 返回值: 对象,包含被删除用户的 ID,如 {"id": "3"}
  • 示例
DELETE http://192.168.1.100:8081/api/users/3
  • curl 示例
curl -0 -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -XDELETE "192.168.1.100:8081/api/users/3"

返回:

{
  "code": 200,
  "message": "success",
  "data": "3"
}

队列

队列信息说明如下:

参数说明
name名字
description描述
moh_sound进入队列等待音
strategy策略
template创建模板
type种类(callcenter 或 fifo)
greeting欢迎音

队列参数信息说明如下:

参数说明
realm域(CC 或 FIFO)
k扩展参数名称
v扩展参数值
ref_id关联 id
disabled是否启用。默认值为 0,0 为启用,1 为不启用

队列策略参数值中英文信息说明:

策略英文中文说明
ring-all所有坐席振铃
longest-idle-agent空闲时长最长振铃
top-down顺序振铃
agent-with-least-talk-time通话时长最小振铃
agent-with-fewest-calls接听最少振铃
sequentially-by-agent-order优先级振铃
round-robin轮循振铃
random随机
ring-progressively顺序振铃,之前已接听的坐席优先分配原客户

队列扩展参数值中英文信息说明(所有参数值均为VARCHAR,个别填写参考如下):

CC 扩展参数英文中文说明
announce-sound播报声音文件string
announce-frequency播报间隔时间string
announce-agent-answer播报工号true/false
announce-position播报位置string
retain-agent最小空闲坐席数string
wait-timeout最大等待时间string
wait-timeout-without-agent无坐席最大等待时间string
wait-timeout-without-agent-time-reached无坐席额外等待时间string
overflow-capacity-action排队溢出操作挂断{"action":"hangup"}或转接{"action":"transfer","data":"1001"}
wait-timeout-without-agent-action无坐席超时操作挂断{"action":"hangup"}或转接{"action":"transfer","data":"1001"}
wait-timeout-action超时操作挂断{"action":"hangup"}或转接{"action":"transfer","data":"1001"}
tier-rules-apply应用阶层规则string
tier-rule-wait-second进入下一阶层等待时长string
tier-rule-wait-multiply-level阶层等待倍增等级string
tier-rule-no-agent-no-wait无坐席无等待阶层规则string
abandoned-resume-allowed是否放弃之前等待时间string
discard-abandoned-after删除之前等待时间string
time-base-score时间基准分数string
capacity容量string
agent-timeout坐席超时时间string
FIFO 扩展参数英文中文说明
importance重要等级int
outbound_per_cycle坐席群振数量int
outbound_per_cycle_min坐席最小群振数量int
outbound_priority优先级int
outbound_name外呼显示名int
retry_delay重拨延时int
outbound_ring_timeout响铃时间int
outbound_default_lag默认延迟int

获取已存在队列

  • 请求 URL/api/queues
  • 请求方式GET
  • Body 信息:无
  • curl 示例
curl -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" 192.168.1.100:8081/api/queues
  • 返回值:返回现有全部队列的信息。内容参考队列信息说明。
{
	"page": 1,
	"pageCount": 1,
	"data": [
        {
            "outbound_default_lag": "30",
            "description": "",
            "id": "1",
            "load_url": "",
            "deleted_at": "",
            "strategy": "ringall",
            "created_at": "2023-03-03 09:07:08",
            "outbound_per_cycle": "1",
            "load_url_params": "{}",
            "outbound_per_cycle_min": "1",
            "importance": "0",
            "outbound_ring_timeout": "60",
            "outbound_priority": "5",
            "cti_template": "fifo",
            "greeting": "",
            "auto_record": "0",
            "moh_sound": {
                "media_path": "phrase:welcome@xui",
                "media_type": "SYSTEM",
                "media_id": "204"
            },
            "updated_at": "2023-03-03 09:07:08",
            "name": "FIFO1"
        },
		...
	],
	"rowCount": 1
}

查看某条队列的详细信息

  • 请求 URL/api/queues/$id
  • 请求方式GET
  • Body 信息:无
  • curl 示例
curl -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" "192.168.1.100:8081/api/queues/1"
  • 返回值:返回指定某条队列的详细信息。内容参考队列信息说明。
{
  "outbound_ring_timeout": "60",
  "load_url": "",
  "id": 1,
  "strategy": "ringall",
  "outbound_priority": "5",
  "outbound_per_cycle": "1",
  "outbound_default_lag": "30",
  "auto_record": 0,
  "created_at": "2023-03-03 09:07:08",
  "moh_sound": {
    "media_id": "204",
    "media_path": "phrase:welcome@xui",
    "media_type": "SYSTEM"
  },
  "deleted_at": "",
  "outbound_per_cycle_min": "1",
  "description": "",
  "load_url_params": "{}",
  "updated_at": "2023-03-03 09:07:08",
  "importance": "0",
  "cti_template": "fifo",
  "greeting": "",
  "name": "FIFO1"
}

查看某条队列下的坐席

  • 请求 URL/api/queues/$id/agents
  • 请求方式GET
  • Body 信息:无
  • curl 示例
curl -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" "192.168.1.100:8081/api/queues/4/agents"
  • 返回值:返回指定队列中坐席的信息。
{
  "rowCount": 1,
  "data": [
    {
      "created_at": "2023-03-03 09:07:19",
      "queue_name": "FIFO1",
      "level": "1",
      "position": "1",
      "external_queue_id": "",
      "extn": "1020",
      "external_agent_id": "",
      "disabled": "0",
      "name": "1020",
      "domain": "xswitch.cn",
      "deleted_at": "",
      "agent_name_md5": "65cc2c8205a05d7379fa3a6386f710e1",
      "updated_at": "2023-03-03 09:07:20",
      "description": "",
      "agent_name": "1020",
      "agent_id": "22",
      "queue_id": "1",
      "id": "1"
    }
  ],
  "page": 1,
  "pageCount": 1
}

查看某条队列的扩展参数

  • 请求 URL/api/queues/$id/extra_params
  • 请求方式GET
  • Body 信息:无
  • curl 示例
curl -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" "192.168.1.100:8081/api/queues/1/extra_params"
  • 返回值:返回指定队列中全部扩展参数信息。参考队列扩展参数值中英文信息说明。
[
    {
        "v": "0",
        "k": "importance",
        "deleted_at": "",
        "ref_id": 1,
        "disabled": 0,
        "created_at": "2023-03-03 09:07:08",
        "id": 17,
        "updated_at": "2023-03-03 09:07:08",
        "realm": "FIFO"
    },
    {
        "v": "1",
        "k": "outbound_per_cycle_min",
        "deleted_at": "",
        "ref_id": 1,
        "disabled": 0,
        "created_at": "2023-03-03 09:07:08",
        "id": 18,
        "updated_at": "2023-03-03 09:07:08",
        "realm": "FIFO"
    },
    ...
]

新增队列

  • 请求 URL/api/queues
  • 请求方式POST
  • 消息头Content-Type: application/json
  • Body 信息: 参见队列信息说明
  • 实例 Body:
{
  "auto_record": "1",
  "description": "test",
  "moh_sound": 411,
  "name": "test2",
  "strategy": "agent-with-fewest-calls",
  "template": "default",
  "cti_template": "callcenter",
  "type": "callcenter"
}

返回:

{
  "code": 200,
  "data": "2",
  "message": "success"
}
  • curl 示例
curl -H "X-XTRA-AUTH-ID: 69ee9c54-734b-11e7-a262-b5df20245f60" \
-d '{"auto_record": "1", "description": "test", "moh_sound": 411, "name": "test2", "strategy": "agent-with-fewest-calls", "template": "default", "cti_template": "callcenter", "type": "callcenter"}' \
-H "Content-Type: application/json" "http://192.168.1.100:8081/api/queues"

队列中添加坐席

  • 请求 URL/api/queues/$id/agents
  • 请求方式POST
  • 消息头Content-Type: application/json
  • Body 信息
参数说明
agent_id坐席 ID
agent_name坐席名称
  • 实例 Body:
{
  "agents": [
    {
      "agent_id": "24",
      "agent_name": "1022"
    },
    {
      "agent_id": "25",
      "agent_name": "1023"
    }
  ]
}

返回:

{
  "data": [
    {
      "updated_at": "2022-05-16 09:00:00",
      "deleted_at": "",
      "queue_id": 2,
      "position": 1,
      "agent_id": 24,
      "disabled": 1,
      "external_queue_id": "",
      "domain": "",
      "extn": "1022",
      "level": 1,
      "external_agent_id": "",
      "queue_name": "ewrw",
      "description": "",
      "created_at": "2022-05-16 09:00:00",
      "id": 4,
      "agent_name": "1022"
    },
    {
      "updated_at": "2022-05-16 09:00:00",
      "deleted_at": "",
      "queue_id": 2,
      "position": 1,
      "agent_id": 25,
      "disabled": 1,
      "external_queue_id": "",
      "domain": "",
      "extn": "1023",
      "level": 1,
      "external_agent_id": "",
      "queue_name": "ewrw",
      "description": "",
      "created_at": "2022-05-16 09:00:00",
      "id": 5,
      "agent_name": "1023"
    }
  ],
  "message": "success",
  "code": 200
}
  • curl 示例
curl -H "X-XTRA-AUTH-ID: 69ee9c54-734b-11e7-a262-b5df20245f60" \
-d '{"agents":[{"agent_id":"24", "agent_name": "1022"},{ "agent_id":"25", "agent_name": "1023"}]}' \
-H "Content-Type: application/json" "http://192.168.1.100:8081/api/queues/2/agents"

查看所有扩展参数信息

  • 请求 URL1/api/dicts/realm/QUEUE_CC_PARAM 查询 CC 参数
  • 请求 URL2/api/dicts/realm/QUEUE_FIFO_PARAM 查询 FIFO 参数
  • 请求方式GET
  • Body 信息:无
  • curl 示例
// 查询CC参数 :
curl -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" "192.168.1.100:8081/api/dicts/realm/QUEUE_CC_PARAM"
// 查询FIFO参数 :
curl -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" "192.168.1.100:8081/api/dicts/realm/QUEUE_FIFO_PARAM"
  • 返回值:正常返回所有扩展参数信息。
// 查询CC参数 :
[
	{
		"d": "",
		"v": "announce-position",
		"o": "0",
		"k": "Announce Position",
		"id": "464",
		"deleted_at": "",
		"realm": "QUEUE_CC_PARAM",
		"created_at": "2022-05-13 15:08:36",
		"updated_at": "2022-05-13 15:08:36"
	},
	...
]

// 查询FIFO参数 :
[
    {
        "d": "",
        "v": "importance",
        "created_at": "2023-03-03 02:46:42",
        "k": "Importance",
        "o": "0",
        "realm": "QUEUE_FIFO_PARAM",
        "deleted_at": "",
        "id": "501",
        "updated_at": "2023-03-03 02:46:42"
    },
    ...
]

新增指定队列的指定扩展参数

  • 请求 URL/api/queues/$id/extra_params
  • 请求方式POST
  • 消息头Content-Type: application/json
  • Body 信息
字段必选类型备注
kstring参数名称,如需新增指定扩展参数,请从上面查询出的所有扩展参数内进行选择添加。
vstring参数值
realmstringrealm 类型,callcenter 为"CC", fifo 为"FIFO"
  • 实例一

Body:

{
  "realm": "CC",
  "k": "announce-sound",
  "v": "1"
}
  • 实例二

Body:

{
  "realm": "CC",
  "k": "overflow-capacity-action",
  "v": "{\"action\":\"transfer\",\"data\":\"1009\"}"
}
  • 实例三

Body:

{
  "realm": "FIFO",
  "k": "importance",
  "v": 0
}
  • 返回值:参数 ID
{
  "data": 114,
  "code": 200,
  "message": "success"
}
  • curl 示例
curl -H "X-XTRA-AUTH-ID: 69ee9c54-734b-11e7-a262-b5df20245f60" \
-d '{"realm": "CC", "k": "announce-sound", "v": "1" }' \
-H "Content-Type: application/json" "http://192.168.1.100:8081/api/queues/2/extra_params"

修改指定队列信息

  • 请求 URL/api/queues/$id
  • 请求方式PUT
  • 消息头Content-Type: application/json
  • Body 信息: 参见队列信息说明
  • 实例 : Body:
{
  "auto_record": "1",
  "description": "test",
  "greeting": "{\"media_path\":\"phrase:welcome@xui\"}",
  "moh_sound": "{\"media_path\":\"phrase:welcome@xui\"}",
  "strategy": "longest-idle-agent"
}

返回 :

{
  "code": 200,
  "message": "success",
  "data": "1"
}
  • curl 示例
curl -XPUT -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" \
-H "Content-Type: application/json" \
-d '{ "auto_record": "1", "description": "test", "greeting": "{\"media_path\":\"phrase:welcome@xui\"}", "moh_sound": "{\"media_path\":\"phrase:welcome@xui\"}", "strategy": "longest-idle-agent"}' \
"192.168.1.100:8081/api/queues/1"

修改指定队列的扩展参数

  • 请求 URL/api/queues/$id/extra_params/$extra_params

    请求参数说明
    :id队列 id
    :extra_params扩展参数 id
  • 请求方式PUT

  • 消息头Content-Type: application/json

  • Body 信息: 参见队列扩展参数信息说明

  • 实例一 :

Body :

{
  "v": "600",
  "k": "discard-abandoned-after"
}
  • 实例二 :

Body :

{
  "v": "true",
  "k": "abandoned-resume-allowed"
}
  • curl 示例
curl -XPUT -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" \
-H "Content-Type: application/json" \
-d '{"v":"true","k":"abandoned-resume-allowed"}' \
"http://192.168.1.100:8081/api/queues/39/extra_params/100"

返回 :

{
  "message": "success",
  "data": "39",
  "code": 200
}

开启/关闭指定队列指定扩展参数

  • 请求 URL/api/queues/$id/extra_params/$extra_params

    请求参数说明
    :id队列 id
    :extra_params扩展参数 id
  • 请求方式PUT

  • 消息头Content-Type: application/json

  • Body 信息

    参数说明
    action变更启用状态,固定为"toggle"
  • 实例 : Body :

{
  "action": "toggle"
}
  • curl 示例
curl -XPUT -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" \
-H "Content-Type: application/json" \
-d '{"action": "toggle"}' \
"http://192.168.1.100:8081/api/queues/2/extra_params/28"

返回 :

{
  "code": 200,
  "message": "success",
  "data": "28"
}

删除指定队列

  • 请求 URL/api/queues/$id
  • 请求方式DELETE
  • 消息头:无
  • curl 示例
curl -0 -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -XDELETE 192.168.1.100:8081/api/queues/2
  • 返回(示例)
{
  "code": 200,
  "data": "2",
  "message": "success"
}

删除指定队列的指定扩展参数

  • 请求 URL/api/queues/$id/extra_params/$extra_params
  • 请求方式DELETE
  • 消息头:无
  • curl 示例
curl -0 -H "X-XTRA-AUTH-ID: 62dd0173-4916-4b1c-b958-546e4d7c91fe" -XDELETE 192.168.1.100:8081/api/queues/39/extra_params/100
  • 返回(示例)
{
  "code": 200,
  "message": "success",
  "data": "39"
}
HTTP接口说明