Class: Late::MessagesApi
- Inherits:
-
Object
- Object
- Late::MessagesApi
- Defined in:
- lib/late-sdk/api/messages_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#edit_inbox_message(conversation_id, message_id, edit_inbox_message_request, opts = {}) ⇒ EditInboxMessage200Response
Edit message Edit the text and/or reply markup of a previously sent Telegram message.
-
#edit_inbox_message_with_http_info(conversation_id, message_id, edit_inbox_message_request, opts = {}) ⇒ Array<(EditInboxMessage200Response, Integer, Hash)>
Edit message Edit the text and/or reply markup of a previously sent Telegram message.
-
#get_inbox_conversation(conversation_id, account_id, opts = {}) ⇒ GetInboxConversation200Response
Get conversation Retrieve details and metadata for a specific conversation.
-
#get_inbox_conversation_messages(conversation_id, account_id, opts = {}) ⇒ GetInboxConversationMessages200Response
List messages Fetch messages for a specific conversation.
-
#get_inbox_conversation_messages_with_http_info(conversation_id, account_id, opts = {}) ⇒ Array<(GetInboxConversationMessages200Response, Integer, Hash)>
List messages Fetch messages for a specific conversation.
-
#get_inbox_conversation_with_http_info(conversation_id, account_id, opts = {}) ⇒ Array<(GetInboxConversation200Response, Integer, Hash)>
Get conversation Retrieve details and metadata for a specific conversation.
-
#initialize(api_client = ApiClient.default) ⇒ MessagesApi
constructor
A new instance of MessagesApi.
-
#list_inbox_conversations(opts = {}) ⇒ ListInboxConversations200Response
List conversations Fetch conversations (DMs) from all connected messaging accounts in a single API call.
-
#list_inbox_conversations_with_http_info(opts = {}) ⇒ Array<(ListInboxConversations200Response, Integer, Hash)>
List conversations Fetch conversations (DMs) from all connected messaging accounts in a single API call.
-
#send_inbox_message(conversation_id, send_inbox_message_request, opts = {}) ⇒ SendInboxMessage200Response
Send message Send a message in a conversation.
-
#send_inbox_message_with_http_info(conversation_id, send_inbox_message_request, opts = {}) ⇒ Array<(SendInboxMessage200Response, Integer, Hash)>
Send message Send a message in a conversation.
-
#update_inbox_conversation(conversation_id, update_inbox_conversation_request, opts = {}) ⇒ UpdateInboxConversation200Response
Update conversation status Archive or activate a conversation.
-
#update_inbox_conversation_with_http_info(conversation_id, update_inbox_conversation_request, opts = {}) ⇒ Array<(UpdateInboxConversation200Response, Integer, Hash)>
Update conversation status Archive or activate a conversation.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ MessagesApi
Returns a new instance of MessagesApi.
19 20 21 |
# File 'lib/late-sdk/api/messages_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/late-sdk/api/messages_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#edit_inbox_message(conversation_id, message_id, edit_inbox_message_request, opts = {}) ⇒ EditInboxMessage200Response
Edit message Edit the text and/or reply markup of a previously sent Telegram message. Only supported for Telegram. Returns 400 for other platforms.
29 30 31 32 |
# File 'lib/late-sdk/api/messages_api.rb', line 29 def (conversation_id, , , opts = {}) data, _status_code, _headers = (conversation_id, , , opts) data end |
#edit_inbox_message_with_http_info(conversation_id, message_id, edit_inbox_message_request, opts = {}) ⇒ Array<(EditInboxMessage200Response, Integer, Hash)>
Edit message Edit the text and/or reply markup of a previously sent Telegram message. Only supported for Telegram. Returns 400 for other platforms.
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/late-sdk/api/messages_api.rb', line 41 def (conversation_id, , , opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MessagesApi.edit_inbox_message ...' end # verify the required parameter 'conversation_id' is set if @api_client.config.client_side_validation && conversation_id.nil? fail ArgumentError, "Missing the required parameter 'conversation_id' when calling MessagesApi.edit_inbox_message" end # verify the required parameter 'message_id' is set if @api_client.config.client_side_validation && .nil? fail ArgumentError, "Missing the required parameter 'message_id' when calling MessagesApi.edit_inbox_message" end # verify the required parameter 'edit_inbox_message_request' is set if @api_client.config.client_side_validation && .nil? fail ArgumentError, "Missing the required parameter 'edit_inbox_message_request' when calling MessagesApi.edit_inbox_message" end # resource path local_var_path = '/v1/inbox/conversations/{conversationId}/messages/{messageId}'.sub('{' + 'conversationId' + '}', CGI.escape(conversation_id.to_s)).sub('{' + 'messageId' + '}', CGI.escape(.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body() # return_type return_type = opts[:debug_return_type] || 'EditInboxMessage200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"MessagesApi.edit_inbox_message", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: MessagesApi#edit_inbox_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_inbox_conversation(conversation_id, account_id, opts = {}) ⇒ GetInboxConversation200Response
Get conversation Retrieve details and metadata for a specific conversation. Requires accountId query parameter.
108 109 110 111 |
# File 'lib/late-sdk/api/messages_api.rb', line 108 def get_inbox_conversation(conversation_id, account_id, opts = {}) data, _status_code, _headers = get_inbox_conversation_with_http_info(conversation_id, account_id, opts) data end |
#get_inbox_conversation_messages(conversation_id, account_id, opts = {}) ⇒ GetInboxConversationMessages200Response
List messages Fetch messages for a specific conversation. Requires accountId query parameter.
178 179 180 181 |
# File 'lib/late-sdk/api/messages_api.rb', line 178 def (conversation_id, account_id, opts = {}) data, _status_code, _headers = (conversation_id, account_id, opts) data end |
#get_inbox_conversation_messages_with_http_info(conversation_id, account_id, opts = {}) ⇒ Array<(GetInboxConversationMessages200Response, Integer, Hash)>
List messages Fetch messages for a specific conversation. Requires accountId query parameter.
189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 |
# File 'lib/late-sdk/api/messages_api.rb', line 189 def (conversation_id, account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MessagesApi.get_inbox_conversation_messages ...' end # verify the required parameter 'conversation_id' is set if @api_client.config.client_side_validation && conversation_id.nil? fail ArgumentError, "Missing the required parameter 'conversation_id' when calling MessagesApi.get_inbox_conversation_messages" end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling MessagesApi.get_inbox_conversation_messages" end # resource path local_var_path = '/v1/inbox/conversations/{conversationId}/messages'.sub('{' + 'conversationId' + '}', CGI.escape(conversation_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'accountId'] = account_id # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetInboxConversationMessages200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"MessagesApi.get_inbox_conversation_messages", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: MessagesApi#get_inbox_conversation_messages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_inbox_conversation_with_http_info(conversation_id, account_id, opts = {}) ⇒ Array<(GetInboxConversation200Response, Integer, Hash)>
Get conversation Retrieve details and metadata for a specific conversation. Requires accountId query parameter.
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 |
# File 'lib/late-sdk/api/messages_api.rb', line 119 def get_inbox_conversation_with_http_info(conversation_id, account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MessagesApi.get_inbox_conversation ...' end # verify the required parameter 'conversation_id' is set if @api_client.config.client_side_validation && conversation_id.nil? fail ArgumentError, "Missing the required parameter 'conversation_id' when calling MessagesApi.get_inbox_conversation" end # verify the required parameter 'account_id' is set if @api_client.config.client_side_validation && account_id.nil? fail ArgumentError, "Missing the required parameter 'account_id' when calling MessagesApi.get_inbox_conversation" end # resource path local_var_path = '/v1/inbox/conversations/{conversationId}'.sub('{' + 'conversationId' + '}', CGI.escape(conversation_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'accountId'] = account_id # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'GetInboxConversation200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"MessagesApi.get_inbox_conversation", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: MessagesApi#get_inbox_conversation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_inbox_conversations(opts = {}) ⇒ ListInboxConversations200Response
List conversations Fetch conversations (DMs) from all connected messaging accounts in a single API call. Supports filtering by profile and platform. Results are aggregated and deduplicated. Supported platforms: Facebook, Instagram, Twitter/X, Bluesky, Reddit, Telegram.
253 254 255 256 |
# File 'lib/late-sdk/api/messages_api.rb', line 253 def list_inbox_conversations(opts = {}) data, _status_code, _headers = list_inbox_conversations_with_http_info(opts) data end |
#list_inbox_conversations_with_http_info(opts = {}) ⇒ Array<(ListInboxConversations200Response, Integer, Hash)>
List conversations Fetch conversations (DMs) from all connected messaging accounts in a single API call. Supports filtering by profile and platform. Results are aggregated and deduplicated. Supported platforms: Facebook, Instagram, Twitter/X, Bluesky, Reddit, Telegram.
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 |
# File 'lib/late-sdk/api/messages_api.rb', line 269 def list_inbox_conversations_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MessagesApi.list_inbox_conversations ...' end allowable_values = ["facebook", "instagram", "twitter", "bluesky", "reddit", "telegram"] if @api_client.config.client_side_validation && opts[:'platform'] && !allowable_values.include?(opts[:'platform']) fail ArgumentError, "invalid value for \"platform\", must be one of #{allowable_values}" end allowable_values = ["active", "archived"] if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status']) fail ArgumentError, "invalid value for \"status\", must be one of #{allowable_values}" end allowable_values = ["asc", "desc"] if @api_client.config.client_side_validation && opts[:'sort_order'] && !allowable_values.include?(opts[:'sort_order']) fail ArgumentError, "invalid value for \"sort_order\", must be one of #{allowable_values}" end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 100 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MessagesApi.list_inbox_conversations, must be smaller than or equal to 100.' end if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] < 1 fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling MessagesApi.list_inbox_conversations, must be greater than or equal to 1.' end # resource path local_var_path = '/v1/inbox/conversations' # query parameters query_params = opts[:query_params] || {} query_params[:'profileId'] = opts[:'profile_id'] if !opts[:'profile_id'].nil? query_params[:'platform'] = opts[:'platform'] if !opts[:'platform'].nil? query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil? query_params[:'sortOrder'] = opts[:'sort_order'] if !opts[:'sort_order'].nil? query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil? query_params[:'accountId'] = opts[:'account_id'] if !opts[:'account_id'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ListInboxConversations200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"MessagesApi.list_inbox_conversations", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: MessagesApi#list_inbox_conversations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#send_inbox_message(conversation_id, send_inbox_message_request, opts = {}) ⇒ SendInboxMessage200Response
Send message Send a message in a conversation. Supports text, attachments, quick replies, buttons, and message tags. Attachment and interactive message support varies by platform.
346 347 348 349 |
# File 'lib/late-sdk/api/messages_api.rb', line 346 def (conversation_id, , opts = {}) data, _status_code, _headers = (conversation_id, , opts) data end |
#send_inbox_message_with_http_info(conversation_id, send_inbox_message_request, opts = {}) ⇒ Array<(SendInboxMessage200Response, Integer, Hash)>
Send message Send a message in a conversation. Supports text, attachments, quick replies, buttons, and message tags. Attachment and interactive message support varies by platform.
357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 |
# File 'lib/late-sdk/api/messages_api.rb', line 357 def (conversation_id, , opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MessagesApi.send_inbox_message ...' end # verify the required parameter 'conversation_id' is set if @api_client.config.client_side_validation && conversation_id.nil? fail ArgumentError, "Missing the required parameter 'conversation_id' when calling MessagesApi.send_inbox_message" end # verify the required parameter 'send_inbox_message_request' is set if @api_client.config.client_side_validation && .nil? fail ArgumentError, "Missing the required parameter 'send_inbox_message_request' when calling MessagesApi.send_inbox_message" end # resource path local_var_path = '/v1/inbox/conversations/{conversationId}/messages'.sub('{' + 'conversationId' + '}', CGI.escape(conversation_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json', 'multipart/form-data']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body() # return_type return_type = opts[:debug_return_type] || 'SendInboxMessage200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"MessagesApi.send_inbox_message", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: MessagesApi#send_inbox_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_inbox_conversation(conversation_id, update_inbox_conversation_request, opts = {}) ⇒ UpdateInboxConversation200Response
Update conversation status Archive or activate a conversation. Requires accountId in request body.
420 421 422 423 |
# File 'lib/late-sdk/api/messages_api.rb', line 420 def update_inbox_conversation(conversation_id, update_inbox_conversation_request, opts = {}) data, _status_code, _headers = update_inbox_conversation_with_http_info(conversation_id, update_inbox_conversation_request, opts) data end |
#update_inbox_conversation_with_http_info(conversation_id, update_inbox_conversation_request, opts = {}) ⇒ Array<(UpdateInboxConversation200Response, Integer, Hash)>
Update conversation status Archive or activate a conversation. Requires accountId in request body.
431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 |
# File 'lib/late-sdk/api/messages_api.rb', line 431 def update_inbox_conversation_with_http_info(conversation_id, update_inbox_conversation_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: MessagesApi.update_inbox_conversation ...' end # verify the required parameter 'conversation_id' is set if @api_client.config.client_side_validation && conversation_id.nil? fail ArgumentError, "Missing the required parameter 'conversation_id' when calling MessagesApi.update_inbox_conversation" end # verify the required parameter 'update_inbox_conversation_request' is set if @api_client.config.client_side_validation && update_inbox_conversation_request.nil? fail ArgumentError, "Missing the required parameter 'update_inbox_conversation_request' when calling MessagesApi.update_inbox_conversation" end # resource path local_var_path = '/v1/inbox/conversations/{conversationId}'.sub('{' + 'conversationId' + '}', CGI.escape(conversation_id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(update_inbox_conversation_request) # return_type return_type = opts[:debug_return_type] || 'UpdateInboxConversation200Response' # auth_names auth_names = opts[:debug_auth_names] || ['bearerAuth'] = opts.merge( :operation => :"MessagesApi.update_inbox_conversation", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PUT, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: MessagesApi#update_inbox_conversation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |