github.com/twilio/twilio-go@v1.20.1/rest/chat/v1/docs/ServicesChannelsMessagesApi.md (about) 1 # ServicesChannelsMessagesApi 2 3 All URIs are relative to *https://chat.twilio.com* 4 5 Method | HTTP request | Description 6 ------------- | ------------- | ------------- 7 [**CreateMessage**](ServicesChannelsMessagesApi.md#CreateMessage) | **Post** /v1/Services/{ServiceSid}/Channels/{ChannelSid}/Messages | 8 [**DeleteMessage**](ServicesChannelsMessagesApi.md#DeleteMessage) | **Delete** /v1/Services/{ServiceSid}/Channels/{ChannelSid}/Messages/{Sid} | 9 [**FetchMessage**](ServicesChannelsMessagesApi.md#FetchMessage) | **Get** /v1/Services/{ServiceSid}/Channels/{ChannelSid}/Messages/{Sid} | 10 [**ListMessage**](ServicesChannelsMessagesApi.md#ListMessage) | **Get** /v1/Services/{ServiceSid}/Channels/{ChannelSid}/Messages | 11 [**UpdateMessage**](ServicesChannelsMessagesApi.md#UpdateMessage) | **Post** /v1/Services/{ServiceSid}/Channels/{ChannelSid}/Messages/{Sid} | 12 13 14 15 ## CreateMessage 16 17 > ChatV1Message CreateMessage(ctx, ServiceSidChannelSidoptional) 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 **ServiceSid** | **string** | The SID of the [Service](https://www.twilio.com/docs/api/chat/rest/services) to create the resource under. 30 **ChannelSid** | **string** | The unique ID of the [Channel](https://www.twilio.com/docs/api/chat/rest/channels) the new resource belongs to. Can be the Channel resource's `sid` or `unique_name`. 31 32 ### Other Parameters 33 34 Other parameters are passed through a pointer to a CreateMessageParams struct 35 36 37 Name | Type | Description 38 ------------- | ------------- | ------------- 39 **Body** | **string** | The message to send to the channel. Can also be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. 40 **From** | **string** | The [identity](https://www.twilio.com/docs/api/chat/guides/identity) of the new message's author. The default value is `system`. 41 **Attributes** | **string** | A valid JSON string that contains application-specific data. 42 43 ### Return type 44 45 [**ChatV1Message**](ChatV1Message.md) 46 47 ### Authorization 48 49 [accountSid_authToken](../README.md#accountSid_authToken) 50 51 ### HTTP request headers 52 53 - **Content-Type**: application/x-www-form-urlencoded 54 - **Accept**: application/json 55 56 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 57 [[Back to Model list]](../README.md#documentation-for-models) 58 [[Back to README]](../README.md) 59 60 61 ## DeleteMessage 62 63 > DeleteMessage(ctx, ServiceSidChannelSidSid) 64 65 66 67 68 69 ### Path Parameters 70 71 72 Name | Type | Description 73 ------------- | ------------- | ------------- 74 **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. 75 **ServiceSid** | **string** | The SID of the [Service](https://www.twilio.com/docs/api/chat/rest/services) to delete the resource from. 76 **ChannelSid** | **string** | The unique ID of the [Channel](https://www.twilio.com/docs/api/chat/rest/channels) the message to delete belongs to. Can be the Channel resource's `sid` or `unique_name`. 77 **Sid** | **string** | The Twilio-provided string that uniquely identifies the Message resource to delete. 78 79 ### Other Parameters 80 81 Other parameters are passed through a pointer to a DeleteMessageParams struct 82 83 84 Name | Type | Description 85 ------------- | ------------- | ------------- 86 87 ### Return type 88 89 (empty response body) 90 91 ### Authorization 92 93 [accountSid_authToken](../README.md#accountSid_authToken) 94 95 ### HTTP request headers 96 97 - **Content-Type**: Not defined 98 - **Accept**: Not defined 99 100 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 101 [[Back to Model list]](../README.md#documentation-for-models) 102 [[Back to README]](../README.md) 103 104 105 ## FetchMessage 106 107 > ChatV1Message FetchMessage(ctx, ServiceSidChannelSidSid) 108 109 110 111 112 113 ### Path Parameters 114 115 116 Name | Type | Description 117 ------------- | ------------- | ------------- 118 **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. 119 **ServiceSid** | **string** | The SID of the [Service](https://www.twilio.com/docs/api/chat/rest/services) to fetch the resource from. 120 **ChannelSid** | **string** | The unique ID of the [Channel](https://www.twilio.com/docs/api/chat/rest/channels) the message to fetch belongs to. Can be the Channel's `sid` or `unique_name`. 121 **Sid** | **string** | The Twilio-provided string that uniquely identifies the Message resource to fetch. 122 123 ### Other Parameters 124 125 Other parameters are passed through a pointer to a FetchMessageParams struct 126 127 128 Name | Type | Description 129 ------------- | ------------- | ------------- 130 131 ### Return type 132 133 [**ChatV1Message**](ChatV1Message.md) 134 135 ### Authorization 136 137 [accountSid_authToken](../README.md#accountSid_authToken) 138 139 ### HTTP request headers 140 141 - **Content-Type**: Not defined 142 - **Accept**: application/json 143 144 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 145 [[Back to Model list]](../README.md#documentation-for-models) 146 [[Back to README]](../README.md) 147 148 149 ## ListMessage 150 151 > []ChatV1Message ListMessage(ctx, ServiceSidChannelSidoptional) 152 153 154 155 156 157 ### Path Parameters 158 159 160 Name | Type | Description 161 ------------- | ------------- | ------------- 162 **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. 163 **ServiceSid** | **string** | The SID of the [Service](https://www.twilio.com/docs/api/chat/rest/services) to read the resources from. 164 **ChannelSid** | **string** | The unique ID of the [Channel](https://www.twilio.com/docs/api/chat/rest/channels) the message to read belongs to. Can be the Channel's `sid` or `unique_name`. 165 166 ### Other Parameters 167 168 Other parameters are passed through a pointer to a ListMessageParams struct 169 170 171 Name | Type | Description 172 ------------- | ------------- | ------------- 173 **Order** | **string** | The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending) with `asc` as the default. 174 **PageSize** | **int** | How many resources to return in each list page. The default is 50, and the maximum is 1000. 175 **Limit** | **int** | Max number of records to return. 176 177 ### Return type 178 179 [**[]ChatV1Message**](ChatV1Message.md) 180 181 ### Authorization 182 183 [accountSid_authToken](../README.md#accountSid_authToken) 184 185 ### HTTP request headers 186 187 - **Content-Type**: Not defined 188 - **Accept**: application/json 189 190 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 191 [[Back to Model list]](../README.md#documentation-for-models) 192 [[Back to README]](../README.md) 193 194 195 ## UpdateMessage 196 197 > ChatV1Message UpdateMessage(ctx, ServiceSidChannelSidSidoptional) 198 199 200 201 202 203 ### Path Parameters 204 205 206 Name | Type | Description 207 ------------- | ------------- | ------------- 208 **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. 209 **ServiceSid** | **string** | The SID of the [Service](https://www.twilio.com/docs/api/chat/rest/services) to update the resource from. 210 **ChannelSid** | **string** | The unique ID of the [Channel](https://www.twilio.com/docs/api/chat/rest/channels) the message belongs to. Can be the Channel's `sid` or `unique_name`. 211 **Sid** | **string** | The Twilio-provided string that uniquely identifies the Message resource to update. 212 213 ### Other Parameters 214 215 Other parameters are passed through a pointer to a UpdateMessageParams struct 216 217 218 Name | Type | Description 219 ------------- | ------------- | ------------- 220 **Body** | **string** | The message to send to the channel. Can also be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. 221 **Attributes** | **string** | A valid JSON string that contains application-specific data. 222 223 ### Return type 224 225 [**ChatV1Message**](ChatV1Message.md) 226 227 ### Authorization 228 229 [accountSid_authToken](../README.md#accountSid_authToken) 230 231 ### HTTP request headers 232 233 - **Content-Type**: application/x-www-form-urlencoded 234 - **Accept**: application/json 235 236 [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) 237 [[Back to Model list]](../README.md#documentation-for-models) 238 [[Back to README]](../README.md) 239