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 taskSidstring the sid of the task to fetch
Returns:
-
fetchTaskQueue(queueSid)
-
Fetch task queue of this Workspace by given sid
Parameters:
Name Type Description queueSidstring the sid of the task queue to fetch
Returns:
-
fetchTaskQueues( [params])
-
Fetch task queues of this Workspace
Parameters:
Name Type Argument Description paramsFetchTaskQueuesParams <optional>
Returns:
-
fetchWorker(workerSid)
-
Fetch worker of this Workspace by given sid
Parameters:
Name Type Description workerSidstring the sid of the worker to fetch
- Deprecated:
Returns:
-
fetchWorkerInfo(workerSid)
-
Fetch worker info of this Workspace by given sid
Parameters:
Name Type Description workerSidstring 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 paramsFetchWorkersParams <optional>
- Deprecated:
Returns:
-
fetchWorkersInfo( [params])
-
Fetch workers info of this Workspace
Parameters:
Name Type Argument Description paramsFetchWorkerInfoParams <optional>
Returns:
- A map with the workers info
- Type
- Promise.<Map.<string, WorkerInfo>>
-
updateToken(newToken)
-
Update token
Parameters:
Name Type Description newTokenstring The new token that should be used for authentication
Returns:
- throws error if unable to update token
- Type
- void