Help Center/ EventGrid/ API Reference/ APIs/ Event Subscription Management/ Obtaining the Event Subscription List
Updated on 2023-05-24 GMT+08:00

Obtaining the Event Subscription List

Function

This API is used to obtain the event subscription list. An event channel can be specified.

URI

GET /v1/{project_id}/subscriptions

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Tenant project ID.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

channel_id

No

String

ID of the event channel.

offset

No

Integer

Offset, which is the position where the query starts. The value must be greater than or equal to 0.

Minimum: 0

Maximum: 100

Default: 0

limit

No

Integer

Number of records displayed on each page. The value must be within the range [1, 1000].

Minimum: 1

Maximum: 1000

Default: 15

sort

No

String

Sorting mode of the query results.

Default: created_time:DESC

name

No

String

Name of the event subscription. It is used for exact match.

fuzzy_name

No

String

Name of the event subscription. It is used for fuzzy match.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. The token can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Minimum: 1

Maximum: 16384

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

total

Integer

Total number of records.

Minimum: 0

Maximum: 100

size

Integer

Number of records displayed on the current page.

Minimum: 0

Maximum: 100

items

Array of SubscriptionInfo objects

Object list.

Table 5 SubscriptionInfo

Parameter

Type

Description

id

String

Subscription ID.

name

String

Subscription name.

description

String

Description of the subscription.

type

String

Subscription type.

Enumeration values:

  • EVENT

  • SCHEDULED

status

String

Status.

Enumeration values:

  • CREATED

  • ENABLED

  • DISABLED

  • FROZEN

  • ERROR

channel_id

String

ID of the event channel.

channel_name

String

Name of the event channel.

used

Array of SubscriptionUsedInfo objects

Label information.

sources

Array of SubscriptionSourceInfo objects

List of subscription sources.

targets

Array of SubscriptionTargetInfo objects

List of subscription targets.

created_time

String

Time when the trigger is created.

updated_time

String

Time when the trigger is updated.

Table 6 SubscriptionUsedInfo

Parameter

Type

Description

resource_id

String

Associated resource ID.

owner

String

Management tenant account.

description

String

Description.

Table 7 SubscriptionSourceInfo

Parameter

Type

Description

id

String

ID of the event subscription source.

name

String

Name of the event subscription source.

provider_type

String

Provider type of the event subscription source.

detail

Object

List of event subscription source parameters.

filter

Object

Filtering rule of the event subscription source.

created_time

String

Time when the event subscription is created.

updated_time

String

Time when the event subscription is updated.

Table 8 SubscriptionTargetInfo

Parameter

Type

Description

id

String

ID of the event subscription target.

name

String

Name of the event subscription target.

provider_type

String

Provider type of the event subscription target.

connection_id

String

Connection ID used by the event subscription target.

Maximum: 64

detail

Object

List of event subscription target parameters.

transform

TransForm object

Transform rule of the event subscription target.

created_time

String

Time when the event subscription is created.

updated_time

String

Time when the event subscription is updated.

Table 9 TransForm

Parameter

Type

Description

type

String

Type of the transform rule.

Enumeration values:

  • ORIGINAL

  • CONSTANT

  • VARIABLE

value

String

For a constant type rule, the field is the constant content definition. For a variable type rule, the field is a variable definition and the content must be a JSON object string. A maximum of 100 variables are supported, and nested structures are not supported. The variable name can contain a maximum of 64 characters. Only letters, digits, periods (.), underscores (_), and hyphens (-) are allowed. It must start with a letter or digit and cannot start with HC.. The variable value expression can be a constant or JSONPath expression. The string length cannot exceed 1024 characters.

Maximum: 1024

template

String

Template definition of the rule content when the rule is of the variable type. Defined variables can be referenced.

Maximum: 2048

Status code: 400

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

Minimum: 1

Maximum: 128

error_msg

String

Error message.

Minimum: 1

Maximum: 512

error_details

String

Error details.

Minimum: 1

Maximum: 1024

request_id

String

Request ID.

Minimum: 1

Maximum: 128

Status code: 401

Table 11 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

Minimum: 1

Maximum: 128

error_msg

String

Error message.

Minimum: 1

Maximum: 512

error_details

String

Error details.

Minimum: 1

Maximum: 1024

request_id

String

Request ID.

Minimum: 1

Maximum: 128

Status code: 403

Table 12 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

Minimum: 1

Maximum: 128

error_msg

String

Error message.

Minimum: 1

Maximum: 512

error_details

String

Error details.

Minimum: 1

Maximum: 1024

request_id

String

Request ID.

Minimum: 1

Maximum: 128

Status code: 404

Table 13 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

Minimum: 1

Maximum: 128

error_msg

String

Error message.

Minimum: 1

Maximum: 512

error_details

String

Error details.

Minimum: 1

Maximum: 1024

request_id

String

Request ID.

Minimum: 1

Maximum: 128

Status code: 500

Table 14 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

Minimum: 1

Maximum: 128

error_msg

String

Error message.

Minimum: 1

Maximum: 512

error_details

String

Error details.

Minimum: 1

Maximum: 1024

request_id

String

Request ID.

Minimum: 1

Maximum: 128

Example Requests

None

Example Responses

Status code: 400

{
  "error_code" : "EG.00014000",
  "error_msg" : "Bad request"
}

Status code: 401

{
  "error_code" : "EG.00014010",
  "error_msg" : "Incorrect token or token resolution failed"
}

Status code: 403

{
  "error_code" : "EG.00014030",
  "error_msg" : "No permissions to request this method"
}

Status code: 404

{
  "error_code" : "EG.00014040",
  "error_msg" : "Not request resource found"
}

Status code: 500

{
  "error_code" : "EG.00015000",
  "error_msg" : "Internal Server Error"
}

Status Codes

Status Code

Description

200

Operation successful.

400

Invalid request.

401

Unauthorized.

403

Access denied.

404

Resource not found.

500

Internal service error.

Error Codes

See Error Codes.