Help Center/ EventGrid/ API Reference/ APIs/ Event Management/ Prechecking Event Publishing Status
Updated on 2023-05-24 GMT+08:00

Prechecking Event Publishing Status

Function

This API is used to precheck whether the events from an event source can be published successfully. For example, an event can be published successfully only if there is a subscription to the event source.

URI

POST /v1/{project_id}/events/check

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Tenant project ID.

Request Parameters

Table 2 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

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

sources

No

Array of sources objects

List of event sources.

Table 4 sources

Parameter

Mandatory

Type

Description

channel_id

No

String

ID of the event channel.

source_name

No

String

Name of the event source.

Response Parameters

Status code: 200

Table 5 Response header parameters

Parameter

Type

Description

X-Request-Id

String

This field is the request ID number for task tracking. Format is request_uuid-timestamp-hostname.

Table 6 Response body parameters

Parameter

Type

Description

failed_count

Integer

Number of events that fail the precheck.

sources

Array of CheckPutEventsResult objects

Event publishing precheck results.

Table 7 CheckPutEventsResult

Parameter

Type

Description

channel_id

String

ID of the event channel.

source_name

String

Name of the event source.

check_result

Boolean

Result indicating whether the event will be successfully published.

check_detail

String

Details about the precheck result.

Status code: 400

Table 8 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 9 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 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: 404

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: 500

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

Example Requests

Precheck event publishing status.

/v1/{project_id}/events/check

{
  "sources" : [ {
    "channel_id" : "{{source-id}}",
    "source_name" : "{{source-name}}"
  } ]
}

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

Information

400

Invalid request.

401

Unauthorized.

403

Access denied.

404

Resource not found.

500

Internal service error.

Error Codes

See Error Codes.