百度智能云

All Product Document

          Cloud Monitor

          Notification Template

          Query Group List

          Request structure

          • method:POST
          • URL:/json-api/v1/alarm/notify/group/list

          Request parameters

          Name Types Description Required or not Parameter location
          name String Group Name No RequestBody
          pageNo int Page number Yes RequestBody
          pageSize int Page size Yes RequestBody

          Request example

          // Request
          {
           // Group Name
              "name" : "test",
              "pageNo" : 1,
              "pageSize" : 5
          }
          // Response
          {
              "success": true,
              "status": 200,
              "page": {
                  "orderBy": "",
                  "order": "",
                  "pageNo": 1,
                  "pageSize": 5,
                  "totalCount": 29,
                  "result": [
                      {
           // Group ID, unique identifier, used when creating/updating Notification Templates
                          "id": "901e63af4e044f698c6863b1f2******",
                          "domainId": "453bf9588c9e488f9ba2c98412******",
           // Group Name
                          "name": "luzhuopei_test",
           // Group description
                          "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"
                      }
                  ]
              }
          }

          Query the list of users

          Request structure

          • method:POST
          • URL:/json-api/v1/alarm/notify/party/list

          Request parameters

          Name Types Description Required or not Parameter location
          name String Username No RequestBody
          pageNo int Page number Yes RequestBody
          pageSize int Page size Yes RequestBody

          Request example

          // Request
          {
              "name" : "test",
              "pageNo" : 1,
              "pageSize" : 3
          }
          // Response
          {
              "success": true,
              "status": 200,
              "page": {
                  "orderBy": "",
                  "order": "",
                  "pageNo": 1,
                  "pageSize": 3,
                  "totalCount": 10,
                  "result": [
                      {
           // Unique ID of the user, used when creating/updating templates
                          "id": "1fe098754e854a98ba29b642b7******",
                          "domainId": "453bf9588c9e488f9ba2c98412******",
           // Username
                          "name": "zmq-test-0704",
           // User email (desensitization display)
                          "email": "",
           // User phone (desensitized display)
                          "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"
                      }
                  ]
              }
          }

          Create Notification Template

          Request structure

          • method:POST
          • URL:/csm/api/v1/userId/{userId}/action/create

          Request parameters

          Name Types Description Required or not Parameter location
          userId String User ID Yes Path
          notifications List<ActionNotificationDto> Notification Method Yes RequestBody
          members List<MemberDto> Recipient (User/Group, choose one) Yes RequestBody
          alias String Template Name Yes RequestBody
          disableTimes List<ActionDisableTimeDto> Scheduled shutdown Yes RequestBody
          actionCallBacks List<ActionCallBackDto> Alarm callback address Yes RequestBody

          Request example

          POST    /csm/api/v1/userId/453bf9588c9e488f9ba2c98412******/action/create
          {
           // Notification methods: EMAIL, SMS, PHONE
              "notifications":[
                  {
                      "type":"EMAIL",
                      "receiver":""
                  },
                  {
                      "type":"SMS",
                      "receiver":""
                  },
                  {
                      "type":"PHONE",
                      "receiver":""
                  }
              ],
           // Notifier: Choose between user and group
              "members":[
                  {
           // Notifier type: notifyGroup (group), notifyParty (user)
                      "type":"notifyParty",
           // Unique ID of the notifier
                      "id":"56c9e0e2138c4f2ea5c9b6a876******",
           // Notifier name
                      "name":"lizhan"
                  },
                  {
                      "type":"notifyParty",
                      "id":"78575b75611c493e843af65469******",
                      "name":"gongjia"
                  }
              ],
           // Template name
              "alias":"test_wjr",
           // Scheduled shutdown
           // If scheduled shutdown is not configured, both ‘from’ and ‘to’ times will be default to 00:00:00
           // You can configure to shut down during specific time periods, e.g., 00:00:00-01:00:00
              "disableTimes":[
                  {
                      "from":"08:00:00",
                      "to":"00:00:05"
                  }
              ],
           // Alarm callback
              "actionCallBacks":[
                  {
           // Callback URL
                      "url":"http://apiin.im.baidu.com/api/msg/groupmsgsend?access_token=d9d82f364e4be38aab243f788********",
                  }
              ]
          }

          Delete Notification Template

          Request structure

          • method:DELETE
          • URL:/csm/api/v1/userId/{userId}/action/delete?name={name}

          Request parameters

          Name Types Description Required or not Parameter location
          userId String User ID Yes Path
          name String Notification Template name (name returned by the Template List, unique identifier) Yes Query

          Request example

          DELETE    /csm/api/v1/userId/453bf9588c9e488f9ba2c98412******/action/delete?name=c9e70d56-e030-475e-9031-926de7******

          Query Notification Template list

          Request structure

          • Method:POST
          • URL:/csm/api/v1/userId/{userId}/action/actionList

          Request parameters

          Name Types Description Required or not Parameter location
          userId String User ID Yes Path
          name String Notification Template name No RequestBody
          pageNo int Page number Yes RequestBody
          pageSite int Page size Yes RequestBody
          order String Sorting rule, option value: desc, asc; default: desc No RequestBody
          orderBy String Sort by a specific field. Optional value: lastModifiedDate, default: lastModifiedDate No RequestBody

          Response example

          // Request
          POST /csm/api/v1/userId/453bf9588c9e488f9ba2c98412******/action/actionList
          {
              "name" : "tes",
              "pageNo" : 1,
              "pageSize" : 2,
              "orderBy" : "lastModifiedDate",
              "order" : "desc"
          }
          // Response
          {
              "requestId": "ed5834bc-39ab-409e-a535-01b8fdc9d555",
              "message": "",
              "success": true,
              "code": 200
              "result": {
                  "orderBy": "lastModifiedDate",
                  "order": "desc",
                  "pageNo": 1,
                  "pageSize": 2,
                  "totalCount": 8,
                  "result": [
                      {
           // Primary user ID
                          "productName": "453bf9588c9e488f9ba2c98412******",
           // Unique identifier of the Notification Template
                          "name": "bd820c9c-89ec-4803-8bf0-b237ae******",
           // Template name
                          "alias": "tes_action",
                          "source": "USER",
                          "type": "group",
           // Scheduled shutdown start and end time
                          "disableTimes": [
                              {
                                  "from": "00:05:00",
                                  "to": "00:06:00"
                              }
                          ],
                          "notifications": [
                              {
           // Unique identifier of the Notification Template
                                  "receiver": "bd820c9c-89ec-4803-8bf0-b237ae******",
           // Notification channel, values (EMAIL, PHONE, SMS), representing (email, phone, SMS)
                                  "type": "PHONE"
                              },
                              {
                                  "receiver": "bd820c9c-89ec-4803-8bf0-b237ae******",
                                  "type": "EMAIL"
                              },
                              {
                                  "receiver": "bd820c9c-89ec-4803-8bf0-b237ae******",
                                  "type": "SMS"
                              }
                          ],
           // Alarm callback
                          "actionCallBacks": [
                              {
           // Alarm callback URL
                                  "url": "http://apiin.im.baidu.com/api/msg/groupmsgsend?access_token=d41f256ca8930904aa9a48c3a4d******"
                              }
                          ],
           // Notifier: Choose between user and group
                          "members": [
                              {
           // Notifier type: notifyGroup (group), notifyParty (user)
                                  "type": "notifyGroup",
           // Unique identifier of the notifier
                                  "id": "901e63af4e044f698c6863b1f2******",
           // Notifier name
                                  "name": "luzhuopei_test"
                              },
                              {
                                  "type": "notifyGroup",
                                  "id": "ea20db42f34f4dca8d0ed476d9******",
                                  "name": "test_wjr_0505"
                              }
                          ],
           // If the notifier is a user, show user information
                          "userInfos": [],
           // If the notifier is a group, show group information
                          "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"
                      }
                  ]
              }
          }

          Edit Notification Template

          Request structure

          • Method:PUT
          • URL:/csm/api/v1/userId/{userId}/action/update

          Request parameters

          Name Types Description Required or not Parameter location
          userId String User ID Yes Path
          name String Notification Template name (name returned by the notification list API, unique identifier) Yes RequestBody
          notifications List<ActionNotificationDto> Notification Method Yes RequestBody
          members List<MemberDto> Recipient (User/Group, choose one) Yes RequestBody
          alias String Template Name Yes RequestBody
          disableTimes List<ActionDisableTimeDto> Scheduled shutdown Yes RequestBody
          actionCallBacks List<ActionCallBackDto> Alarm callback address Yes RequestBody

          Response example

          POST /csm/api/v1/userId/453bf9588c9e488f9ba2c98412******/action/update
          {
           // Unique identifier of the Notification Template, obtainable from the Notification Template list
                "name": "d358696a-b60b-4a02-a6fe-c8867080251c",
           // Notification methods: EMAIL, SMS, PHONE
                "notifications": [
                      {
                            "type": "EMAIL",
                            "receiver": ""
                      },
                      {
                            "type": "SMS",
                            "receiver": ""
                      },
                      {
                            "type": "PHONE",
                            "receiver": ""
                      }
                ],
           // Notifier: Choose between user and group
                "members": [
                      {
           // Notifier type: notifyGroup (group), notifyParty (user)
                            "type": "notifyParty",
           // Unique ID of the notifier
                            "id": "b4af509ca1d2447b99475ae1dd******",
           // Notifier name
                            "name": "pyy"
                      }
                ],
           // Template name
                "alias": "test",
                "name": "",
           // Scheduled shutdown
           // If scheduled shutdown is not configured, both ‘from’ and ‘to’ times will be default to 00:00:00
           // You can configure to shut down during specific time periods, e.g., 00:00:00-01:00:00
                "disableTimes": [
                      {
                            "from": "00:00:00",
                            "to": "06:00:00"
                      }
                ],
           // Alarm callback
                "actionCallBacks": [
                      {
           // Callback URL
                            "url": "http://test.com/callback"
                      }
                ],
                "userId": "453bf9588c9e488f9ba2c98412******"
          }

          Appendix

          ActionNotificationDto

          Name Types Description
          type String Notification channel, values (EMAIL, PHONE, SMS), representing (email, phone, SMS), required
          receiver String Pass a null value

          MemberDto

          Name Types Description
          type String Notification object, values (notifyParty, notifyGroup) representing (user, group), required
          id String ID returned by the user (group) list API, required
          name String Name returned by the user (Group) list API, required

          ActionDisableTimeDto

          Name Types Description
          from String Scheduled shutdown start time. If not configured, this value will be default to 00:00:00, required
          to String Scheduled shutdown start time. If not configured, this value will be default to 00:00:00, required

          ActionCallBackDto

          Name Types Description
          name String Alarm callback URL, optional
          Previous
          Instant Probe
          Next
          Overview