Task REST APIs

Overview

Use the Task endpoints to retrieve status for data table and migration tasks, cancel and delete tasks, and retrieve files associated with a task (e.g. log files and export zip files).

Note: The Task REST APIs are only available for admin users.

ClosedAuthentication

Oracle CPQ uses HTTP Basic authentication to authenticate REST calls from third-party systems. When making a call to an Oracle CPQ REST API, the third-party system’s REST client must have encrypted Oracle CPQ login credentials in the Header and an Accept Header that both adhere to HTTP Basic authentication standards. The Accept Header must be set to application/schema+json to see the detailed schema of the resource. For more information see the topic Supported REST Headers.


Administration

ClosedGet List of Tasks

Get List of Tasks GET Method

Description

This endpoint returns a list of tasks which are specified using the query parameters listed below.

URI Endpoint

/rest/v16/tasks/?q={category:{$in:[13,17,26,51,52]}}

Endpoint Parameters

q

The query parameter is required.

The following category values are supported:

  • '13' Data Table import tasks
  • '17' Data Table deploy tasks
  • '26' Data Table export tasks
  • '51' Migration Package import tasks
  • '52' Migration Package export tasks

HTTP Method

GET

Request Body Parameters

None

Response Body Parameters The response contains the tasks for the queried categories.

Get List of Data Table Tasks

ClosedURI Endpoint Sample

https://sitename.oracle.com/rest/v16/tasks/?q={category:{$in:[13,17,26]}}


ClosedResponse Sample

{ "items": [{ "id": 41365772, "dateModified": "10/18/2019 1:19 PM", "links": [{ "rel": "self", "href": "https://sitename.oracle.com/rest/v16/tasks/41365772" }, { "rel": "parent", "href": "https://sitename.oracle.com/rest/v16/tasks" } ], "name": "Rack_Domain", "category": { "lookupCode": "13", "displayValue": "Data Table Upload" }, "status": "Completed", "result": "4118171", "executionTime": "10/18/2019 1:19 PM", "dateAdded": "10/18/2019 1:19 PM" }, { "id": 41365771, "dateModified": "10/18/2019 1:18 PM", "links": [{ "rel": "self", "href": "https://sitename.oracle.com/rest/v16/tasks/41365771" }, { "rel": "parent", "href": "https://sitename.oracle.com/rest/v16/tasks" } ], "name": "Rack_Domain Export", "category": { "lookupCode": "26", "displayValue": "Data Table Export" }, "status": "Completed", "result": "datatable_1571422724473", "executionTime": "10/18/2019 1:18 PM", "dateAdded": "10/18/2019 1:18 PM" }, { "id": 41365769, "dateModified": "10/18/2019 1:18 PM", "links": [{ "rel": "self", "href": "https://sitename.oracle.com/rest/v16/tasks/41365769" }, { "rel": "parent", "href": "https://sitename.oracle.com/rest/v16/tasks" } ], "name": "Rack_Domain", "category": { "lookupCode": "17", "displayValue": "Data Table Deploy" }, "status": "Completed", "executionTime": "10/18/2019 1:18 PM", "dateAdded": "10/18/2019 1:18 PM" } ], "links": [{ "rel": "self", "href": "https://sitename.oracle.com/rest/v16/tasks" } ] }


Get List of Migration Tasks

ClosedURI Endpoint Sample

https://sitename.oracle.com/rest/v16/tasks/?q={category:{$in:[51,52]}}


ClosedResponse Sample

{ "items": [{ "id": 41372699, "dateModified": "04/15/2020 4:02 PM", "links": [{ "rel": "self", "href": "https://sitename.oracle.com/rest/v16/tasks/41372699" }, { "rel": "parent", "href": "https://sitename.oracle.com/rest/v16/tasks" }, { "rel": "child", "href": "https://sitename.oracle.com/rest/v16/tasks/41372699/files" } ], "name": "Migration REST Import", "category": { "lookupCode": "51", "displayValue": "Migration Package Import" }, "status": "Completed", "detailStatus": { "message": "Task is completed successfully.", "items": [{ "entity": "Util Library", "status": "Successful" }, { "entity": "Package", "status": "Successful" } ] }, "executionTime": "04/15/2020 4:00 PM", "dateAdded": "04/15/2020 4:00 PM" }, { "id": 41372640, "dateModified": "04/15/2020 3:45 PM", "links": [{ "rel": "self", "href": "https://sitename.oracle.com/rest/v16/tasks/41372640" }, { "rel": "parent", "href": "https://sitename.oracle.com/rest/v16/tasks" }, { "rel": "child", "href": "https://sitename.oracle.com/rest/v16/tasks/41372640/files" } ], "name": "Migration REST Export", "category": { "lookupCode": "52", "displayValue": "Migration Package Export" }, "status": "Completed", "result": "MigrationPackage_2", "executionTime": "04/15/2020 3:33 PM", "dateAdded": "04/15/2020 3:33 PM" } ], "links": [{ "rel": "self", "href": "https://sitename.oracle.com/rest/v16/tasks" } ] }


ClosedGet Task

Get Task GET Method

Description

This endpoint returns information for the specified task.

URI Endpoint

/rest/v16/tasks/{taskId}

Endpoint Parameters

