@twilio/flex-sdk
    Preparing search index...

    Class AcceptTask

    Accepts a task and reserves it for the current worker.

    For voice tasks, you must register a VoiceClientEvent listener with AddVoiceEventListener before running this action. If this is not done, accepting the task may fail.

    The unique identifier (SID) of the task to be accepted.

    Optional configuration parameters for customizing the task acceptance process.

    A promise that resolves to a Reservation and a Task object representing the accepted task.

    import { createClient } from "@twilio/flex-sdk";
    import { AcceptTask } from "@twilio/flex-sdk/actions/Task";

    async function acceptTask() {
    const client = await createClient("SDK_TOKEN");
    const acceptTask = new AcceptTask("WTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
    const { task, reservation } = await client.execute(acceptTask);
    return { task, reservation };
    }

    Implements

    Index

    Constructors

    Methods

    Constructors

    Methods