github.com/twilio/twilio-go@v1.20.1/rest/conversations/v1/docs/ConversationsMessagesApi.md (about)

     1  # ConversationsMessagesApi
     2  
     3  All URIs are relative to *https://conversations.twilio.com*
     4  
     5  Method | HTTP request | Description
     6  ------------- | ------------- | -------------
     7  [**CreateConversationMessage**](ConversationsMessagesApi.md#CreateConversationMessage) | **Post** /v1/Conversations/{ConversationSid}/Messages | 
     8  [**DeleteConversationMessage**](ConversationsMessagesApi.md#DeleteConversationMessage) | **Delete** /v1/Conversations/{ConversationSid}/Messages/{Sid} | 
     9  [**FetchConversationMessage**](ConversationsMessagesApi.md#FetchConversationMessage) | **Get** /v1/Conversations/{ConversationSid}/Messages/{Sid} | 
    10  [**ListConversationMessage**](ConversationsMessagesApi.md#ListConversationMessage) | **Get** /v1/Conversations/{ConversationSid}/Messages | 
    11  [**UpdateConversationMessage**](ConversationsMessagesApi.md#UpdateConversationMessage) | **Post** /v1/Conversations/{ConversationSid}/Messages/{Sid} | 
    12  
    13  
    14  
    15  ## CreateConversationMessage
    16  
    17  > ConversationsV1ConversationMessage CreateConversationMessage(ctx, ConversationSidoptional)
    18  
    19  
    20  
    21  Add a new message to the conversation
    22  
    23  ### Path Parameters
    24  
    25  
    26  Name | Type | Description
    27  ------------- | ------------- | -------------
    28  **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
    29  **ConversationSid** | **string** | The unique ID of the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this message.
    30  
    31  ### Other Parameters
    32  
    33  Other parameters are passed through a pointer to a CreateConversationMessageParams struct
    34  
    35  
    36  Name | Type | Description
    37  ------------- | ------------- | -------------
    38  **XTwilioWebhookEnabled** | **string** | The X-Twilio-Webhook-Enabled HTTP request header
    39  **Author** | **string** | The channel specific identifier of the message's author. Defaults to `system`.
    40  **Body** | **string** | The content of the message, can be up to 1,600 characters long.
    41  **DateCreated** | **time.Time** | The date that this resource was created.
    42  **DateUpdated** | **time.Time** | The date that this resource was last updated. `null` if the message has not been edited.
    43  **Attributes** | **string** | A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified.  **Note** that if the attributes are not set \\\"{}\\\" will be returned.
    44  **MediaSid** | **string** | The Media SID to be attached to the new Message.
    45  **ContentSid** | **string** | The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template, required for template-generated messages.  **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored.
    46  **ContentVariables** | **string** | A structurally valid JSON string that contains values to resolve Rich Content template variables.
    47  **Subject** | **string** | The subject of the message, can be up to 256 characters long.
    48  
    49  ### Return type
    50  
    51  [**ConversationsV1ConversationMessage**](ConversationsV1ConversationMessage.md)
    52  
    53  ### Authorization
    54  
    55  [accountSid_authToken](../README.md#accountSid_authToken)
    56  
    57  ### HTTP request headers
    58  
    59  - **Content-Type**: application/x-www-form-urlencoded
    60  - **Accept**: application/json
    61  
    62  [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
    63  [[Back to Model list]](../README.md#documentation-for-models)
    64  [[Back to README]](../README.md)
    65  
    66  
    67  ## DeleteConversationMessage
    68  
    69  > DeleteConversationMessage(ctx, ConversationSidSidoptional)
    70  
    71  
    72  
    73  Remove a message from the conversation
    74  
    75  ### Path Parameters
    76  
    77  
    78  Name | Type | Description
    79  ------------- | ------------- | -------------
    80  **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
    81  **ConversationSid** | **string** | The unique ID of the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this message.
    82  **Sid** | **string** | A 34 character string that uniquely identifies this resource.
    83  
    84  ### Other Parameters
    85  
    86  Other parameters are passed through a pointer to a DeleteConversationMessageParams struct
    87  
    88  
    89  Name | Type | Description
    90  ------------- | ------------- | -------------
    91  **XTwilioWebhookEnabled** | **string** | The X-Twilio-Webhook-Enabled HTTP request header
    92  
    93  ### Return type
    94  
    95   (empty response body)
    96  
    97  ### Authorization
    98  
    99  [accountSid_authToken](../README.md#accountSid_authToken)
   100  
   101  ### HTTP request headers
   102  
   103  - **Content-Type**: Not defined
   104  - **Accept**: Not defined
   105  
   106  [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
   107  [[Back to Model list]](../README.md#documentation-for-models)
   108  [[Back to README]](../README.md)
   109  
   110  
   111  ## FetchConversationMessage
   112  
   113  > ConversationsV1ConversationMessage FetchConversationMessage(ctx, ConversationSidSid)
   114  
   115  
   116  
   117  Fetch a message from the conversation
   118  
   119  ### Path Parameters
   120  
   121  
   122  Name | Type | Description
   123  ------------- | ------------- | -------------
   124  **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
   125  **ConversationSid** | **string** | The unique ID of the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this message.
   126  **Sid** | **string** | A 34 character string that uniquely identifies this resource.
   127  
   128  ### Other Parameters
   129  
   130  Other parameters are passed through a pointer to a FetchConversationMessageParams struct
   131  
   132  
   133  Name | Type | Description
   134  ------------- | ------------- | -------------
   135  
   136  ### Return type
   137  
   138  [**ConversationsV1ConversationMessage**](ConversationsV1ConversationMessage.md)
   139  
   140  ### Authorization
   141  
   142  [accountSid_authToken](../README.md#accountSid_authToken)
   143  
   144  ### HTTP request headers
   145  
   146  - **Content-Type**: Not defined
   147  - **Accept**: application/json
   148  
   149  [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
   150  [[Back to Model list]](../README.md#documentation-for-models)
   151  [[Back to README]](../README.md)
   152  
   153  
   154  ## ListConversationMessage
   155  
   156  > []ConversationsV1ConversationMessage ListConversationMessage(ctx, ConversationSidoptional)
   157  
   158  
   159  
   160  Retrieve a list of all messages in the conversation
   161  
   162  ### Path Parameters
   163  
   164  
   165  Name | Type | Description
   166  ------------- | ------------- | -------------
   167  **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
   168  **ConversationSid** | **string** | The unique ID of the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for messages.
   169  
   170  ### Other Parameters
   171  
   172  Other parameters are passed through a pointer to a ListConversationMessageParams struct
   173  
   174  
   175  Name | Type | Description
   176  ------------- | ------------- | -------------
   177  **Order** | **string** | The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending), with `asc` as the default.
   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  [**[]ConversationsV1ConversationMessage**](ConversationsV1ConversationMessage.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  ## UpdateConversationMessage
   200  
   201  > ConversationsV1ConversationMessage UpdateConversationMessage(ctx, ConversationSidSidoptional)
   202  
   203  
   204  
   205  Update an existing message in the conversation
   206  
   207  ### Path Parameters
   208  
   209  
   210  Name | Type | Description
   211  ------------- | ------------- | -------------
   212  **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
   213  **ConversationSid** | **string** | The unique ID of the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for this message.
   214  **Sid** | **string** | A 34 character string that uniquely identifies this resource.
   215  
   216  ### Other Parameters
   217  
   218  Other parameters are passed through a pointer to a UpdateConversationMessageParams struct
   219  
   220  
   221  Name | Type | Description
   222  ------------- | ------------- | -------------
   223  **XTwilioWebhookEnabled** | **string** | The X-Twilio-Webhook-Enabled HTTP request header
   224  **Author** | **string** | The channel specific identifier of the message's author. Defaults to `system`.
   225  **Body** | **string** | The content of the message, can be up to 1,600 characters long.
   226  **DateCreated** | **time.Time** | The date that this resource was created.
   227  **DateUpdated** | **time.Time** | The date that this resource was last updated. `null` if the message has not been edited.
   228  **Attributes** | **string** | A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified.  **Note** that if the attributes are not set \\\"{}\\\" will be returned.
   229  **Subject** | **string** | The subject of the message, can be up to 256 characters long.
   230  
   231  ### Return type
   232  
   233  [**ConversationsV1ConversationMessage**](ConversationsV1ConversationMessage.md)
   234  
   235  ### Authorization
   236  
   237  [accountSid_authToken](../README.md#accountSid_authToken)
   238  
   239  ### HTTP request headers
   240  
   241  - **Content-Type**: application/x-www-form-urlencoded
   242  - **Accept**: application/json
   243  
   244  [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
   245  [[Back to Model list]](../README.md#documentation-for-models)
   246  [[Back to README]](../README.md)
   247