reportTask

Version 2024-11-01

📘

Important

The Buy with Prime API is offered as a preview and might change as we receive feedback and iterate on the interfaces. We are sharing this early documentation to help you learn about the Buy with Prime API as we write and iterate on the content.

Overview

Get report task request. Returns the status of a report given the taskId.

Response

Return type ReportRequest

Arguments

ArgumentDescription
taskId (ID required)

Specifies the identifier to retrieve a report task.

Examples


Report Task

Request

query ReportTask {
  reportTask(taskId: "USER_EVENTS:23272b65-efac-412d-a8aa-ce8ef41bb448") {
    status
    requestTime
    lastUpdatedTime
    reportType
    taskId
  }
}

Response

{
  "data": {
    "reportTask": {
      "status": "STARTED",
      "requestTime": "2024-07-21T22:24:33.436Z",
      "lastUpdatedTime": "2024-07-21T22:24:33.692Z",
      "reportType": "USER_EVENTS",
      "taskId": "USER_EVENTS:23272b65-efac-412d-a8aa-ce8ef41bb448"
    }
  }
}

Task Id Does Not Exist

Request

query ReportTask {
  reportTask(taskId: "invalid-task-id") {
    status
    requestTime
    lastUpdatedTime
    reportType
    taskId
  }
}

Response

{
  "errors": [
    {
      "message": "Querying for an invalid or expired taskId",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": ["reportTask"],
      "extensions": {
        "classification": {
          "type": "ResourceNotFoundError",
          "errorType": "ResourceNotFoundException",
          "errorCode": 404
        }
      }
    }
  ],
  "data": {
    "reportTask": null
  }
}