查询用户组列表
请求结构
- method:POST
- URL:/json-api/v1/alarm/notify/group/list
请求参数
名称 |
类型 |
描述 |
是否必须 |
参数位置 |
name |
String |
用户组名称 |
否 |
RequestBody参数 |
pageNo |
int |
分页数 |
是 |
RequestBody参数 |
pageSize |
int |
分页大小 |
是 |
RequestBody参数 |
请求示例
{
"name" : "test",
"pageNo" : 1,
"pageSize" : 5
}
{
"success": true,
"status": 200,
"page": {
"orderBy": "",
"order": "",
"pageNo": 1,
"pageSize": 5,
"totalCount": 29,
"result": [
{
"id": "901e63af4e044f698c6863b1f2******",
"domainId": "453bf9588c9e488f9ba2c98412******",
"name": "luzhuopei_test",
"description": ""
},
{
"id": "4c5c086f66a9447ebfc6732909******",
"domainId": "453bf9588c9e488f9ba2c98412******",
"name": "new_test_20121",
"description": "update group"
},
{
"id": "0d291e2214ef48a19f59a0435a******",
"domainId": "453bf9588c9e488f9ba2c98412******",
"name": "new_test_238630",
"description": "update group"
},
{
"id": "0dcc6d8c92e04edcad700eda37******",
"domainId": "453bf9588c9e488f9ba2c98412******",
"name": "new_test_241148",
"description": "update group"
},
{
"id": "64b3d253226b4ef2b9949c0481******",
"domainId": "453bf9588c9e488f9ba2c98412******",
"name": "new_test_278381",
"description": "update group"
}
]
}
}
查询用户列表
请求结构
- method:POST
- URL:/json-api/v1/alarm/notify/party/list
请求参数
名称 |
类型 |
描述 |
是否必须 |
参数位置 |
name |
String |
用户名称 |
否 |
RequestBody参数 |
pageNo |
int |
分页数 |
是 |
RequestBody参数 |
pageSize |
int |
分页大小 |
是 |
RequestBody参数 |
请求示例
{
"name" : "test",
"pageNo" : 1,
"pageSize" : 3
}
{
"success": true,
"status": 200,
"page": {
"orderBy": "",
"order": "",
"pageNo": 1,
"pageSize": 3,
"totalCount": 10,
"result": [
{
"id": "1fe098754e854a98ba29b642b7******",
"domainId": "453bf9588c9e488f9ba2c98412******",
"name": "zmq-test-0704",
"email": "",
"phone": "*******2345",
"type": "identity"
},
{
"id": "5eeeb65c67de4f51b21a80c88e******",
"domainId": "453bf9588c9e488f9ba2c98412******",
"name": "testquota",
"email": "",
"phone": "",
"type": "identity"
},
{
"id": "dc7001a11f91451ea85c9cfdfc******",
"domainId": "453bf9588c9e488f9ba2c98412******",
"name": "test_lh",
"email": "",
"phone": "",
"type": "identity"
}
]
}
}
新建通知模版
请求结构
- method:POST
- URL:/csm/api/v1/userId/{userId}/action/create
请求参数
请求示例
POST /csm/api/v1/userId/453bf9588c9e488f9ba2c98412******/action/create
{
"notifications":[
{
"type":"EMAIL",
"receiver":""
},
{
"type":"SMS",
"receiver":""
},
{
"type":"PHONE",
"receiver":""
}
],
"members":[
{
"type":"notifyParty",
"id":"56c9e0e2138c4f2ea5c9b6a876******",
"name":"lizhan"
},
{
"type":"notifyParty",
"id":"78575b75611c493e843af65469******",
"name":"gongjia"
}
],
"alias":"test_wjr",
"disableTimes":[
{
"from":"08:00:00",
"to":"00:00:05"
}
],
"actionCallBacks":[
{
"url":"http://apiin.im.baidu.com/api/msg/groupmsgsend?access_token=d9d82f364e4be38aab243f788********",
}
]
}
删除通知模版
请求结构
- method:DELETE
- URL:/csm/api/v1/userId/{userId}/action/delete?name={name}
请求参数
名称 |
类型 |
描述 |
是否必须 |
参数位置 |
userId |
String |
用户ID |
是 |
Path参数 |
name |
String |
通知模版name(模版列表返回的name,唯一标示) |
是 |
Query参数 |
请求示例
DELETE /csm/api/v1/userId/453bf9588c9e488f9ba2c98412******/action/delete?name=c9e70d56-e030-475e-9031-926de7******
查询通知模版列表
请求结构
- Method:POST
- URL:/csm/api/v1/userId/{userId}/action/actionList
请求参数
名称 |
类型 |
描述 |
是否必须 |
参数位置 |
userId |
String |
用户id |
是 |
Path参数 |
name |
String |
通知模版名称 |
否 |
RequestBody参数 |
pageNo |
int |
分页数 |
是 |
RequestBody参数 |
pageSite |
int |
分页大小 |
是 |
RequestBody参数 |
order |
String |
排序规则,可选值desc、asc,默认:desc |
否 |
RequestBody参数 |
orderBy |
String |
按照某字段排序,可选值lastModifiedDate,默认:lastModifiedDate |
否 |
RequestBody参数 |
响应示例
POST /csm/api/v1/userId/453bf9588c9e488f9ba2c98412******/action/actionList
{
"name" : "tes",
"pageNo" : 1,
"pageSize" : 2,
"orderBy" : "lastModifiedDate",
"order" : "desc"
}
{
"requestId": "ed5834bc-39ab-409e-a535-01b8fdc9d555",
"message": "",
"success": true,
"code": 200
"result": {
"orderBy": "lastModifiedDate",
"order": "desc",
"pageNo": 1,
"pageSize": 2,
"totalCount": 8,
"result": [
{
"productName": "453bf9588c9e488f9ba2c98412******",
"name": "bd820c9c-89ec-4803-8bf0-b237ae******",
"alias": "tes_action",
"source": "USER",
"type": "group",
"disableTimes": [
{
"from": "00:05:00",
"to": "00:06:00"
}
],
"notifications": [
{
"receiver": "bd820c9c-89ec-4803-8bf0-b237ae******",
"type": "PHONE"
},
{
"receiver": "bd820c9c-89ec-4803-8bf0-b237ae******",
"type": "EMAIL"
},
{
"receiver": "bd820c9c-89ec-4803-8bf0-b237ae******",
"type": "SMS"
}
],
"actionCallBacks": [
{
"url": "http://apiin.im.baidu.com/api/msg/groupmsgsend?access_token=d41f256ca8930904aa9a48c3a4d******"
}
],
"members": [
{
"type": "notifyGroup",
"id": "901e63af4e044f698c6863b1f2******",
"name": "luzhuopei_test"
},
{
"type": "notifyGroup",
"id": "ea20db42f34f4dca8d0ed476d9******",
"name": "test_wjr_0505"
}
],
"userInfos": [],
"groupInfos": {
"901e63af4e044f698c6863b1f2******": [
{
"name": "luzhuo",
"email": "lu******i@baidu.com",
"phone": "*******1267",
"type": "notifyparty"
}
],
"ea20db42f34f4dca8d0ed476d9******": [
{
"name": "zhaoming",
"email": "zh*********n@baidu.com",
"phone": "*******1899",
"type": "notifyparty"
}
]
},
"lastModifiedDate": "2023-11-28T06:21:55.000+0000"
},
{
"productName": "453bf9588c9e488f9ba2c98412******",
"name": "0cff004b-cde0-4cb4-8b7d-0fe311******",
"alias": "zsli_test",
"source": "USER",
"type": "user",
"disableTimes": [
{
"from": "00:00:00",
"to": "00:00:00"
}
],
"notifications": [
{
"receiver": "0cff004b-cde0-4cb4-8b7d-0fe311******",
"type": "EMAIL"
},
{
"receiver": "0cff004b-cde0-4cb4-8b7d-0fe311******",
"type": "SMS"
}
],
"actionCallBacks": [],
"members": [
{
"type": "notifyParty",
"id": "56c9e0e2138c4f2ea5c9b6a876******",
"name": "lizhanshi"
}
],
"userInfos": [
{
"name": "lizha",
"email": "li******i@baidu.com",
"phone": "*******1892",
"type": "notifyparty"
}
],
"groupInfos": {},
"lastModifiedDate": "2023-11-22T15:31:41.000+0000"
}
]
}
}
编辑通知模版
请求结构
- Method:PUT
- URL:/csm/api/v1/userId/{userId}/action/update
请求参数
名称 |
类型 |
描述 |
是否必须 |
参数位置 |
userId |
String |
用户ID |
是 |
Path参数 |
name |
String |
通知模版name(通知列表接口返回的name,唯一标示) |
是 |
RequestBody参数 |
notifications |
List<ActionNotificationDto> |
通知方式 |
是 |
RequestBody参数 |
members |
List<MemberDto> |
接收人(用户/用户组,二选一) |
是 |
RequestBody参数 |
alias |
String |
模版名称 |
是 |
RequestBody参数 |
disableTimes |
List<ActionDisableTimeDto> |
定时关闭 |
是 |
RequestBody参数 |
actionCallBacks |
List<ActionCallBackDto> |
报警回调地址 |
是 |
RequestBody参数 |
响应示例
POST /csm/api/v1/userId/453bf9588c9e488f9ba2c98412******/action/update
{
"name": "d358696a-b60b-4a02-a6fe-c8867080251c",
"notifications": [
{
"type": "EMAIL",
"receiver": ""
},
{
"type": "SMS",
"receiver": ""
},
{
"type": "PHONE",
"receiver": ""
}
],
"members": [
{
"type": "notifyParty",
"id": "b4af509ca1d2447b99475ae1dd******",
"name": "pyy"
}
],
"alias": "test",
"name": "",
"disableTimes": [
{
"from": "00:00:00",
"to": "06:00:00"
}
],
"actionCallBacks": [
{
"url": "http://test.com/callback"
}
],
"userId": "453bf9588c9e488f9ba2c98412******"
}
附录
ActionNotificationDto
名称 |
类型 |
描述 |
type |
String |
通知渠道,取值(EMAIL、PHONE、SMS),代表(邮件、电话、短信),必填 |
aliasName |
String |
报警策略展示名,必填 |
MemberDto
名称 |
类型 |
描述 |
type |
String |
通知对象,取值(notifyParty、notifyGroup)代表(用户、用户组),必填 |
id |
String |
用户(组)列表接口返回的id,必填 |
name |
String |
用户(组)列表接口返回的name,必填 |
ActionDisableTimeDto
名称 |
类型 |
描述 |
from |
String |
定时关闭开始时间,如果不配置定时关闭设置该值为00:00:00,必填 |
to |
String |
定时关闭开始时间,如果不配置定时关闭设置该值为00:00:00,必填 |
ActionCallBackDto
名称 |
类型 |
描述 |
name |
String |
报警回调地址,选填 |