Sets attributes for a task.
The unique identifier (SID) of the task to set attributes for.
An object containing attributes to set for the task.
Optional configuration parameters for customizing the attribute setting process.
A promise that resolves to a Task object, representing the updated task.
FlexSdkError with the following error code(s):
import { createClient } from "@twilio/flex-sdk";import { SetTaskAttributes } from "@twilio/flex-sdk/actions/Task";async function setTaskAttributes() { const client = await createClient("SDK_TOKEN"); const setTaskAttributesAction = new SetTaskAttributes( "WTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", { key: "value" } ); const updatedTask = await client.execute(setTaskAttributesAction); return updatedTask;} Copy
import { createClient } from "@twilio/flex-sdk";import { SetTaskAttributes } from "@twilio/flex-sdk/actions/Task";async function setTaskAttributes() { const client = await createClient("SDK_TOKEN"); const setTaskAttributesAction = new SetTaskAttributes( "WTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", { key: "value" } ); const updatedTask = await client.execute(setTaskAttributesAction); return updatedTask;}
Optional
Sets attributes for a task.
Param: taskSid
The unique identifier (SID) of the task to set attributes for.
Param: attributes
An object containing attributes to set for the task.
Param: options
Optional configuration parameters for customizing the attribute setting process.
Returns
A promise that resolves to a Task object, representing the updated task.
Throws
FlexSdkError with the following error code(s):
Example