Lists the Device Defender audits that have been performed during a given time period.Requires permission to access the ListAuditTasks action.
Request Request Example
Shell
JavaScript
Java
Swift
curl--location-g--request GET 'https://api.iotwireless.{region}.amazonaws.com/audit/tasks?startTime=&endTime='
Response Response Example
200 - Example 1
{"tasks":[],"nextToken":"string"}
Request
Query Params
startTime
stringÂ
required
The beginning of the time period. Audit information is retained for a limited time (90 days). Requesting a start time prior to what is retained results in an "InvalidRequestException".
endTime
stringÂ
required
The end of the time period.
taskType
stringÂ
optional
A filter to limit the output to the specified type of audit: can be one of "ON_DEMAND_AUDIT_TASK" or "SCHEDULED__AUDIT_TASK".
taskStatus
stringÂ
optional
A filter to limit the output to audits with the specified completion status: can be one of "IN_PROGRESS", "COMPLETED", "FAILED", or "CANCELED".
nextToken
stringÂ
optional
The token for the next set of results.
maxResults
integerÂ
optional
The maximum number of results to return at one time. The default is 25.
Responses
🟢200Success
application/json
Body
tasks
array[object (AuditTaskMetadata) {3}]Â
optional
The audits that were performed during the specified time period.
taskId
stringÂ
optional
The ID of this audit.
>= 1 characters<= 40 characters
Match pattern:
[a-zA-Z0-9\-]+
taskStatus
enum<string>Â
optional
The status of this audit. One of "IN_PROGRESS", "COMPLETED", "FAILED", or "CANCELED".
Allowed values:
IN_PROGRESSCOMPLETEDFAILEDCANCELED
taskType
enum<string>Â
optional
The type of this audit. One of "ON_DEMAND_AUDIT_TASK" or "SCHEDULED_AUDIT_TASK".
Allowed values:
ON_DEMAND_AUDIT_TASKSCHEDULED_AUDIT_TASK
nextToken
stringÂ
optional
A token that can be used to retrieve the next set of results, or null if there are no additional results.