Transfers a voice task to a target worker or a queue.
The unique identifier (SID) of the task to be transferred.
The unique identifier (SID) of the worker or the queue to transfer the task to.
Optional configuration parameters for customizing the task transfer process.
A promise that resolves to a Task object, representing the transferred task.
Task
FlexSdkError with the following error code(s):
import { createClient } from "@twilio/flex-sdk";import { StartVoiceTaskTransfer } from "@twilio/flex-sdk/actions/Voice";async function transferVoiceTask() { const client = await createClient("SDK_TOKEN"); const startVoiceTaskTransfer = new StartVoiceTaskTransfer("WTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"); const transferredTask = await client.execute(startVoiceTaskTransfer); return transferredTask;} Copy
import { createClient } from "@twilio/flex-sdk";import { StartVoiceTaskTransfer } from "@twilio/flex-sdk/actions/Voice";async function transferVoiceTask() { const client = await createClient("SDK_TOKEN"); const startVoiceTaskTransfer = new StartVoiceTaskTransfer("WTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", "WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"); const transferredTask = await client.execute(startVoiceTaskTransfer); return transferredTask;}
Optional
Transfers a voice task to a target worker or a queue.
Param: taskSid
The unique identifier (SID) of the task to be transferred.
Param: to
The unique identifier (SID) of the worker or the queue to transfer the task to.
Param: options
Optional configuration parameters for customizing the task transfer process.
Returns
A promise that resolves to a
Taskobject, representing the transferred task.Throws
FlexSdkError with the following error code(s):
Example