Tasks

Understand the basics of tasks.

The tasks object

Task identifier

A taskId is a unique identifier. You can use this identifier to retrieve a task.

Products

The products object provides the product identifier (productId) and/or External Reference Identifier (externalReferenceId), and product type (productType). The valid product types are INDIVIDUAL, BASE, VARIATION.

Task status

The taskStatus attribute identifies the type of status associated with the task. The valid task values are PUBLISHED, COMPLETED, FAILED, PROCESSING, PUBLISHED.

Received time and finished time

A task always contains receivedTime and finishedTime fields. The receiveTime field indicates the date and time when the task began and the finishedTime field indicates when the task is completed. You can use the beginReceivedTime or endReceivedTime query parameters in the URI to search for all tasks associated with a specific receivedTime or finishedTime.

Request type

The requestType attribute identifies the type of request associated with the task. The valid request types are CREATE_PRODUCT, CREATE_VARIATION, UPDATE_PRODUCT, UPDATE_VARIATION, DELETE_VARIATION, DELETE_LOCALE, DEPLOY_PRODUCT, RETIRE_PRODUCT, UPDATE_PRODUCT_LIVE_CHANGE, and UPDATE_VARIATION_LIVE_CHANGE.

URI

A uri is the web address for a specific task.

Tasks query parameters

You can specify one or more query parameters separated by an ampersand (&) to return a filtered list of tasks. The following topics describe the available query parameters for the tasks request. For more information on how to use query parameters, see Fields and query parameters.

Begin received time

The beginReceivedTime query parameter filters a list based on the receivedTime field. A filter on a list based on the receivedTime field. The value can be a string with an ISO-8601 UTC format optional (for example, yyyy-mm-ddT00:00:00.000Z). The response displays results for 30 days starting from the specified date. The response displays results for 30 days starting from the specified date. GET 'https://api.digitalriver.com/v1/products/tasks?beginReceivedTime=2022-10-01T00:00:00.000Z'

Getting a task by beginReceivedTime

The following GET /v1/products/tasks?beginReceivedTime={yyyy-mm-ddT00:00:00.000Z} request filters tasks by the receivedTime (for example, 2022-0901dT00:00:00.000Z). The begin received time includes everything starting on the specified received time date and going forward. See Setting the task query parameters for more information.

curl --location --request GET 'https://api.digitalriver.com/v1/products/tasks?beginReceivedTime=2022-09-01T00:00:00.00/v10Z' \
--header 'Authorization: Bearer <API_key>' \
...

Getting the next page

Use the beginReceivedTime parameter to filter dates based on the date when the task was received. The following example shows how to display the next page.

curl --location --request GET 'https://api.digitalriver.com/v1/products/tasks?beginReceivedTime=2022-09-01T00:00:00.000Z' \
--header 'Authorization: Bearer <API_key>' \
...

endReceivedTime

This optional endReceivedTime query parameter filters a list on the finishedTime field. The value can be a string with an ISO-8601 UTC format datetime (for example, yyyy-mm-ddT00:00:00.000Z). The response displays results for 30 days before and including the specified date. GET 'https://api.digitalriver.com/v1/products/tasks?endReceivedTime=2022-10-31T00:00:00.000Z'

Getting tasks by endReceivedTime

The following GET /products/tasks?endReceivedTime={yyyy-mm-ddT00:00:00.000Z} request filters tasks by the finishedTime (for example, 2022-10-30T23:00:00.000Z). The end received time includes everything ending on the specified finished time date and going backward.

curl --location --request GET 'https://api.digitalriver.com/v1/products/tasks?endReceivedTime=2022-10-30T23:00:00.000Z' \
--header 'Authorization: Bearer <API_key>' \
...

Getting the previous page

Use the endReceivedTime parameter to filter dates based on the date when the task was received. The following example shows how to display the next page.

curl --location --request GET 'https://api.digitalriver.com/v1/products/tasks?endReceivedTime=2022-10-30T23:00:00.000Z' \
--header 'Authorization: Bearer <API_key>' \
...

Limit

This optional limit query parameter filters a list on the finishedTime field. The value can be a string with an ISO-8601 UTC format datetime (for example, yyyy-mm-ddT00:00:00.000Z). The response displays results for 30 days before and including the specified date. GET 'https://api.digitalriver.com/v1/products/tasks?endReceivedTime=2022-10-31T00:00:00.000Z?limit=10'

Product identifier

This optional productId query parameter filters a list by the product identifier (productId). GET 'https://api.digitalriver.com/v1/products/tasks?productId={productId or productERID}'

Note: If you specify productERID, you must include x-erid-as-pid=true in the request header.

Starting after

This optional startingAfter query parameter filters a list based on taskId. Use the startingAfter value in the nextPage object from the previous request when requesting the next page of tasks. GET 'https://api.digitalriver.com/v1/products/tasks?startingAfter={taskId}'

Ending before

This optional endingBefore query parameter filters a list based on taskId. Use the endingBefore value in the previousPage object from the previous request when requesting the next page of tasks. GET 'https://api.digitalriver.com/v1/products/tasks?endingefore={taskId}'

Task status

This query taskStatus parameter filters a list based on the taskStatus. You can add multiple values separated by a comma. The request returns tasks with the specified values. GET 'https://api.digitalriver.com/v1/products/tasks?staskStatus=COMPLETED,FAILED'

Last updated