You can call this operation to query events.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes LookupEvents

The operation that you want to perform. Set the value to LookupEvents.

Event String No AD9CD9DA-EC2D-4EB7-A817-C0442A94****

The ID of the event.

Required String No AD9CD9DA-EC2D-4EB7-A817-C0442A94****

The ID of the request.

EventType String No ConsoleSignin

The type of the event. Valid values:

  • ApiCall
  • ConsoleSignin
  • ConsoleSignout
ServiceName String No AsaSub

The name of the cloud service.

EventName String No ConsoleSignin

The name of the event.

User String No yanjie.wyj

The name of the operation caller, namely, the name of the Resource Access Management (RAM) user.

ResourceType String No Instance

The type of the resource.

ResourceName String No i-bp14664y88udkt45****

The name of the video source.

EventRW String No Write

The read-write type of the request event. Valid values:

  • Read
  • Write (default)
  • All
EventAccessKeyId String No LTAI4FoDkCf4DU1bic1V****

The AcessKey ID used in the event.

NextToken String No 20

The token for obtaining the next page of query results.

Note The request parameters must be the same as those of the last request.
MaxResults String No 20

The maximum number of results to be returned.

Valid values: 0 to 50.

StartTime String No 2020-06-15T14:00:00Z

The start time of event search. It is seven days before the current time by default. Specify the time in the ISO 8601 standard. The time must be in UTC and Format: YYYY-MM-DDThh:mm:ssZ.

Note The maximum time range is 30 days. You can query events in the recent 90 days.
EndTime String No 2020-06-22T14:00:00Z

The end time of events to be retrieved. The default value is the current time point. Specify the time in the ISO 8601 standard. The time must be in UTC and Format: YYYY-MM-DDThh:mm:ssZ.

Note The maximum time range is 30 days. You can query events in the recent 90 days.

For more information about the fields of an event log, see ActionTrail event log reference.

Response parameters

Parameter Type Example Description
Events List AD9CD9DA-EC2D-4EB7-A817-C0442A94****

The list of events that you have retrieved.

NextToken String 1

The token for obtaining the next page of query results.

Note This parameter is not returned when there are no more results to return.
StartTime String 2016-01-05T09:11:36Z

The beginning of the time range where events were queried.

EndTime String 2016-01-12T09:11:06Z

The end of the time range where events were queried.

RequestId String FD79665A-CE8B-49D4-82E6-5EE2E0E791DD

The ID of the request.

Examples

Sample requests

http(s)://[Endpoint]/? Action=LookupEvents
&<Common request parameters>

Sample success responses

XML format

<LookupEventsResponse>
		  <RequestId>FD79665A-CE8B-49D4-82E6-5EE2E0E791DD</RequestId>
		  <StartTime>2016-01-05T09:11:36Z</StartTime>
		  <EndTime>2016-01-12T09:11:06Z</EndTime>
</LookupEventsResponse>

JSON format

{
  "RequestId": "FD79665A-CE8B-49D4-82E6-5EE2E0E791DD",
  "Events": [],
  "StartTime": "2016-01-05T09:11:36Z",
  "EndTime": "2016-01-12T09:11:06Z"
}

Error codes

HTTP status code Error code Error message Description
400 IncompleteSignature The request signature does not conform to Alibaba Cloud standards. The error message returned because the request signature does not conform to the standards of Alibaba Cloud. Check whether the AccessKey ID and AccessKey secret are correct and whether the signature method is appropriate. For more information, see Signature method.
404 InvalidAction The specified action is invalid. The error message returned because the Action parameter is invalid.
400 InvalidParameterCombination The end time must be later than the start time. The error message returned because the end of the time range is earlier than or equal to the beginning.
400 InvalidQueryParameter The specified query parameter is invalid. The error message returned because the specified query parameter is invalid.
400 InvalidParameterDateOutOfRange Query time range exceeds 30 days. The query time range exceeds 30 days.
400 InvalidParameterEndTime The specified EndTime is invalid. The error message returned when the specified EndTime parameter is invalid.
400 InvalidParameterStartTime The specified StartTime is invalid. The error message returned when the specified value of the StartTime parameter is invalid.
400 InvalidParameterStartTimeExceedsCurrent The StartTime exceeds the current time. Use GMT time format for queries. The error message returned because the start time is earlier than the current time. Use standard GMT to query time values.
400 InvalidParameterStartTimeOutOfDate The StartTime exceeds the limit of 90 days. The start time exceeds the 90-day limit.
400 InvalidTimeRangeException The end time must be later than the start time. The time span cannot exceed 30 days. The end time must be later than the start time and cannot exceed 30 days.

For a list of error codes, visit the API Error Center.