ListUserNotifyHistories
Queries the delivery history of alert notifications in a specified workspace by using paging. You can filter the results by notification channel, alert severity, subscription, alert rule, recipient, delivery result, and time range.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
cms:ListUserNotifyHistories |
list |
*All Resource
|
None | None |
Request syntax
GET /userHistories HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| nextToken |
string |
No |
The pagination token. Used to retrieve the next page of data. It is an opaque string generated and encrypted by the server. You do not need to specify this parameter for the first query. For subsequent queries, pass the token returned in the previous response. |
2f8aKz3mNq9p**** |
| maxResults |
integer |
No |
The maximum number of records to return per page. Default value: 20. |
20 |
| workspace |
string |
Yes |
The workspace ID. |
default-cms-5884500827389836-cn-hangzhou |
| sendType |
string |
No |
The notification delivery type. Valid values:
|
SUBSCRIBE |
| channel |
string |
No |
The notification channel. Valid values:
|
DING |
| severity |
string |
No |
The alert severity. Valid values:
|
CRITICAL |
| subscriptionId |
string |
No |
The subscription ID. Used to filter the notification history for a specified subscription. It is a 32-character string. |
1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d |
| subscriptionName |
string |
No |
The subscription name. Used to filter the notification history by subscription name. |
Default subscription |
| ruleId |
string |
No |
The alert rule ID. Used to filter the notification history triggered by a specified alert rule with exact match. |
3fa85f64-5717-4562-b3fc-2c963f66afa6 |
| ruleName |
string |
No |
The alert rule name. Used to filter the notification history by rule name. |
CPU usage alert |
| receiver |
string |
No |
The recipient. Used to filter the notification history by recipient address, such as a phone number, email address, or webhook address. |
13800138000 |
| group |
string |
No |
The contact group. Used to filter the notification history by contact group name. |
O&M contact group |
| from |
integer |
No |
The start time of the query. The value is a UNIX timestamp in seconds. Default value: 6 hours before the to parameter. |
1729400000 |
| to |
integer |
No |
The end time of the query. The value is a UNIX timestamp in seconds. Default value: the current time. |
1729421600 |
| success |
boolean |
No |
Specifies whether to filter by delivery result. Valid values:
|
|
| isDesc |
boolean |
No |
Specifies whether to sort the results in descending order of time. Valid values:
|
|
| batchId |
string |
No |
The notification batch ID. Used to filter the notification history for the same delivery batch. |
3fa85f64-5717-4562-b3fc-2c963f66afa7 |
| channelCategory |
string |
No |
The channel category. Valid values:
|
WEBHOOK |
| includeNoChannel |
boolean |
No |
Specifies whether to include notification records without an actual delivery channel. Valid values:
|
|
| incidentId |
string |
No |
The incident ID. Used to filter the notification history associated with a specified incident. |
5d41402abc4b2a76b9719d911017c592 |
| notifyStrategyName |
string |
No |
The notification policy name. Used to filter the notification history by notification policy name. |
Default notification policy |
| notifyStrategyId |
string |
No |
The notification policy ID. Used to filter the notification history for a specified notification policy. It is a 32-character string. |
2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e |
partitionKey
deprecated
|
string |
No |
[Deprecated] This is an internal reserved parameter used only for dedicated notification history query paths in internal platform scenarios. Do not specify this parameter in external calls. |
1234567890123456 |
bizSource
deprecated
|
string |
No |
[Deprecated] This is an internal reserved parameter used only for business source filtering in internal platform scenarios. Do not specify this parameter in external calls. |
arms |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| historyList |
array<object> |
The notification history list. |
|
|
object |
|||
| channel |
string |
The notification channel. The valid values are the same as those of the channel request parameter. |
DING |
| contacts |
string |
The list of contacts. Multiple contacts are separated by commas. |
Zhang San, Li Si |
| groups |
string |
The list of contact groups. Multiple contact groups are separated by commas. |
O&M group, On-call group |
| incidentId |
string |
The incident ID. |
5d41402abc4b2a76b9719d911017c592 |
| jobId |
string |
The notification job ID. |
3fa85f64-5717-4562-b3fc-2c963f66afa8 |
| noChannel |
boolean |
Indicates whether the notification record has no actual delivery channel. Valid values:
|
|
| notifyStrategyId |
string |
The notification policy ID. |
2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e |
| notifyStrategyName |
string |
The notification policy name. |
Default notification policy |
| receiver |
string |
The recipient address, such as a phone number, email address, or webhook address, depending on the notification channel. |
13800138000 |
| result |
string |
The notification delivery result details. This is the raw response content returned by the channel, such as the API response from a DingTalk or Lark bot. |
{"errcode":0,"errmsg":"ok"} |
| ruleId |
string |
The alert rule ID. |
3fa85f64-5717-4562-b3fc-2c963f66afa6 |
| ruleName |
string |
The alert rule name. |
CPU usage alert |
| sendType |
string |
The notification delivery type. Valid values:
|
SUBSCRIBE |
| severity |
string |
The alert severity. Valid values:
|
CRITICAL |
| status |
string |
The incident status. Valid values:
|
TRIGGERED |
| subscriptionId |
string |
The subscription ID. |
1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d |
| subscriptionName |
string |
The subscription name. |
Default subscription |
| success |
boolean |
Indicates whether the notification was delivered successfully. Valid values:
|
|
| timestamp |
integer |
The time when the notification was recorded. The value is a UNIX timestamp in seconds. |
1729400000 |
| userId |
string |
The Alibaba Cloud account ID to which the notification record belongs. |
5884500827389836 |
| maxResults |
integer |
The maximum number of records returned for the current request. |
20 |
| nextToken |
string |
The pagination token for the next page. It is an opaque string generated and encrypted by the server. An empty value indicates that no more data is available. |
2f8aKz3mNq9p**** |
| requestId |
string |
The request ID. |
0B9377D9-C56B-5C2E-A8A4-************ |
| total |
integer |
The total number of notification history records that meet the query conditions. |
128 |
Examples
Success response
JSON format
{
"historyList": [
{
"channel": "DING",
"contacts": "Zhang San,Li Si",
"groups": "O&M group,On-call group",
"incidentId": "5d41402abc4b2a76b9719d911017c592",
"jobId": "3fa85f64-5717-4562-b3fc-2c963f66afa8",
"noChannel": false,
"notifyStrategyId": "2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e",
"notifyStrategyName": "Default notification policy",
"receiver": "13800138000",
"result": "{\"errcode\":0,\"errmsg\":\"ok\"}",
"ruleId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"ruleName": "CPU usage alert",
"sendType": "SUBSCRIBE",
"severity": "CRITICAL",
"status": "TRIGGERED",
"subscriptionId": "1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d",
"subscriptionName": "Default subscription",
"success": false,
"timestamp": 1729400000,
"userId": "5884500827389836"
}
],
"maxResults": 20,
"nextToken": "2f8aKz3mNq9p****",
"requestId": "0B9377D9-C56B-5C2E-A8A4-************",
"total": 128
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | ParameterInvalid | The parameter is missing or invalid. %s | The parameter is missing or invalid. |
| 400 | QueryTimeout | The query timed out because the time range or result set is too large. Narrow the time range, add filters, or reduce maxResults and try again. | |
| 500 | InternalUnknownError | The request processing has failed due to some unknown error. | A service runtime error occurred. |
| 403 | Forbidden | You are not authorized to operate the specified resource. | No permission, please use RAM to authorize |
| 404 | ResourceNotFound | The specified resource is not found. | The specified resource is not found. |
| 404 | NotFound | The notification history store of this workspace is not provisioned. Enable notification history for the workspace and try again. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.