Skip to content
DemoFAQ

PDF Generation Template Editor

Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.

View on GitHub

API for Close File Processing

❖ Feature Description

Cancel an unfinished async file processing task.

Cancel an async task

POSThttp://localhost:8080/api/v1/task/{id}/cancel

❖ Request Parameters

Authentication credential sent in the header: x-api-key. Sign in to the Dashboard API management page to view the API Access Key for the current deployment.

Path Parameters

Task ID.

❖ Response Properties

FieldTypeDescription
codeIntegerBusiness status code.
msgStringResponse message.
dataObjectResponse data.
data.taskIdString
data.statusString
data.failureCodeStringError code when file processing fails.
data.failureReasonString
🔗Request Example
curl --request POST \
  --url http://localhost:8080/api/v1/task/{id}/cancel \
  --header 'x-api-key: YOUR API-KEY'
✓Response Example
200 OK
{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "<string>",
    "status": "canceled",
    "failureCode": "TASK_CANCELED",
    "failureReason": "task canceled by client"
  }
}
Need to stop an async task?
When an asynchronous task has been submitted, but you no longer wish to continue processing it, you can initiate a "Close Task" request to actively terminate the task.
Go to Close Task