github.com/twilio/twilio-go@v1.20.1/rest/taskrouter/v1/docs/WorkspacesWorkersApi.md (about) 1 # WorkspacesWorkersApi 2 3 All URIs are relative to *https://taskrouter.twilio.com* 4 5 Method | HTTP request | Description 6 ------------- | ------------- | ------------- 7 [**CreateWorker**](WorkspacesWorkersApi.md#CreateWorker) | **Post** /v1/Workspaces/{WorkspaceSid}/Workers | 8 [**DeleteWorker**](WorkspacesWorkersApi.md#DeleteWorker) | **Delete** /v1/Workspaces/{WorkspaceSid}/Workers/{Sid} | 9 [**FetchWorker**](WorkspacesWorkersApi.md#FetchWorker) | **Get** /v1/Workspaces/{WorkspaceSid}/Workers/{Sid} | 10 [**ListWorker**](WorkspacesWorkersApi.md#ListWorker) | **Get** /v1/Workspaces/{WorkspaceSid}/Workers | 11 [**UpdateWorker**](WorkspacesWorkersApi.md#UpdateWorker) | **Post** /v1/Workspaces/{WorkspaceSid}/Workers/{Sid} | 12 13 14 15 ## CreateWorker 16 17 > TaskrouterV1Worker CreateWorker(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 Worker belongs to. 30 31 ### Other Parameters 32 33 Other parameters are passed through a pointer to a CreateWorkerParams struct 34 35 36 Name | Type | Description 37 ------------- | ------------- | ------------- 38 **FriendlyName** | **string** | A descriptive string that you create to describe the new Worker. It can be up to 64 characters long. 39 **ActivitySid** | **string** | The SID of a valid Activity that will describe the new Worker's initial state. See [Activities](https://www.twilio.com/docs/taskrouter/api/activity) for more information. If not provided, the new Worker's initial state is the `default_activity_sid` configured on the Workspace. 40 **Attributes** | **string** | A valid JSON string that describes the new Worker. For example: `{ \\\"email\\\": \\\"Bob@example.com\\\", \\\"phone\\\": \\\"+5095551234\\\" }`. This data is passed to the `assignment_callback_url` when TaskRouter assigns a Task to the Worker. Defaults to {}. 41 42 ### Return type 43 44 [**TaskrouterV1Worker**](TaskrouterV1Worker.md) 45 46 ### Authorization 47 48 [accountSid_authToken](../README.md#accountSid_authToken) 49 50 ### HTTP request headers 51 52 - **Content-Type**: application/x-www-form-urlencoded 53 - **Accept**: application/json 54 55 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 56 [[Back to Model list]](../README.md#documentation-for-models) 57 [[Back to README]](../README.md) 58 59 60 ## DeleteWorker 61 62 > DeleteWorker(ctx, WorkspaceSidSidoptional) 63 64 65 66 67 68 ### Path Parameters 69 70 71 Name | Type | Description 72 ------------- | ------------- | ------------- 73 **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. 74 **WorkspaceSid** | **string** | The SID of the Workspace with the Worker to delete. 75 **Sid** | **string** | The SID of the Worker resource to delete. 76 77 ### Other Parameters 78 79 Other parameters are passed through a pointer to a DeleteWorkerParams struct 80 81 82 Name | Type | Description 83 ------------- | ------------- | ------------- 84 **IfMatch** | **string** | The If-Match HTTP request header 85 86 ### Return type 87 88 (empty response body) 89 90 ### Authorization 91 92 [accountSid_authToken](../README.md#accountSid_authToken) 93 94 ### HTTP request headers 95 96 - **Content-Type**: Not defined 97 - **Accept**: Not defined 98 99 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 100 [[Back to Model list]](../README.md#documentation-for-models) 101 [[Back to README]](../README.md) 102 103 104 ## FetchWorker 105 106 > TaskrouterV1Worker FetchWorker(ctx, WorkspaceSidSid) 107 108 109 110 111 112 ### Path Parameters 113 114 115 Name | Type | Description 116 ------------- | ------------- | ------------- 117 **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. 118 **WorkspaceSid** | **string** | The SID of the Workspace with the Worker to fetch. 119 **Sid** | **string** | The SID of the Worker resource to fetch. 120 121 ### Other Parameters 122 123 Other parameters are passed through a pointer to a FetchWorkerParams struct 124 125 126 Name | Type | Description 127 ------------- | ------------- | ------------- 128 129 ### Return type 130 131 [**TaskrouterV1Worker**](TaskrouterV1Worker.md) 132 133 ### Authorization 134 135 [accountSid_authToken](../README.md#accountSid_authToken) 136 137 ### HTTP request headers 138 139 - **Content-Type**: Not defined 140 - **Accept**: application/json 141 142 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 143 [[Back to Model list]](../README.md#documentation-for-models) 144 [[Back to README]](../README.md) 145 146 147 ## ListWorker 148 149 > []TaskrouterV1Worker ListWorker(ctx, WorkspaceSidoptional) 150 151 152 153 154 155 ### Path Parameters 156 157 158 Name | Type | Description 159 ------------- | ------------- | ------------- 160 **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. 161 **WorkspaceSid** | **string** | The SID of the Workspace with the Workers to read. 162 163 ### Other Parameters 164 165 Other parameters are passed through a pointer to a ListWorkerParams struct 166 167 168 Name | Type | Description 169 ------------- | ------------- | ------------- 170 **ActivityName** | **string** | The `activity_name` of the Worker resources to read. 171 **ActivitySid** | **string** | The `activity_sid` of the Worker resources to read. 172 **Available** | **string** | Whether to return only Worker resources that are available or unavailable. Can be `true`, `1`, or `yes` to return Worker resources that are available, and `false`, or any value returns the Worker resources that are not available. 173 **FriendlyName** | **string** | The `friendly_name` of the Worker resources to read. 174 **TargetWorkersExpression** | **string** | Filter by Workers that would match an expression. In addition to fields in the workers' attributes, the expression can include the following worker fields: `sid`, `friendly_name`, `activity_sid`, or `activity_name` 175 **TaskQueueName** | **string** | The `friendly_name` of the TaskQueue that the Workers to read are eligible for. 176 **TaskQueueSid** | **string** | The SID of the TaskQueue that the Workers to read are eligible for. 177 **Ordering** | **string** | Sorting parameter for Workers 178 **PageSize** | **int** | How many resources to return in each list page. The default is 50, and the maximum is 1000. 179 **Limit** | **int** | Max number of records to return. 180 181 ### Return type 182 183 [**[]TaskrouterV1Worker**](TaskrouterV1Worker.md) 184 185 ### Authorization 186 187 [accountSid_authToken](../README.md#accountSid_authToken) 188 189 ### HTTP request headers 190 191 - **Content-Type**: Not defined 192 - **Accept**: application/json 193 194 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 195 [[Back to Model list]](../README.md#documentation-for-models) 196 [[Back to README]](../README.md) 197 198 199 ## UpdateWorker 200 201 > TaskrouterV1Worker UpdateWorker(ctx, WorkspaceSidSidoptional) 202 203 204 205 206 207 ### Path Parameters 208 209 210 Name | Type | Description 211 ------------- | ------------- | ------------- 212 **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. 213 **WorkspaceSid** | **string** | The SID of the Workspace with the Worker to update. 214 **Sid** | **string** | The SID of the Worker resource to update. 215 216 ### Other Parameters 217 218 Other parameters are passed through a pointer to a UpdateWorkerParams struct 219 220 221 Name | Type | Description 222 ------------- | ------------- | ------------- 223 **IfMatch** | **string** | The If-Match HTTP request header 224 **ActivitySid** | **string** | The SID of a valid Activity that will describe the Worker's initial state. See [Activities](https://www.twilio.com/docs/taskrouter/api/activity) for more information. 225 **Attributes** | **string** | The JSON string that describes the Worker. For example: `{ \\\"email\\\": \\\"Bob@example.com\\\", \\\"phone\\\": \\\"+5095551234\\\" }`. This data is passed to the `assignment_callback_url` when TaskRouter assigns a Task to the Worker. Defaults to {}. 226 **FriendlyName** | **string** | A descriptive string that you create to describe the Worker. It can be up to 64 characters long. 227 **RejectPendingReservations** | **bool** | Whether to reject the Worker's pending reservations. This option is only valid if the Worker's new [Activity](https://www.twilio.com/docs/taskrouter/api/activity) resource has its `availability` property set to `False`. 228 229 ### Return type 230 231 [**TaskrouterV1Worker**](TaskrouterV1Worker.md) 232 233 ### Authorization 234 235 [accountSid_authToken](../README.md#accountSid_authToken) 236 237 ### HTTP request headers 238 239 - **Content-Type**: application/x-www-form-urlencoded 240 - **Accept**: application/json 241 242 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 243 [[Back to Model list]](../README.md#documentation-for-models) 244 [[Back to README]](../README.md) 245