Retrieves channels for a specified task, providing interaction and channel SIDs.
The SID of the task to retrieve channels for.
A promise that resolves with an array of channel objects containing interaction and channel SIDs.
FlexSdkError with the following error code(s):
import { createClient } from "@twilio/flex-sdk";import { GetChannelsForTask } from "@twilio/flex-sdk/actions/Task";async function getChannelsForTask() { const client = await createClient("SDK_TOKEN"); const action = new GetChannelsForTask("WTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"); const channels = await client.execute(action); console.log(channels[0].interactionSid, channels[0].sid);} Copy
import { createClient } from "@twilio/flex-sdk";import { GetChannelsForTask } from "@twilio/flex-sdk/actions/Task";async function getChannelsForTask() { const client = await createClient("SDK_TOKEN"); const action = new GetChannelsForTask("WTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"); const channels = await client.execute(action); console.log(channels[0].interactionSid, channels[0].sid);}
Retrieves channels for a specified task, providing interaction and channel SIDs.
Param: taskSid
The SID of the task to retrieve channels for.
Returns
A promise that resolves with an array of channel objects containing interaction and channel SIDs.
Throws
FlexSdkError with the following error code(s):
Example