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
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