Class: Workspace

Workspace

Create a Workspace client representing a TaskRouter Workspace


new Twilio.TaskRouter.Workspace(jwt [, options] [, workspaceSid])

Parameters:
Name Type Argument Description
jwt string

The string token

options WorkspaceOptions <optional>
workspaceSid string <optional>

Sid of this Workspace, has to be provided if JWE token is passed

Throws:

Exception if workspaceSid is not passed with JWE token

Members


<readonly> workspaceSid :string

Type:
  • string

workspaceSid :string

Type:
  • string

Methods


fetchTaskQueue(queueSid)

Fetch task queue of this Workspace by given sid

Parameters:
Name Type Description
queueSid string

the sid of the task queue to fetch

Returns:

fetchTaskQueues( [params])

Fetch task queues of this Workspace

Parameters:
Name Type Argument Description
params FetchTaskQueuesParams <optional>
Returns:

fetchWorker(workerSid)

Fetch worker of this Workspace by given sid

Parameters:
Name Type Description
workerSid string

the sid of the worker to fetch

Returns:

fetchWorkers( [params])

Fetch workers of this Workspace

Parameters:
Name Type Argument Description
params FetchWorkersParams <optional>
Returns:

updateToken(newToken)

Update token

Parameters:
Name Type Description
newToken string

The new token that should be used for authentication

Returns:
  • throws error if unable to update token
Type
void