ListUserNotifyHistories

Updated at:

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

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

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: Subscription notification.

  • DIRECT: Direct event notification.

  • ITSM: Ticket or action notification.

SUBSCRIBE

channel

string

No

The notification channel. Valid values:

  • ALI_YUNGE_SMS: Text message.

  • ALI_YUNGE_CALL: Voice call.

  • ALI_YUNGE_MAIL: Email.

  • ALI_YUNGE_ALIUID: Internal message.

  • DING: DingTalk.

  • DING_COOL_APP: DingTalk Cool App.

  • FEISHU: Lark.

  • WEIXIN: WeCom.

  • SLACK: Slack.

  • TEAMS: Teams.

  • PAGERDUTY: PagerDuty.

  • WEBHOOK: Custom webhook.

  • ALIYUN_SLS: Simple Log Service.

  • ALIYUN_FC: Function Compute.

  • ALIYUN_FC3: Function Compute 3.0.

  • ALIYUN_MNS: Message Service.

  • ALIYUN_OOS: CloudOps Orchestration Service.

  • ALIYUN_ESS: Elastic scaling.

  • ALIYUN_EB: Event bus.

  • ALIYUN_OPENAPI: OpenAPI.

DING

severity

string

No

The alert severity. Valid values:

  • CRITICAL: Critical.

  • ERROR: Error.

  • WARNING: Warning.

  • INFO: Info.

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:

  • true: Returns only successfully delivered records.

  • false: Returns only failed delivery records. If you do not specify this parameter, the results are not filtered by delivery result.

isDesc

boolean

No

Specifies whether to sort the results in descending order of time. Valid values:

  • true: Sorts the results in descending order, with the latest records first.

  • false: Sorts the results in ascending order. Default value: true.

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: Webhook channels, such as DingTalk, Lark, WeCom, Slack, Teams, and custom webhooks.

  • YUNGE: Yunge communication channels, such as text messages, voice calls, and emails.

WEBHOOK

includeNoChannel

boolean

No

Specifies whether to include notification records without an actual delivery channel. Valid values:

  • true: Includes the records.

  • false: Excludes the records and returns only records with an actual delivery channel. Default value: true.

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:

  • true: The record has no channel, which means the notifyResult is NO_CHANNEL.

  • false: The record has an actual delivery channel.

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: Subscription notification.

  • DIRECT: Direct event notification.

  • ITSM: Ticket or action notification.

SUBSCRIBE

severity

string

The alert severity. Valid values:

  • CRITICAL: Critical.

  • ERROR: Error.

  • WARNING: Warning.

  • INFO: Info.

CRITICAL

status

string

The incident status. Valid values:

  • TRIGGERED: Triggered.

  • RESOLVED: Resolved.

  • ACK: Acknowledged.

  • ESCALATED: Escalated.

  • MANUAL_RESOLVED: Manually resolved.

  • TIMEOUT: Automatically resolved due to timeout.

  • RETRIGGERED: Retriggered.

  • PARTIAL_RESOLVED: Partially resolved.

  • INVALID: Invalid.

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:

  • true: Delivered successfully.

  • false: Delivery failed.

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.