Wraps up a task that is either pending or assigned.
The unique identifier (SID) of the task to be completed.
A promise that resolves to a Reservation and a Task object representing the completed task.
Reservation
Task
FlexSdkError with the following error code(s):
import { createClient } from "@twilio/flex-sdk";import { WrapUpTask } from "@twilio/flex-sdk/actions/Task";async function wrapUpTask() { const client = await createClient("SDK_TOKEN"); const wrapUpTask = new WrapUpTask("TSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"); const { task, reservation } = await client.execute(wrapUpTask); return { task, reservation };} Copy
import { createClient } from "@twilio/flex-sdk";import { WrapUpTask } from "@twilio/flex-sdk/actions/Task";async function wrapUpTask() { const client = await createClient("SDK_TOKEN"); const wrapUpTask = new WrapUpTask("TSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"); const { task, reservation } = await client.execute(wrapUpTask); return { task, reservation };}
Wraps up a task that is either pending or assigned.
Param: taskSid
The unique identifier (SID) of the task to be completed.
Returns
A promise that resolves to a
Reservationand aTaskobject representing the completed task.Throws
FlexSdkError with the following error code(s):
Example