Skip to main content

Using API Interface to Cancel Abnormal Tasks

Background

   In the Administrator Settings--Task Management page, administrators can manually cancel most types of tasks, but some types of tasks don't have a "Cancel" button (already in the optimization plan), such as file import and export, dataset preview, Webservice, account dataset updates, and enhanced analysis updates. If encountering system abnormalities caused by such task blockages, <strong>administrator users</strong> can temporarily use the interface to cancel abnormal tasks.

Implementation Method

1. Get Abnormal Task taskID and Account Token

   Use an administrator account to log into BI, enter "Task Management", press F12, or right-click on the page and select "Inspect" to open the developer tools. Filter task types and time ranges in BI, find the taskID of the task to be cancelled from the "Network"--"Preview" interface in the developer tools; find the account token information from the "Headers" interface, take the long string after uIdToken= up to the first semicolon. Example as follows:

image.png

Note: Both taskID and account token can be obtained using Postman to call the interface (not introduced in this article for now), but in emergency situations, using developer tools to get information is faster and more efficient.

2. Use Postman to Call Interface to Delete Task

Request Method: Post

Request URL: $home_url/api/task/{taskId}/cancel

Parameter Description:

NameLocationTypeMeaningRequiredRemarks
taskIdURLStringTask IDYesObtained from developer tools
tokenHeadersStringAccount sync tokenYesObtained from developer tools or calling interface $home_url/public-api/sign-in

Example:

image.png