Overview of Calling Modes
BizyAir offers three calling modes, switched via HTTP headers. No request body changes are needed:Synchronous Blocking
The default mode. The HTTP connection stays open until the task completes. No special header is required.outputs[].object_url.
Synchronous mode requires a long-lived connection. Make sure your HTTP client’s read timeout is at least 60 seconds to prevent the client from disconnecting while the task is still running.
Async Polling
Enable by adding theX-BizyAir-Task-Async: enable header to your request.
Step 1: Submit an async task and get therequest_id
202 Accepted immediately:
Step 2: Poll the task status
Step 3: Retrieve results once the status is Success
Complete Python Example
Webhook Callback
Enable by adding theX-BizyAir-Task-WebHook-Url header to your request.
Step 1: Submit a task with a webhook
202 Accepted + request_Id immediately.
Step 2: Receive results at your callback endpoint
When the task completes, BizyAir sends a POST request to the URL you specified:- Method:
POST - Headers:
Content-Type: application/json,User-Agent: Go-http-client/1.1, along with yourX-BizyAir-Task-Authorizationand any otherX-BizyAir-Task-*headers you set - Body: Contains the complete task result
Node.js Callback Server Example
Choosing a Calling Mode
Query Task Status
Get the current status and metadata of a task (queue info, runtime, etc.).data):
Status enum:
Query Task Results
Retrieve the outputs (object_url, etc.) of a completed task.
outputs[] field reference:
Cancel Task
Only works for tasks in the Queuing state; removes the task from the queue.Cancellation is idempotent — repeated calls have no side effects. If the task is already running, use Interrupt instead.