github.com/twilio/twilio-go@v1.20.1/rest/taskrouter/v1/docs/WorkspacesTasksApi.md (about) 1 # WorkspacesTasksApi 2 3 All URIs are relative to *https://taskrouter.twilio.com* 4 5 Method | HTTP request | Description 6 ------------- | ------------- | ------------- 7 [**CreateTask**](WorkspacesTasksApi.md#CreateTask) | **Post** /v1/Workspaces/{WorkspaceSid}/Tasks | 8 [**DeleteTask**](WorkspacesTasksApi.md#DeleteTask) | **Delete** /v1/Workspaces/{WorkspaceSid}/Tasks/{Sid} | 9 [**FetchTask**](WorkspacesTasksApi.md#FetchTask) | **Get** /v1/Workspaces/{WorkspaceSid}/Tasks/{Sid} | 10 [**ListTask**](WorkspacesTasksApi.md#ListTask) | **Get** /v1/Workspaces/{WorkspaceSid}/Tasks | 11 [**UpdateTask**](WorkspacesTasksApi.md#UpdateTask) | **Post** /v1/Workspaces/{WorkspaceSid}/Tasks/{Sid} | 12 13 14 15 ## CreateTask 16 17 > TaskrouterV1Task CreateTask(ctx, WorkspaceSidoptional) 18 19 20 21 22 23 ### Path Parameters 24 25 26 Name | Type | Description 27 ------------- | ------------- | ------------- 28 **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. 29 **WorkspaceSid** | **string** | The SID of the Workspace that the new Task belongs to. 30 31 ### Other Parameters 32 33 Other parameters are passed through a pointer to a CreateTaskParams struct 34 35 36 Name | Type | Description 37 ------------- | ------------- | ------------- 38 **Timeout** | **int** | The amount of time in seconds the new task can live before being assigned. Can be up to a maximum of 2 weeks (1,209,600 seconds). The default value is 24 hours (86,400 seconds). On timeout, the `task.canceled` event will fire with description `Task TTL Exceeded`. 39 **Priority** | **int** | The priority to assign the new task and override the default. When supplied, the new Task will have this priority unless it matches a Workflow Target with a Priority set. When not supplied, the new Task will have the priority of the matching Workflow Target. Value can be 0 to 2^31^ (2,147,483,647). 40 **TaskChannel** | **string** | When MultiTasking is enabled, specify the TaskChannel by passing either its `unique_name` or `sid`. Default value is `default`. 41 **WorkflowSid** | **string** | The SID of the Workflow that you would like to handle routing for the new Task. If there is only one Workflow defined for the Workspace that you are posting the new task to, this parameter is optional. 42 **Attributes** | **string** | A URL-encoded JSON string with the attributes of the new task. This value is passed to the Workflow's `assignment_callback_url` when the Task is assigned to a Worker. For example: `{ \\\"task_type\\\": \\\"call\\\", \\\"twilio_call_sid\\\": \\\"CAxxx\\\", \\\"customer_ticket_number\\\": \\\"12345\\\" }`. 43 **VirtualStartTime** | **time.Time** | The virtual start time to assign the new task and override the default. When supplied, the new task will have this virtual start time. When not supplied, the new task will have the virtual start time equal to `date_created`. Value can't be in the future. 44 45 ### Return type 46 47 [**TaskrouterV1Task**](TaskrouterV1Task.md) 48 49 ### Authorization 50 51 [accountSid_authToken](../README.md#accountSid_authToken) 52 53 ### HTTP request headers 54 55 - **Content-Type**: application/x-www-form-urlencoded 56 - **Accept**: application/json 57 58 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 59 [[Back to Model list]](../README.md#documentation-for-models) 60 [[Back to README]](../README.md) 61 62 63 ## DeleteTask 64 65 > DeleteTask(ctx, WorkspaceSidSidoptional) 66 67 68 69 70 71 ### Path Parameters 72 73 74 Name | Type | Description 75 ------------- | ------------- | ------------- 76 **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. 77 **WorkspaceSid** | **string** | The SID of the Workspace with the Task to delete. 78 **Sid** | **string** | The SID of the Task resource to delete. 79 80 ### Other Parameters 81 82 Other parameters are passed through a pointer to a DeleteTaskParams struct 83 84 85 Name | Type | Description 86 ------------- | ------------- | ------------- 87 **IfMatch** | **string** | If provided, deletes this Task if (and only if) the [ETag](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag) header of the Task matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). 88 89 ### Return type 90 91 (empty response body) 92 93 ### Authorization 94 95 [accountSid_authToken](../README.md#accountSid_authToken) 96 97 ### HTTP request headers 98 99 - **Content-Type**: Not defined 100 - **Accept**: Not defined 101 102 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 103 [[Back to Model list]](../README.md#documentation-for-models) 104 [[Back to README]](../README.md) 105 106 107 ## FetchTask 108 109 > TaskrouterV1Task FetchTask(ctx, WorkspaceSidSid) 110 111 112 113 114 115 ### Path Parameters 116 117 118 Name | Type | Description 119 ------------- | ------------- | ------------- 120 **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. 121 **WorkspaceSid** | **string** | The SID of the Workspace with the Task to fetch. 122 **Sid** | **string** | The SID of the Task resource to fetch. 123 124 ### Other Parameters 125 126 Other parameters are passed through a pointer to a FetchTaskParams struct 127 128 129 Name | Type | Description 130 ------------- | ------------- | ------------- 131 132 ### Return type 133 134 [**TaskrouterV1Task**](TaskrouterV1Task.md) 135 136 ### Authorization 137 138 [accountSid_authToken](../README.md#accountSid_authToken) 139 140 ### HTTP request headers 141 142 - **Content-Type**: Not defined 143 - **Accept**: application/json 144 145 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 146 [[Back to Model list]](../README.md#documentation-for-models) 147 [[Back to README]](../README.md) 148 149 150 ## ListTask 151 152 > []TaskrouterV1Task ListTask(ctx, WorkspaceSidoptional) 153 154 155 156 157 158 ### Path Parameters 159 160 161 Name | Type | Description 162 ------------- | ------------- | ------------- 163 **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. 164 **WorkspaceSid** | **string** | The SID of the Workspace with the Tasks to read. 165 166 ### Other Parameters 167 168 Other parameters are passed through a pointer to a ListTaskParams struct 169 170 171 Name | Type | Description 172 ------------- | ------------- | ------------- 173 **Priority** | **int** | The priority value of the Tasks to read. Returns the list of all Tasks in the Workspace with the specified priority. 174 **AssignmentStatus** | **[]string** | The `assignment_status` of the Tasks you want to read. Can be: `pending`, `reserved`, `assigned`, `canceled`, `wrapping`, or `completed`. Returns all Tasks in the Workspace with the specified `assignment_status`. 175 **WorkflowSid** | **string** | The SID of the Workflow with the Tasks to read. Returns the Tasks controlled by the Workflow identified by this SID. 176 **WorkflowName** | **string** | The friendly name of the Workflow with the Tasks to read. Returns the Tasks controlled by the Workflow identified by this friendly name. 177 **TaskQueueSid** | **string** | The SID of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this SID. 178 **TaskQueueName** | **string** | The `friendly_name` of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this friendly name. 179 **EvaluateTaskAttributes** | **string** | The attributes of the Tasks to read. Returns the Tasks that match the attributes specified in this parameter. 180 **Ordering** | **string** | How to order the returned Task resources. By default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `DateCreated`, `Priority`, or `VirtualStartTime` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Pairings of sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. The only ordering pairing not allowed is DateCreated and VirtualStartTime. 181 **HasAddons** | **bool** | Whether to read Tasks with Add-ons. If `true`, returns only Tasks with Add-ons. If `false`, returns only Tasks without Add-ons. 182 **PageSize** | **int** | How many resources to return in each list page. The default is 50, and the maximum is 1000. 183 **Limit** | **int** | Max number of records to return. 184 185 ### Return type 186 187 [**[]TaskrouterV1Task**](TaskrouterV1Task.md) 188 189 ### Authorization 190 191 [accountSid_authToken](../README.md#accountSid_authToken) 192 193 ### HTTP request headers 194 195 - **Content-Type**: Not defined 196 - **Accept**: application/json 197 198 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 199 [[Back to Model list]](../README.md#documentation-for-models) 200 [[Back to README]](../README.md) 201 202 203 ## UpdateTask 204 205 > TaskrouterV1Task UpdateTask(ctx, WorkspaceSidSidoptional) 206 207 208 209 210 211 ### Path Parameters 212 213 214 Name | Type | Description 215 ------------- | ------------- | ------------- 216 **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. 217 **WorkspaceSid** | **string** | The SID of the Workspace with the Task to update. 218 **Sid** | **string** | The SID of the Task resource to update. 219 220 ### Other Parameters 221 222 Other parameters are passed through a pointer to a UpdateTaskParams struct 223 224 225 Name | Type | Description 226 ------------- | ------------- | ------------- 227 **IfMatch** | **string** | If provided, applies this mutation if (and only if) the [ETag](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag) header of the Task matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). 228 **Attributes** | **string** | The JSON string that describes the custom attributes of the task. 229 **AssignmentStatus** | **string** | 230 **Reason** | **string** | The reason that the Task was canceled or completed. This parameter is required only if the Task is canceled or completed. Setting this value queues the task for deletion and logs the reason. 231 **Priority** | **int** | The Task's new priority value. When supplied, the Task takes on the specified priority unless it matches a Workflow Target with a Priority set. Value can be 0 to 2^31^ (2,147,483,647). 232 **TaskChannel** | **string** | When MultiTasking is enabled, specify the TaskChannel with the task to update. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. 233 **VirtualStartTime** | **time.Time** | The task's new virtual start time value. When supplied, the Task takes on the specified virtual start time. Value can't be in the future. 234 235 ### Return type 236 237 [**TaskrouterV1Task**](TaskrouterV1Task.md) 238 239 ### Authorization 240 241 [accountSid_authToken](../README.md#accountSid_authToken) 242 243 ### HTTP request headers 244 245 - **Content-Type**: application/x-www-form-urlencoded 246 - **Accept**: application/json 247 248 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 249 [[Back to Model list]](../README.md#documentation-for-models) 250 [[Back to README]](../README.md) 251