taskId

The task Id

HTTP Method

GET

Request Body Parameters

None

Response Body Parameters

id

The task Id.

name

The task name.

executionTime

The time the task was executed.

category

This object contains the category code and display value.

result

The task result.

status

The status of the task.

dateModified

The last date the task was modified.

dateAdded

The date the task was created.

links

Links to the files associated with the task.

Data Table Export Task Example

ClosedURI Endpoint Sample

https://sitename.oracle.com/rest/v16/tasks/41373364


ClosedResponse Sample


Migration Package Export Task Example

ClosedURI Endpoint Sample

https://sitename.oracle.com/rest/v16/tasks/41372543


ClosedResponse Sample

{ "id": 41372543, "dateModified": "04/15/2020 3:33 PM", "links": [{ "rel": "self", "href": "https://sitename.oracle.com/rest/v16/tasks/41372543" }, { "rel": "parent", "href": "https://sitename.oracle.com/rest/v16/tasks" }, { "rel": "child", "href": "https://sitename.oracle.com/rest/v16/tasks/41372543/files" } ], "name": "Migration REST Export", "category": { "lookupCode": "52", "displayValue": "Migration Package Export" }, "status": "Completed", "result": "MigrationPackage_2", "executionTime": "04/15/2020 3:33 PM", "dateAdded": "04/15/2020 3:33 PM" }


ClosedCancel Task

The /tasks/{taskId}/actions/cancel endpoint was deprecated in Oracle CPQ 20B. Use the following endpoint to cancel tasks.

Cancel TaskPATCH method

Description

This endpoint cancels the specified task.

URI Endpoint

/rest/v16/tasks/{taskId}

Endpoint Parameters

taskId

The Id of the task to cancel.

HTTP Method

PATCH

  Request Body Parameters

The "status": "Cancellation Requested" statement is required.

status

Cancellation Requested

Response Status

202 Accepted

The request was accepted.

409 Conflict

The task cannot be cancelled.
For example, a completed task cannot be cancelled.

404 Not Found

The task doesn't exist or is not accessible for current user.

Response Body Parameters for an Accepted Request

id

The task Id.

name

The task name.

executionTime

The time the task was executed.

category

This object contains the category code and display value.

result

The task result.

status

The status of the task.

dateModified

The last date the task was modified.

dateAdded

The date the task was created.

ClosedURI Endpoint Sample

https://sitename.oracle.com/rest/v16/tasks/41365996


ClosedRequest Sample

{ "status": "Cancellation Requested" }


ClosedResponse Sample


ClosedDelete Task

Delete Task DELETE method

Description

This endpoint deletes the specified data table task.

Oracle CPQ 20B does not support the deletion of migration package tasks.

URI Endpoint

/rest/v16/tasks/41365771

Endpoint Parameters

taskId

The Id of the task to delete.

HTTP Method

DELETE

Request Body Parameters

None

Response Body Parameters None

ClosedURI Endpoint Sample


ClosedDelete Tasks

Delete TasksPOST method

Description

This endpoint is used to delete multiple data table tasks from the status log.

Oracle CPQ 20B does not support the deletion of migration package tasks.

URI Endpoint

/rest/v16/tasks/actions/deleteTasks

Endpoint Parameters None

HTTP Method

POST

Request Body Parameters

selections

An array of status log task Id ids to delete (required).

Response Body Parameters

None

ClosedURI Endpoint Sample

https://sitename.oracle.com/rest/v16/tasks/actions/deleteTasks


ClosedRequest Sample


ClosedGet Task File List

Get Task File List GET Method

Description

This endpoint returns a list of files associated with the specified task (e.g. log files and export zip files).

URI Endpoint

/rest/v16/tasks/{taskId}/files

Endpoint Parameters

taskId

The task Id.

HTTP Method

POST

Request Body Parameters

None

Response Body Parameters

None

Get Data Table Export Task File List

ClosedURI Endpoint Sample

https://sitename.oracle.com/rest/v16/tasks/41373364/files


ClosedResponse Sample


Get Migration Package Export Task File List

ClosedURI Endpoint Sample

https://sitename.oracle.com/rest/v16/tasks/41372543/files


ClosedResponse Sample

{ "items": [{ "links": [{ "rel": "related", "href": "https://sitename.oracle.com/rest/v16/tasks/41372543/files/MigrationPackage_2" } ], "name": "MigrationPackage_2", "type": "application/zip" } ], "links": [{ "rel": "self", "href": "https://sitename.oracle.com/rest/v16/tasks/41372543/files" } ] }


ClosedDownload a Task File

Download a Task File GET Method

Description

This endpoint downloads the specified task file (e.g. log files and export zip files).

URI Endpoint

/rest/v16/tasks/{taskId}/files/{fileName}

Endpoint Parameters

taskId

The task Id.

fileName

The name of the file to download. File names are acquired from the Get Task File List REST API response.

HTTP Method

GET

Request Body Parameters

None

Response Body Parameters

None

Download Exported Data Table File

ClosedURI Endpoint Sample

Download Exported Migration Package File

ClosedURI Endpoint Sample

https://sitename.oracle.com/rest/v16/tasks/41372543/files/MigrationPackage_2


Related Topics

Related Topics Link IconSee Also