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


fetchTask(taskSid)

Fetch Task of this Workspace by given sid

Parameters:
Name Type Description
taskSid string

the sid of the task to fetch

Returns:

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

Deprecated:
Returns:

fetchWorkerInfo(workerSid)

Fetch worker info of this Workspace by given sid

Parameters:
Name Type Description
workerSid string

the sid of the worker to fetch

Returns:
  • A worker with given sid
Type
Promise.<WorkerInfo>

fetchWorkers( [params])

Fetch workers of this Workspace

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

fetchWorkersInfo( [params])

Fetch workers info of this Workspace

Parameters:
Name Type Argument Description
params FetchWorkerInfoParams <optional>
Returns:
  • A map with the workers info
Type
Promise.<Map.<string, WorkerInfo>>

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