查询排班中值班人员信息¶
通过以下步骤查询排班中值班人相关信息
请求参数(任选其一即可)¶
| 参数 | 类型 | 是否必须 | 说明 |
|---|---|---|---|
| time | long | 必须 | 时间戳,精确到秒 |
| schdId | string | 可选 | 排班id(不传时返回所有排班信息) |
| 参数 | 类型 | 是否必须 | 说明 |
|---|---|---|---|
| startTime | long | 必须 | 时间戳,精确到秒(开始时间) |
| endTime | long | 必须 | 时间戳,精确到秒(结束时间) |
| schdId | string | 可选 | 排班id(不传时返回所有排班信息) |
示例¶
请求cURl(任选其一即可):
curl --location --request POST 'https://caweb.aiops.com/api/alert/rest/api/v1/schds/users' \
--user 'email@example.com:<access_token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"time":1659336179,
"schdId":"xxxxxxxxxxxxxxxx"
}'
或:
curl --location --request POST 'https://caweb.aiops.com/api/alert/rest/api/v1/schds/users' \
--user 'email@example.com:<access_token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"startTime":1663084800,
"endTime":1663171200,
"schdId":"xxxxxxxxxxxxxxxx"
}'
access_token如何获取请参考文档 api令牌
提示
• 示例邮箱应替换为用户注册所用邮箱
• access_token应替换为您手动获取的access_token
• 如需对请求进行加密处理:请将
--user 'email@example.com:access_token' \
--header 'Accept: application/json'
替换为:
--header 'Authorization: Basic Z2FveWluaW5nOTk5NUAxNjMuY29tOmt1WWl6bmljZ3oxN0JBVjk=' \
--header 'Content-Type: application/json'
• 替换步骤请参考加密步骤
返回参数¶
| 参数 | 类型 | 说明 |
|---|---|---|
| start_time | string | 开始时间 |
| end_time | string | 结束时间 |
| type | string | 类型:user 用户,group 小组,chatops 协作 |
| user | string | 用户id/组id/协作id |
| code | int | 响应码 |
响应报文¶
{
"result":"success",
"message":"ok",
"data":[
{
"start_time":"2022-08-01 08:00:00",
"end_time":"2022-08-01 08:00:00",
"type":"chatops",
"user":"xxxxxxxx"
},
{
"start_time":"2022-08-01 12:00:00",
"end_time":"2022-08-01 12:00:00",
"type":"group",
"user":"xxxxxxxxx"
}
],
"totalCount":2,
"code":200
}
错误响应码¶
| 错误码 | 说明 |
|---|---|
| 200 | 成功 |
| 400 | 失败,传入的参数有问题 |
| 401 | 认证失败,用户名密码错误 |