one_msg_sdk 2.0.2 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (284) hide show
  1. checksums.yaml +4 -4
  2. data/AGENTS.md +62 -16
  3. data/README.md +97 -29
  4. data/docs/AddTemplate200Response.md +18 -0
  5. data/docs/AddTemplateRequest.md +7 -7
  6. data/docs/CallingApi.md +1 -1
  7. data/docs/CatalogApi.md +1 -1
  8. data/docs/ChannelApi.md +151 -5
  9. data/docs/CreateFlowsRequest.md +26 -0
  10. data/docs/CreateGroupsGroupIdRequest.md +22 -0
  11. data/docs/CreateGroupsRequest.md +20 -0
  12. data/docs/CreateSettingsRequest.md +28 -0
  13. data/docs/CreateSettingsRequestWebhookUrl.md +49 -0
  14. data/docs/CreateUploadMedia200Response.md +18 -0
  15. data/docs/CreateUploadMediaRequest.md +20 -0
  16. data/docs/FlowsApi.md +32 -16
  17. data/docs/GetStatus200Response.md +26 -0
  18. data/docs/GetWebhook200Response.md +24 -2
  19. data/docs/GetWebhook200ResponseWebhookUrl.md +49 -0
  20. data/docs/GroupsApi.md +38 -18
  21. data/docs/ListSettings200Response.md +52 -0
  22. data/docs/ListSettings200ResponseWebhookUrl.md +49 -0
  23. data/docs/MessagingApi.md +140 -35
  24. data/docs/PatchFlowsFlowIdAssetsRequest.md +18 -0
  25. data/docs/PatchFlowsFlowIdMetadataRequest.md +22 -0
  26. data/docs/ProfileApi.md +9 -11
  27. data/docs/RemoveTemplateRequest.md +18 -0
  28. data/docs/SendButtonRequest.md +9 -1
  29. data/docs/SendCarouselRequest1.md +4 -2
  30. data/docs/SendContactInfoRequest.md +26 -0
  31. data/docs/SendContactRequest.md +7 -1
  32. data/docs/SendContactRequestContact.md +26 -0
  33. data/docs/SendContactRequestContactName.md +49 -0
  34. data/docs/SendContactRequestContactsInner.md +3 -3
  35. data/docs/SendContactRequestContactsInnerPhonesInner.md +1 -1
  36. data/docs/SendListRequest.md +5 -1
  37. data/docs/SendLocationRequestRequest.md +5 -1
  38. data/docs/SendMessageRequest.md +6 -2
  39. data/docs/SendMessageRequestDirectSend.md +20 -0
  40. data/docs/SendProductRequest.md +30 -0
  41. data/docs/SendReactionRequest.md +3 -1
  42. data/docs/SendTemplateRequest.md +9 -5
  43. data/docs/SendTemplateRequestLanguage.md +3 -3
  44. data/docs/SetWebhook200Response.md +20 -0
  45. data/docs/SetWebhook200ResponseWebhookUrl.md +49 -0
  46. data/docs/SetWebhookRequest.md +18 -0
  47. data/docs/SetWebhookRequestWebhookUrl.md +49 -0
  48. data/docs/TemplatesApi.md +29 -17
  49. data/docs/UpdateMe200Response.md +18 -0
  50. data/docs/UpdateMeRequest.md +6 -6
  51. data/docs/WebhookUrlStatus.md +34 -0
  52. data/docs/WebhooksApi.md +10 -12
  53. data/lib/one_msg_sdk/api/calling_api.rb +4 -4
  54. data/lib/one_msg_sdk/api/catalog_api.rb +4 -4
  55. data/lib/one_msg_sdk/api/channel_api.rb +146 -7
  56. data/lib/one_msg_sdk/api/flows_api.rb +58 -14
  57. data/lib/one_msg_sdk/api/groups_api.rb +48 -10
  58. data/lib/one_msg_sdk/api/messaging_api.rb +163 -38
  59. data/lib/one_msg_sdk/api/profile_api.rb +17 -13
  60. data/lib/one_msg_sdk/api/templates_api.rb +36 -13
  61. data/lib/one_msg_sdk/api/users_api.rb +2 -2
  62. data/lib/one_msg_sdk/api/webhooks_api.rb +19 -15
  63. data/lib/one_msg_sdk/api_client.rb +2 -2
  64. data/lib/one_msg_sdk/api_error.rb +2 -2
  65. data/lib/one_msg_sdk/api_model_base.rb +2 -2
  66. data/lib/one_msg_sdk/configuration.rb +2 -2
  67. data/lib/one_msg_sdk/models/add_template200_response.rb +150 -0
  68. data/lib/one_msg_sdk/models/add_template_request.rb +6 -2
  69. data/lib/one_msg_sdk/models/block_user_request.rb +2 -2
  70. data/lib/one_msg_sdk/models/calling_settings.rb +2 -2
  71. data/lib/one_msg_sdk/models/calling_settings_calling.rb +2 -2
  72. data/lib/one_msg_sdk/models/calling_settings_calling_audio.rb +2 -2
  73. data/lib/one_msg_sdk/models/calling_settings_calling_call_hours.rb +2 -2
  74. data/lib/one_msg_sdk/models/calling_settings_calling_sip.rb +2 -2
  75. data/lib/one_msg_sdk/models/calling_settings_calling_sip_servers_inner.rb +2 -2
  76. data/lib/one_msg_sdk/models/calling_settings_calling_video.rb +2 -2
  77. data/lib/one_msg_sdk/models/conversational_automation.rb +2 -2
  78. data/lib/one_msg_sdk/models/conversational_automation_commands_inner.rb +2 -2
  79. data/lib/one_msg_sdk/models/create_commerce200_response.rb +2 -2
  80. data/lib/one_msg_sdk/models/create_commerce_request.rb +2 -2
  81. data/lib/one_msg_sdk/models/create_commerce_request_params.rb +2 -2
  82. data/lib/one_msg_sdk/models/create_flows_request.rb +238 -0
  83. data/lib/one_msg_sdk/models/create_groups200_response.rb +2 -2
  84. data/lib/one_msg_sdk/models/create_groups_group_id_request.rb +168 -0
  85. data/lib/one_msg_sdk/models/create_groups_request.rb +175 -0
  86. data/lib/one_msg_sdk/models/create_read_message200_response.rb +2 -2
  87. data/lib/one_msg_sdk/models/create_read_message401_response.rb +2 -2
  88. data/lib/one_msg_sdk/models/create_read_message_request.rb +2 -2
  89. data/lib/one_msg_sdk/models/create_settings_request.rb +192 -0
  90. data/lib/one_msg_sdk/models/create_settings_request_webhook_url.rb +105 -0
  91. data/lib/one_msg_sdk/models/create_upload_media200_response.rb +147 -0
  92. data/lib/one_msg_sdk/models/create_upload_media_request.rb +158 -0
  93. data/lib/one_msg_sdk/models/delete_flows_flow_id200_response.rb +2 -2
  94. data/lib/one_msg_sdk/models/delete_groups_group_id200_response.rb +2 -2
  95. data/lib/one_msg_sdk/models/delete_media_legacy_request.rb +2 -2
  96. data/lib/one_msg_sdk/models/error_response.rb +2 -2
  97. data/lib/one_msg_sdk/models/get_commerce200_response_inner.rb +2 -2
  98. data/lib/one_msg_sdk/models/get_mm_lite_status200_response.rb +2 -2
  99. data/lib/one_msg_sdk/models/get_status200_response.rb +185 -0
  100. data/lib/one_msg_sdk/models/get_webhook200_response.rb +155 -6
  101. data/lib/one_msg_sdk/models/get_webhook200_response_webhook_url.rb +105 -0
  102. data/lib/one_msg_sdk/models/get_whatsapp_business_encryption200_response.rb +2 -2
  103. data/lib/one_msg_sdk/models/initiate_call_request.rb +2 -2
  104. data/lib/one_msg_sdk/models/initiate_call_request_session.rb +2 -2
  105. data/lib/one_msg_sdk/models/initiate_call_response.rb +2 -2
  106. data/lib/one_msg_sdk/models/initiate_call_response_calls_inner.rb +2 -2
  107. data/lib/one_msg_sdk/models/initiate_call_response_response.rb +2 -2
  108. data/lib/one_msg_sdk/models/list_blocked_users200_response.rb +2 -2
  109. data/lib/one_msg_sdk/models/list_flows200_response.rb +2 -2
  110. data/lib/one_msg_sdk/models/list_messages200_response.rb +2 -2
  111. data/lib/one_msg_sdk/models/list_settings200_response.rb +352 -0
  112. data/lib/one_msg_sdk/models/list_settings200_response_webhook_url.rb +105 -0
  113. data/lib/one_msg_sdk/models/list_templates200_response.rb +2 -2
  114. data/lib/one_msg_sdk/models/message_sent_response.rb +2 -2
  115. data/lib/one_msg_sdk/models/patch_flows_flow_id_assets200_response.rb +2 -2
  116. data/lib/one_msg_sdk/models/patch_flows_flow_id_assets_request.rb +167 -0
  117. data/lib/one_msg_sdk/models/patch_flows_flow_id_metadata_request.rb +190 -0
  118. data/lib/one_msg_sdk/models/profile_info.rb +2 -2
  119. data/lib/one_msg_sdk/models/remove_template_request.rb +165 -0
  120. data/lib/one_msg_sdk/models/retrieve_media200_response.rb +2 -2
  121. data/lib/one_msg_sdk/models/send_address_message_request.rb +2 -2
  122. data/lib/one_msg_sdk/models/send_button_request.rb +48 -3
  123. data/lib/one_msg_sdk/models/send_button_request_sections_inner.rb +2 -2
  124. data/lib/one_msg_sdk/models/send_button_request_sections_inner_reply.rb +2 -2
  125. data/lib/one_msg_sdk/models/send_carousel_request1.rb +38 -13
  126. data/lib/one_msg_sdk/models/send_contact_info_request.rb +222 -0
  127. data/lib/one_msg_sdk/models/send_contact_request.rb +32 -3
  128. data/lib/one_msg_sdk/models/send_contact_request_contact.rb +221 -0
  129. data/lib/one_msg_sdk/models/send_contact_request_contact_name.rb +105 -0
  130. data/lib/one_msg_sdk/models/send_contact_request_contacts_inner.rb +5 -5
  131. data/lib/one_msg_sdk/models/send_contact_request_contacts_inner_name.rb +2 -2
  132. data/lib/one_msg_sdk/models/send_contact_request_contacts_inner_org.rb +2 -2
  133. data/lib/one_msg_sdk/models/send_contact_request_contacts_inner_phones_inner.rb +3 -2
  134. data/lib/one_msg_sdk/models/send_cta_url_request.rb +2 -2
  135. data/lib/one_msg_sdk/models/send_file_request.rb +2 -2
  136. data/lib/one_msg_sdk/models/send_flow_request1.rb +2 -2
  137. data/lib/one_msg_sdk/models/send_flow_request1_header.rb +2 -2
  138. data/lib/one_msg_sdk/models/send_flow_request_header.rb +2 -2
  139. data/lib/one_msg_sdk/models/send_list_request.rb +23 -3
  140. data/lib/one_msg_sdk/models/send_list_request_sections_inner.rb +2 -2
  141. data/lib/one_msg_sdk/models/send_list_request_sections_inner_rows_inner.rb +2 -2
  142. data/lib/one_msg_sdk/models/send_location_request1.rb +2 -2
  143. data/lib/one_msg_sdk/models/send_location_request_request.rb +23 -3
  144. data/lib/one_msg_sdk/models/send_message_request.rb +60 -28
  145. data/lib/one_msg_sdk/models/send_message_request_direct_send.rb +189 -0
  146. data/lib/one_msg_sdk/models/send_order_details_request.rb +2 -2
  147. data/lib/one_msg_sdk/models/send_order_details_request_language.rb +2 -2
  148. data/lib/one_msg_sdk/models/send_order_details_request_order.rb +2 -2
  149. data/lib/one_msg_sdk/models/send_order_details_request_order_items_inner.rb +2 -2
  150. data/lib/one_msg_sdk/models/send_order_details_request_order_items_inner_amount.rb +2 -2
  151. data/lib/one_msg_sdk/models/send_payment_request_request.rb +2 -2
  152. data/lib/one_msg_sdk/models/send_product_request.rb +225 -0
  153. data/lib/one_msg_sdk/models/send_reaction_request.rb +14 -3
  154. data/lib/one_msg_sdk/models/send_sticker_request.rb +2 -2
  155. data/lib/one_msg_sdk/models/send_template_request.rb +29 -5
  156. data/lib/one_msg_sdk/models/send_template_request_language.rb +6 -2
  157. data/lib/one_msg_sdk/models/set_webhook200_response.rb +157 -0
  158. data/lib/one_msg_sdk/models/set_webhook200_response_webhook_url.rb +105 -0
  159. data/lib/one_msg_sdk/models/set_webhook_request.rb +164 -0
  160. data/lib/one_msg_sdk/models/set_webhook_request_webhook_url.rb +105 -0
  161. data/lib/one_msg_sdk/models/set_whatsapp_business_encryption_request.rb +2 -2
  162. data/lib/one_msg_sdk/models/success_response.rb +2 -2
  163. data/lib/one_msg_sdk/models/update_calling_settings200_response.rb +2 -2
  164. data/lib/one_msg_sdk/models/update_calling_settings200_response_response.rb +2 -2
  165. data/lib/one_msg_sdk/models/update_me200_response.rb +147 -0
  166. data/lib/one_msg_sdk/models/update_me_request.rb +6 -3
  167. data/lib/one_msg_sdk/models/webhook_url_status.rb +287 -0
  168. data/lib/one_msg_sdk/platform_client.rb +182 -0
  169. data/lib/one_msg_sdk/version.rb +3 -3
  170. data/lib/one_msg_sdk.rb +30 -2
  171. data/one_msg_sdk.gemspec +2 -2
  172. data/spec/api/calling_api_spec.rb +3 -3
  173. data/spec/api/catalog_api_spec.rb +3 -3
  174. data/spec/api/channel_api_spec.rb +29 -4
  175. data/spec/api/flows_api_spec.rb +10 -2
  176. data/spec/api/groups_api_spec.rb +10 -2
  177. data/spec/api/messaging_api_spec.rb +37 -9
  178. data/spec/api/profile_api_spec.rb +5 -5
  179. data/spec/api/templates_api_spec.rb +11 -5
  180. data/spec/api/users_api_spec.rb +2 -2
  181. data/spec/api/webhooks_api_spec.rb +6 -6
  182. data/spec/models/add_template200_response_spec.rb +36 -0
  183. data/spec/models/add_template_request_spec.rb +2 -2
  184. data/spec/models/block_user_request_spec.rb +2 -2
  185. data/spec/models/calling_settings_calling_audio_spec.rb +2 -2
  186. data/spec/models/calling_settings_calling_call_hours_spec.rb +2 -2
  187. data/spec/models/calling_settings_calling_sip_servers_inner_spec.rb +2 -2
  188. data/spec/models/calling_settings_calling_sip_spec.rb +2 -2
  189. data/spec/models/calling_settings_calling_spec.rb +2 -2
  190. data/spec/models/calling_settings_calling_video_spec.rb +2 -2
  191. data/spec/models/calling_settings_spec.rb +2 -2
  192. data/spec/models/conversational_automation_commands_inner_spec.rb +2 -2
  193. data/spec/models/conversational_automation_spec.rb +2 -2
  194. data/spec/models/create_commerce200_response_spec.rb +2 -2
  195. data/spec/models/create_commerce_request_params_spec.rb +2 -2
  196. data/spec/models/create_commerce_request_spec.rb +2 -2
  197. data/spec/models/create_flows_request_spec.rb +64 -0
  198. data/spec/models/create_groups200_response_spec.rb +2 -2
  199. data/spec/models/create_groups_group_id_request_spec.rb +48 -0
  200. data/spec/models/create_groups_request_spec.rb +42 -0
  201. data/spec/models/create_read_message200_response_spec.rb +2 -2
  202. data/spec/models/create_read_message401_response_spec.rb +2 -2
  203. data/spec/models/create_read_message_request_spec.rb +2 -2
  204. data/spec/models/create_settings_request_spec.rb +66 -0
  205. data/spec/models/create_settings_request_webhook_url_spec.rb +32 -0
  206. data/spec/models/create_upload_media200_response_spec.rb +36 -0
  207. data/spec/models/create_upload_media_request_spec.rb +42 -0
  208. data/spec/models/delete_flows_flow_id200_response_spec.rb +2 -2
  209. data/spec/models/delete_groups_group_id200_response_spec.rb +2 -2
  210. data/spec/models/delete_media_legacy_request_spec.rb +2 -2
  211. data/spec/models/error_response_spec.rb +2 -2
  212. data/spec/models/get_commerce200_response_inner_spec.rb +2 -2
  213. data/spec/models/get_mm_lite_status200_response_spec.rb +2 -2
  214. data/spec/models/get_status200_response_spec.rb +60 -0
  215. data/spec/models/get_webhook200_response_spec.rb +72 -2
  216. data/spec/models/get_webhook200_response_webhook_url_spec.rb +32 -0
  217. data/spec/models/get_whatsapp_business_encryption200_response_spec.rb +2 -2
  218. data/spec/models/initiate_call_request_session_spec.rb +2 -2
  219. data/spec/models/initiate_call_request_spec.rb +2 -2
  220. data/spec/models/initiate_call_response_calls_inner_spec.rb +2 -2
  221. data/spec/models/initiate_call_response_response_spec.rb +2 -2
  222. data/spec/models/initiate_call_response_spec.rb +2 -2
  223. data/spec/models/list_blocked_users200_response_spec.rb +2 -2
  224. data/spec/models/list_flows200_response_spec.rb +2 -2
  225. data/spec/models/list_messages200_response_spec.rb +2 -2
  226. data/spec/models/list_settings200_response_spec.rb +142 -0
  227. data/spec/models/list_settings200_response_webhook_url_spec.rb +32 -0
  228. data/spec/models/list_templates200_response_spec.rb +2 -2
  229. data/spec/models/message_sent_response_spec.rb +2 -2
  230. data/spec/models/patch_flows_flow_id_assets200_response_spec.rb +2 -2
  231. data/spec/models/patch_flows_flow_id_assets_request_spec.rb +36 -0
  232. data/spec/models/patch_flows_flow_id_metadata_request_spec.rb +52 -0
  233. data/spec/models/profile_info_spec.rb +2 -2
  234. data/spec/models/remove_template_request_spec.rb +36 -0
  235. data/spec/models/retrieve_media200_response_spec.rb +2 -2
  236. data/spec/models/send_address_message_request_spec.rb +2 -2
  237. data/spec/models/send_button_request_sections_inner_reply_spec.rb +2 -2
  238. data/spec/models/send_button_request_sections_inner_spec.rb +2 -2
  239. data/spec/models/send_button_request_spec.rb +26 -2
  240. data/spec/models/send_carousel_request1_spec.rb +8 -2
  241. data/spec/models/send_contact_info_request_spec.rb +60 -0
  242. data/spec/models/send_contact_request_contact_name_spec.rb +32 -0
  243. data/spec/models/send_contact_request_contact_spec.rb +60 -0
  244. data/spec/models/send_contact_request_contacts_inner_name_spec.rb +2 -2
  245. data/spec/models/send_contact_request_contacts_inner_org_spec.rb +2 -2
  246. data/spec/models/send_contact_request_contacts_inner_phones_inner_spec.rb +2 -2
  247. data/spec/models/send_contact_request_contacts_inner_spec.rb +2 -2
  248. data/spec/models/send_contact_request_spec.rb +20 -2
  249. data/spec/models/send_cta_url_request_spec.rb +2 -2
  250. data/spec/models/send_file_request_spec.rb +2 -2
  251. data/spec/models/send_flow_request1_header_spec.rb +2 -2
  252. data/spec/models/send_flow_request1_spec.rb +2 -2
  253. data/spec/models/send_flow_request_header_spec.rb +2 -2
  254. data/spec/models/send_list_request_sections_inner_rows_inner_spec.rb +2 -2
  255. data/spec/models/send_list_request_sections_inner_spec.rb +2 -2
  256. data/spec/models/send_list_request_spec.rb +14 -2
  257. data/spec/models/send_location_request1_spec.rb +2 -2
  258. data/spec/models/send_location_request_request_spec.rb +14 -2
  259. data/spec/models/send_message_request_direct_send_spec.rb +42 -0
  260. data/spec/models/send_message_request_spec.rb +18 -2
  261. data/spec/models/send_order_details_request_language_spec.rb +2 -2
  262. data/spec/models/send_order_details_request_order_items_inner_amount_spec.rb +2 -2
  263. data/spec/models/send_order_details_request_order_items_inner_spec.rb +2 -2
  264. data/spec/models/send_order_details_request_order_spec.rb +2 -2
  265. data/spec/models/send_order_details_request_spec.rb +2 -2
  266. data/spec/models/send_payment_request_request_spec.rb +2 -2
  267. data/spec/models/send_product_request_spec.rb +72 -0
  268. data/spec/models/send_reaction_request_spec.rb +8 -2
  269. data/spec/models/send_sticker_request_spec.rb +2 -2
  270. data/spec/models/send_template_request_language_spec.rb +2 -2
  271. data/spec/models/send_template_request_spec.rb +14 -2
  272. data/spec/models/set_webhook200_response_spec.rb +42 -0
  273. data/spec/models/set_webhook200_response_webhook_url_spec.rb +32 -0
  274. data/spec/models/set_webhook_request_spec.rb +36 -0
  275. data/spec/models/set_webhook_request_webhook_url_spec.rb +32 -0
  276. data/spec/models/set_whatsapp_business_encryption_request_spec.rb +2 -2
  277. data/spec/models/success_response_spec.rb +2 -2
  278. data/spec/models/update_calling_settings200_response_response_spec.rb +2 -2
  279. data/spec/models/update_calling_settings200_response_spec.rb +2 -2
  280. data/spec/models/update_me200_response_spec.rb +36 -0
  281. data/spec/models/update_me_request_spec.rb +2 -2
  282. data/spec/models/webhook_url_status_spec.rb +88 -0
  283. data/spec/spec_helper.rb +2 -2
  284. metadata +204 -31
@@ -1,9 +1,9 @@
1
1
  =begin
2
2
  #1MSG WhatsApp Business API (Public)
3
3
 
4
- #Public client API for sending messages, managing groups, flows, and templates. This is the API exposed to end customers via platform.1msg.io **Authentication:** All requests require `token` query parameter with JWT or API key. **Documentation:** https://help.1msg.io/platform-1msg/getting-start/quick-start **API Docs:** https://docs.1msg.io/
4
+ #Public client API for sending messages, managing groups, flows, and templates. This is the API exposed to end customers via platform.1msg.io **Authentication:** Pass the channel token in **one** place. The API checks JSON body (`token`), then query string (`?token=`), then `Authorization: Bearer` header (preferred in production). **Documentation:** https://help.1msg.io/platform-1msg/getting-start/quick-start **API Docs:** https://docs.1msg.io/
5
5
 
6
- The version of the OpenAPI document: 1.0.0
6
+ The version of the OpenAPI document: 2.0.0
7
7
  Contact: support@1msg.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.22.0
@@ -21,18 +21,20 @@ module OneMsgSdk
21
21
  end
22
22
  # Create Group
23
23
  # @param token [String] JWT token or API key for authorization
24
+ # @param create_groups_request [CreateGroupsRequest]
24
25
  # @param [Hash] opts the optional parameters
25
26
  # @return [CreateGroups200Response]
26
- def create_groups(token, opts = {})
27
- data, _status_code, _headers = create_groups_with_http_info(token, opts)
27
+ def create_groups(token, create_groups_request, opts = {})
28
+ data, _status_code, _headers = create_groups_with_http_info(token, create_groups_request, opts)
28
29
  data
29
30
  end
30
31
 
31
32
  # Create Group
32
33
  # @param token [String] JWT token or API key for authorization
34
+ # @param create_groups_request [CreateGroupsRequest]
33
35
  # @param [Hash] opts the optional parameters
34
36
  # @return [Array<(CreateGroups200Response, Integer, Hash)>] CreateGroups200Response data, response status code and response headers
35
- def create_groups_with_http_info(token, opts = {})
37
+ def create_groups_with_http_info(token, create_groups_request, opts = {})
36
38
  if @api_client.config.debugging
37
39
  @api_client.config.logger.debug 'Calling API: GroupsApi.create_groups ...'
38
40
  end
@@ -40,6 +42,10 @@ module OneMsgSdk
40
42
  if @api_client.config.client_side_validation && token.nil?
41
43
  fail ArgumentError, "Missing the required parameter 'token' when calling GroupsApi.create_groups"
42
44
  end
45
+ # verify the required parameter 'create_groups_request' is set
46
+ if @api_client.config.client_side_validation && create_groups_request.nil?
47
+ fail ArgumentError, "Missing the required parameter 'create_groups_request' when calling GroupsApi.create_groups"
48
+ end
43
49
  # resource path
44
50
  local_var_path = '/groups'
45
51
 
@@ -51,12 +57,17 @@ module OneMsgSdk
51
57
  header_params = opts[:header_params] || {}
52
58
  # HTTP header 'Accept' (if needed)
53
59
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
60
+ # HTTP header 'Content-Type'
61
+ content_type = @api_client.select_header_content_type(['application/json'])
62
+ if !content_type.nil?
63
+ header_params['Content-Type'] = content_type
64
+ end
54
65
 
55
66
  # form parameters
56
67
  form_params = opts[:form_params] || {}
57
68
 
58
69
  # http body (model)
59
- post_body = opts[:debug_body]
70
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_groups_request)
60
71
 
61
72
  # return_type
62
73
  return_type = opts[:debug_return_type] || 'CreateGroups200Response'
@@ -82,21 +93,25 @@ module OneMsgSdk
82
93
  end
83
94
 
84
95
  # Update Group Info
96
+ # Update group subject, description, and/or profile picture. Path `groupId` is the WABA group id (without `@g.us`).
85
97
  # @param group_id [String]
86
98
  # @param token [String] JWT token or API key for authorization
99
+ # @param create_groups_group_id_request [CreateGroupsGroupIdRequest]
87
100
  # @param [Hash] opts the optional parameters
88
101
  # @return [Hash<String, Object>]
89
- def create_groups_group_id(group_id, token, opts = {})
90
- data, _status_code, _headers = create_groups_group_id_with_http_info(group_id, token, opts)
102
+ def create_groups_group_id(group_id, token, create_groups_group_id_request, opts = {})
103
+ data, _status_code, _headers = create_groups_group_id_with_http_info(group_id, token, create_groups_group_id_request, opts)
91
104
  data
92
105
  end
93
106
 
94
107
  # Update Group Info
108
+ # Update group subject, description, and/or profile picture. Path &#x60;groupId&#x60; is the WABA group id (without &#x60;@g.us&#x60;).
95
109
  # @param group_id [String]
96
110
  # @param token [String] JWT token or API key for authorization
111
+ # @param create_groups_group_id_request [CreateGroupsGroupIdRequest]
97
112
  # @param [Hash] opts the optional parameters
98
113
  # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
99
- def create_groups_group_id_with_http_info(group_id, token, opts = {})
114
+ def create_groups_group_id_with_http_info(group_id, token, create_groups_group_id_request, opts = {})
100
115
  if @api_client.config.debugging
101
116
  @api_client.config.logger.debug 'Calling API: GroupsApi.create_groups_group_id ...'
102
117
  end
@@ -108,6 +123,10 @@ module OneMsgSdk
108
123
  if @api_client.config.client_side_validation && token.nil?
109
124
  fail ArgumentError, "Missing the required parameter 'token' when calling GroupsApi.create_groups_group_id"
110
125
  end
126
+ # verify the required parameter 'create_groups_group_id_request' is set
127
+ if @api_client.config.client_side_validation && create_groups_group_id_request.nil?
128
+ fail ArgumentError, "Missing the required parameter 'create_groups_group_id_request' when calling GroupsApi.create_groups_group_id"
129
+ end
111
130
  # resource path
112
131
  local_var_path = '/groups/{groupId}'.sub('{groupId}', CGI.escape(group_id.to_s))
113
132
 
@@ -119,12 +138,17 @@ module OneMsgSdk
119
138
  header_params = opts[:header_params] || {}
120
139
  # HTTP header 'Accept' (if needed)
121
140
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
141
+ # HTTP header 'Content-Type'
142
+ content_type = @api_client.select_header_content_type(['application/json'])
143
+ if !content_type.nil?
144
+ header_params['Content-Type'] = content_type
145
+ end
122
146
 
123
147
  # form parameters
124
148
  form_params = opts[:form_params] || {}
125
149
 
126
150
  # http body (model)
127
- post_body = opts[:debug_body]
151
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_groups_group_id_request)
128
152
 
129
153
  # return_type
130
154
  return_type = opts[:debug_return_type] || 'Hash<String, Object>'
@@ -289,6 +313,7 @@ module OneMsgSdk
289
313
  # @param group_id [String]
290
314
  # @param token [String] JWT token or API key for authorization
291
315
  # @param [Hash] opts the optional parameters
316
+ # @option opts [String] :fields Comma-separated group fields to return
292
317
  # @return [Hash<String, Object>]
293
318
  def get_groups_group_id(group_id, token, opts = {})
294
319
  data, _status_code, _headers = get_groups_group_id_with_http_info(group_id, token, opts)
@@ -299,6 +324,7 @@ module OneMsgSdk
299
324
  # @param group_id [String]
300
325
  # @param token [String] JWT token or API key for authorization
301
326
  # @param [Hash] opts the optional parameters
327
+ # @option opts [String] :fields Comma-separated group fields to return
302
328
  # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
303
329
  def get_groups_group_id_with_http_info(group_id, token, opts = {})
304
330
  if @api_client.config.debugging
@@ -318,6 +344,7 @@ module OneMsgSdk
318
344
  # query parameters
319
345
  query_params = opts[:query_params] || {}
320
346
  query_params[:'token'] = token
347
+ query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?
321
348
 
322
349
  # header parameters
323
350
  header_params = opts[:header_params] || {}
@@ -422,8 +449,12 @@ module OneMsgSdk
422
449
  end
423
450
 
424
451
  # Get Groups List
452
+ # List WhatsApp groups for this channel. Paginate with `limit`, `before`, and `after`.
425
453
  # @param token [String] JWT token or API key for authorization
426
454
  # @param [Hash] opts the optional parameters
455
+ # @option opts [Integer] :limit Max groups to return
456
+ # @option opts [String] :before Cursor for the previous page
457
+ # @option opts [String] :after Cursor for the next page
427
458
  # @return [Hash<String, Object>]
428
459
  def list_groups(token, opts = {})
429
460
  data, _status_code, _headers = list_groups_with_http_info(token, opts)
@@ -431,8 +462,12 @@ module OneMsgSdk
431
462
  end
432
463
 
433
464
  # Get Groups List
465
+ # List WhatsApp groups for this channel. Paginate with &#x60;limit&#x60;, &#x60;before&#x60;, and &#x60;after&#x60;.
434
466
  # @param token [String] JWT token or API key for authorization
435
467
  # @param [Hash] opts the optional parameters
468
+ # @option opts [Integer] :limit Max groups to return
469
+ # @option opts [String] :before Cursor for the previous page
470
+ # @option opts [String] :after Cursor for the next page
436
471
  # @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
437
472
  def list_groups_with_http_info(token, opts = {})
438
473
  if @api_client.config.debugging
@@ -448,6 +483,9 @@ module OneMsgSdk
448
483
  # query parameters
449
484
  query_params = opts[:query_params] || {}
450
485
  query_params[:'token'] = token
486
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
487
+ query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
488
+ query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
451
489
 
452
490
  # header parameters
453
491
  header_params = opts[:header_params] || {}
@@ -1,9 +1,9 @@
1
1
  =begin
2
2
  #1MSG WhatsApp Business API (Public)
3
3
 
4
- #Public client API for sending messages, managing groups, flows, and templates. This is the API exposed to end customers via platform.1msg.io **Authentication:** All requests require `token` query parameter with JWT or API key. **Documentation:** https://help.1msg.io/platform-1msg/getting-start/quick-start **API Docs:** https://docs.1msg.io/
4
+ #Public client API for sending messages, managing groups, flows, and templates. This is the API exposed to end customers via platform.1msg.io **Authentication:** Pass the channel token in **one** place. The API checks JSON body (`token`), then query string (`?token=`), then `Authorization: Bearer` header (preferred in production). **Documentation:** https://help.1msg.io/platform-1msg/getting-start/quick-start **API Docs:** https://docs.1msg.io/
5
5
 
6
- The version of the OpenAPI document: 1.0.0
6
+ The version of the OpenAPI document: 2.0.0
7
7
  Contact: support@1msg.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.22.0
@@ -96,21 +96,23 @@ module OneMsgSdk
96
96
  end
97
97
 
98
98
  # Upload media
99
+ # Upload a file to WhatsApp media storage and get a numeric `mediaId` for later use with `send_file` / `send_sticker` (`mediaId` field, not `body`). Pass the file as `body` **or** `url` — an HTTP(S) URL or a base64 data URI. The `mediaId` in the response is a numeric string (keep it as a string).
99
100
  # @param token [String] JWT token or API key for authorization
101
+ # @param create_upload_media_request [CreateUploadMediaRequest]
100
102
  # @param [Hash] opts the optional parameters
101
- # @option opts [Hash<String, Object>] :request_body
102
- # @return [nil]
103
- def create_upload_media(token, opts = {})
104
- create_upload_media_with_http_info(token, opts)
105
- nil
103
+ # @return [CreateUploadMedia200Response]
104
+ def create_upload_media(token, create_upload_media_request, opts = {})
105
+ data, _status_code, _headers = create_upload_media_with_http_info(token, create_upload_media_request, opts)
106
+ data
106
107
  end
107
108
 
108
109
  # Upload media
110
+ # Upload a file to WhatsApp media storage and get a numeric &#x60;mediaId&#x60; for later use with &#x60;send_file&#x60; / &#x60;send_sticker&#x60; (&#x60;mediaId&#x60; field, not &#x60;body&#x60;). Pass the file as &#x60;body&#x60; **or** &#x60;url&#x60; — an HTTP(S) URL or a base64 data URI. The &#x60;mediaId&#x60; in the response is a numeric string (keep it as a string).
109
111
  # @param token [String] JWT token or API key for authorization
112
+ # @param create_upload_media_request [CreateUploadMediaRequest]
110
113
  # @param [Hash] opts the optional parameters
111
- # @option opts [Hash<String, Object>] :request_body
112
- # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
113
- def create_upload_media_with_http_info(token, opts = {})
114
+ # @return [Array<(CreateUploadMedia200Response, Integer, Hash)>] CreateUploadMedia200Response data, response status code and response headers
115
+ def create_upload_media_with_http_info(token, create_upload_media_request, opts = {})
114
116
  if @api_client.config.debugging
115
117
  @api_client.config.logger.debug 'Calling API: MessagingApi.create_upload_media ...'
116
118
  end
@@ -118,6 +120,10 @@ module OneMsgSdk
118
120
  if @api_client.config.client_side_validation && token.nil?
119
121
  fail ArgumentError, "Missing the required parameter 'token' when calling MessagingApi.create_upload_media"
120
122
  end
123
+ # verify the required parameter 'create_upload_media_request' is set
124
+ if @api_client.config.client_side_validation && create_upload_media_request.nil?
125
+ fail ArgumentError, "Missing the required parameter 'create_upload_media_request' when calling MessagingApi.create_upload_media"
126
+ end
121
127
  # resource path
122
128
  local_var_path = '/uploadMedia'
123
129
 
@@ -127,6 +133,8 @@ module OneMsgSdk
127
133
 
128
134
  # header parameters
129
135
  header_params = opts[:header_params] || {}
136
+ # HTTP header 'Accept' (if needed)
137
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
130
138
  # HTTP header 'Content-Type'
131
139
  content_type = @api_client.select_header_content_type(['application/json'])
132
140
  if !content_type.nil?
@@ -137,10 +145,10 @@ module OneMsgSdk
137
145
  form_params = opts[:form_params] || {}
138
146
 
139
147
  # http body (model)
140
- post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'request_body'])
148
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_upload_media_request)
141
149
 
142
150
  # return_type
143
- return_type = opts[:debug_return_type]
151
+ return_type = opts[:debug_return_type] || 'CreateUploadMedia200Response'
144
152
 
145
153
  # auth_names
146
154
  auth_names = opts[:debug_auth_names] || ['tokenAuth']
@@ -370,8 +378,17 @@ module OneMsgSdk
370
378
  end
371
379
 
372
380
  # Get messages list
381
+ # List stored chat history for this channel (requires history storage). Filter with `chatId`, `limit`, `last`, message numbers, or time bounds.
373
382
  # @param token [String] JWT token or API key for authorization
374
383
  # @param [Hash] opts the optional parameters
384
+ # @option opts [String] :chat_id Filter messages for one chat (&#x60;phone@c.us&#x60;, group &#x60;@g.us&#x60;, or BSUID &#x60;@lid&#x60;)
385
+ # @option opts [Integer] :limit Max rows to return (default 100)
386
+ # @option opts [Boolean] :last If true, return the latest messages (DESC). Default false.
387
+ # @option opts [Integer] :last_message_number
388
+ # @option opts [Integer] :first_message_number
389
+ # @option opts [Integer] :min_time Unix timestamp lower bound
390
+ # @option opts [Integer] :max_time Unix timestamp upper bound
391
+ # @option opts [String] :msg_id Filter by stored message id
375
392
  # @return [ListMessages200Response]
376
393
  def list_messages(token, opts = {})
377
394
  data, _status_code, _headers = list_messages_with_http_info(token, opts)
@@ -379,8 +396,17 @@ module OneMsgSdk
379
396
  end
380
397
 
381
398
  # Get messages list
399
+ # List stored chat history for this channel (requires history storage). Filter with &#x60;chatId&#x60;, &#x60;limit&#x60;, &#x60;last&#x60;, message numbers, or time bounds.
382
400
  # @param token [String] JWT token or API key for authorization
383
401
  # @param [Hash] opts the optional parameters
402
+ # @option opts [String] :chat_id Filter messages for one chat (&#x60;phone@c.us&#x60;, group &#x60;@g.us&#x60;, or BSUID &#x60;@lid&#x60;)
403
+ # @option opts [Integer] :limit Max rows to return (default 100)
404
+ # @option opts [Boolean] :last If true, return the latest messages (DESC). Default false.
405
+ # @option opts [Integer] :last_message_number
406
+ # @option opts [Integer] :first_message_number
407
+ # @option opts [Integer] :min_time Unix timestamp lower bound
408
+ # @option opts [Integer] :max_time Unix timestamp upper bound
409
+ # @option opts [String] :msg_id Filter by stored message id
384
410
  # @return [Array<(ListMessages200Response, Integer, Hash)>] ListMessages200Response data, response status code and response headers
385
411
  def list_messages_with_http_info(token, opts = {})
386
412
  if @api_client.config.debugging
@@ -396,6 +422,14 @@ module OneMsgSdk
396
422
  # query parameters
397
423
  query_params = opts[:query_params] || {}
398
424
  query_params[:'token'] = token
425
+ query_params[:'chatId'] = opts[:'chat_id'] if !opts[:'chat_id'].nil?
426
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
427
+ query_params[:'last'] = opts[:'last'] if !opts[:'last'].nil?
428
+ query_params[:'lastMessageNumber'] = opts[:'last_message_number'] if !opts[:'last_message_number'].nil?
429
+ query_params[:'firstMessageNumber'] = opts[:'first_message_number'] if !opts[:'first_message_number'].nil?
430
+ query_params[:'min_time'] = opts[:'min_time'] if !opts[:'min_time'].nil?
431
+ query_params[:'max_time'] = opts[:'max_time'] if !opts[:'max_time'].nil?
432
+ query_params[:'msgId'] = opts[:'msg_id'] if !opts[:'msg_id'].nil?
399
433
 
400
434
  # header parameters
401
435
  header_params = opts[:header_params] || {}
@@ -647,31 +681,33 @@ module OneMsgSdk
647
681
  end
648
682
 
649
683
  # Send Carousel
650
- # You can send product cards via Carousel in two ways: Template messages: do not require a 24-hour customer service window between you and the recipient. Use sendTemplate. Free-form messages: can be sent only when a customer service window is open between you and the recipient. Use sendCarousel. The message structure in /sendCarousel is largely similar to sending a template. However, in this case you must explicitly specify all elements that are created in advance when working with templates. This is because the message is sent without using a template. In /sendCarousel, for sending a Catalog Carousel there can be either 1 URL button or one or more quick reply buttons.
684
+ # You can send product cards via Carousel in two ways: Template messages: do not require a 24-hour customer service window between you and the recipient. Use sendTemplate. Free-form messages: can be sent only when a customer service window is open between you and the recipient. Use sendCarousel. The message structure in /sendCarousel is largely similar to sending a template. However, in this case you must explicitly specify all elements that are created in advance when working with templates. This is because the message is sent without using a template. In /sendCarousel, for a Catalog Carousel there can be either 1 URL button or one or more quick reply buttons. Prefer the simple `cards` array (2–10 cards). Each card needs a header media/product plus a CTA URL or quick-reply buttons. Example: ```json { \"phone\": \"79001234567\", \"body\": \"Pick a product\", \"cards\": [ { \"header\": { \"type\": \"image\", \"image\": { \"link\": \"https://example.com/1.jpg\" } }, \"body\": { \"text\": \"Card one\" }, \"type\": \"cta_url\", \"action\": { \"name\": \"cta_url\", \"parameters\": { \"url\": \"https://example.com/p1\", \"display_text\": \"Open\" } } }, { \"header\": { \"type\": \"image\", \"image\": { \"link\": \"https://example.com/2.jpg\" } }, \"body\": { \"text\": \"Card two\" }, \"type\": \"cta_url\", \"action\": { \"name\": \"cta_url\", \"parameters\": { \"url\": \"https://example.com/p2\", \"display_text\": \"Open\" } } } ] } ``` `params` with a `CAROUSEL` component is the template-like alternative.
651
685
  # @param token [String] JWT token or API key for authorization
652
- # @param params [Array<Object>] Required. Template-like structure (same as sendTemplate params). Must include a CAROUSEL component and its cards. Structure: - params[] item with type CAROUSEL and cards (2..10) - cards[] item: - components[] items: - header: parameters[0] with type image/video/product - image: {\\\&quot;image\\\&quot;: {\\\&quot;link\\\&quot;: \\\&quot;https://...\\\&quot;}} - video: {\\\&quot;video\\\&quot;: {\\\&quot;link\\\&quot;: \\\&quot;https://...\\\&quot;}} - product: {\\\&quot;product\\\&quot;: {\\\&quot;catalog_id\\\&quot;: \\\&quot;...\\\&quot;, \\\&quot;product_retailer_id\\\&quot;: \\\&quot;...\\\&quot;}} - button: sub_type url or quick_reply - url: parameters {\\\&quot;text\\\&quot;: \\\&quot;Button\\\&quot;, \\\&quot;url\\\&quot;: \\\&quot;https://...\\\&quot;} - quick_reply: parameters[] of {\\\&quot;id\\\&quot;: \\\&quot;...\\\&quot;, \\\&quot;text\\\&quot;: \\\&quot;...\\\&quot;}
653
686
  # @param [Hash] opts the optional parameters
654
687
  # @option opts [String] :body Text shown above the carousel. Optional. If omitted and params include a body component, the body will be taken from params.
688
+ # @option opts [Array<Hash<String, Object>>] :cards Preferred. 2–10 carousel cards (header + body + CTA or quick replies).
689
+ # @option opts [Array<Object>] :params Required. Template-like structure (same as sendTemplate params). Must include a CAROUSEL component and its cards. Structure: - params[] item with type CAROUSEL and cards (2..10) - cards[] item: - components[] items: - header: parameters[0] with type image/video/product - image: {\\\&quot;image\\\&quot;: {\\\&quot;link\\\&quot;: \\\&quot;https://...\\\&quot;}} - video: {\\\&quot;video\\\&quot;: {\\\&quot;link\\\&quot;: \\\&quot;https://...\\\&quot;}} - product: {\\\&quot;product\\\&quot;: {\\\&quot;catalog_id\\\&quot;: \\\&quot;...\\\&quot;, \\\&quot;product_retailer_id\\\&quot;: \\\&quot;...\\\&quot;}} - button: sub_type url or quick_reply - url: parameters {\\\&quot;text\\\&quot;: \\\&quot;Button\\\&quot;, \\\&quot;url\\\&quot;: \\\&quot;https://...\\\&quot;} - quick_reply: parameters[] of {\\\&quot;id\\\&quot;: \\\&quot;...\\\&quot;, \\\&quot;text\\\&quot;: \\\&quot;...\\\&quot;}
655
690
  # @option opts [String] :quoted_msg_id Quoted message ID (Cloud API)
656
691
  # @option opts [String] :chat_id Required if phone is not set. Chat ID from the message list. Examples: 12020721369@c.us or 120363046942338209@g.us(group)
657
692
  # @option opts [Integer] :phone Required if chatId is not set. A phone number starting with the country code. USA example: 12020721369.
658
693
  # @return [MessageSentResponse]
659
- def send_carousel(token, params, opts = {})
660
- data, _status_code, _headers = send_carousel_with_http_info(token, params, opts)
694
+ def send_carousel(token, opts = {})
695
+ data, _status_code, _headers = send_carousel_with_http_info(token, opts)
661
696
  data
662
697
  end
663
698
 
664
699
  # Send Carousel
665
- # You can send product cards via Carousel in two ways: Template messages: do not require a 24-hour customer service window between you and the recipient. Use sendTemplate. Free-form messages: can be sent only when a customer service window is open between you and the recipient. Use sendCarousel. The message structure in /sendCarousel is largely similar to sending a template. However, in this case you must explicitly specify all elements that are created in advance when working with templates. This is because the message is sent without using a template. In /sendCarousel, for sending a Catalog Carousel there can be either 1 URL button or one or more quick reply buttons.
700
+ # You can send product cards via Carousel in two ways: Template messages: do not require a 24-hour customer service window between you and the recipient. Use sendTemplate. Free-form messages: can be sent only when a customer service window is open between you and the recipient. Use sendCarousel. The message structure in /sendCarousel is largely similar to sending a template. However, in this case you must explicitly specify all elements that are created in advance when working with templates. This is because the message is sent without using a template. In /sendCarousel, for a Catalog Carousel there can be either 1 URL button or one or more quick reply buttons. Prefer the simple &#x60;cards&#x60; array (2–10 cards). Each card needs a header media/product plus a CTA URL or quick-reply buttons. Example: &#x60;&#x60;&#x60;json { \&quot;phone\&quot;: \&quot;79001234567\&quot;, \&quot;body\&quot;: \&quot;Pick a product\&quot;, \&quot;cards\&quot;: [ { \&quot;header\&quot;: { \&quot;type\&quot;: \&quot;image\&quot;, \&quot;image\&quot;: { \&quot;link\&quot;: \&quot;https://example.com/1.jpg\&quot; } }, \&quot;body\&quot;: { \&quot;text\&quot;: \&quot;Card one\&quot; }, \&quot;type\&quot;: \&quot;cta_url\&quot;, \&quot;action\&quot;: { \&quot;name\&quot;: \&quot;cta_url\&quot;, \&quot;parameters\&quot;: { \&quot;url\&quot;: \&quot;https://example.com/p1\&quot;, \&quot;display_text\&quot;: \&quot;Open\&quot; } } }, { \&quot;header\&quot;: { \&quot;type\&quot;: \&quot;image\&quot;, \&quot;image\&quot;: { \&quot;link\&quot;: \&quot;https://example.com/2.jpg\&quot; } }, \&quot;body\&quot;: { \&quot;text\&quot;: \&quot;Card two\&quot; }, \&quot;type\&quot;: \&quot;cta_url\&quot;, \&quot;action\&quot;: { \&quot;name\&quot;: \&quot;cta_url\&quot;, \&quot;parameters\&quot;: { \&quot;url\&quot;: \&quot;https://example.com/p2\&quot;, \&quot;display_text\&quot;: \&quot;Open\&quot; } } } ] } &#x60;&#x60;&#x60; &#x60;params&#x60; with a &#x60;CAROUSEL&#x60; component is the template-like alternative.
666
701
  # @param token [String] JWT token or API key for authorization
667
- # @param params [Array<Object>] Required. Template-like structure (same as sendTemplate params). Must include a CAROUSEL component and its cards. Structure: - params[] item with type CAROUSEL and cards (2..10) - cards[] item: - components[] items: - header: parameters[0] with type image/video/product - image: {\\\&quot;image\\\&quot;: {\\\&quot;link\\\&quot;: \\\&quot;https://...\\\&quot;}} - video: {\\\&quot;video\\\&quot;: {\\\&quot;link\\\&quot;: \\\&quot;https://...\\\&quot;}} - product: {\\\&quot;product\\\&quot;: {\\\&quot;catalog_id\\\&quot;: \\\&quot;...\\\&quot;, \\\&quot;product_retailer_id\\\&quot;: \\\&quot;...\\\&quot;}} - button: sub_type url or quick_reply - url: parameters {\\\&quot;text\\\&quot;: \\\&quot;Button\\\&quot;, \\\&quot;url\\\&quot;: \\\&quot;https://...\\\&quot;} - quick_reply: parameters[] of {\\\&quot;id\\\&quot;: \\\&quot;...\\\&quot;, \\\&quot;text\\\&quot;: \\\&quot;...\\\&quot;}
668
702
  # @param [Hash] opts the optional parameters
669
703
  # @option opts [String] :body Text shown above the carousel. Optional. If omitted and params include a body component, the body will be taken from params.
704
+ # @option opts [Array<Hash<String, Object>>] :cards Preferred. 2–10 carousel cards (header + body + CTA or quick replies).
705
+ # @option opts [Array<Object>] :params Required. Template-like structure (same as sendTemplate params). Must include a CAROUSEL component and its cards. Structure: - params[] item with type CAROUSEL and cards (2..10) - cards[] item: - components[] items: - header: parameters[0] with type image/video/product - image: {\\\&quot;image\\\&quot;: {\\\&quot;link\\\&quot;: \\\&quot;https://...\\\&quot;}} - video: {\\\&quot;video\\\&quot;: {\\\&quot;link\\\&quot;: \\\&quot;https://...\\\&quot;}} - product: {\\\&quot;product\\\&quot;: {\\\&quot;catalog_id\\\&quot;: \\\&quot;...\\\&quot;, \\\&quot;product_retailer_id\\\&quot;: \\\&quot;...\\\&quot;}} - button: sub_type url or quick_reply - url: parameters {\\\&quot;text\\\&quot;: \\\&quot;Button\\\&quot;, \\\&quot;url\\\&quot;: \\\&quot;https://...\\\&quot;} - quick_reply: parameters[] of {\\\&quot;id\\\&quot;: \\\&quot;...\\\&quot;, \\\&quot;text\\\&quot;: \\\&quot;...\\\&quot;}
670
706
  # @option opts [String] :quoted_msg_id Quoted message ID (Cloud API)
671
707
  # @option opts [String] :chat_id Required if phone is not set. Chat ID from the message list. Examples: 12020721369@c.us or 120363046942338209@g.us(group)
672
708
  # @option opts [Integer] :phone Required if chatId is not set. A phone number starting with the country code. USA example: 12020721369.
673
709
  # @return [Array<(MessageSentResponse, Integer, Hash)>] MessageSentResponse data, response status code and response headers
674
- def send_carousel_with_http_info(token, params, opts = {})
710
+ def send_carousel_with_http_info(token, opts = {})
675
711
  if @api_client.config.debugging
676
712
  @api_client.config.logger.debug 'Calling API: MessagingApi.send_carousel ...'
677
713
  end
@@ -679,10 +715,14 @@ module OneMsgSdk
679
715
  if @api_client.config.client_side_validation && token.nil?
680
716
  fail ArgumentError, "Missing the required parameter 'token' when calling MessagingApi.send_carousel"
681
717
  end
682
- # verify the required parameter 'params' is set
683
- if @api_client.config.client_side_validation && params.nil?
684
- fail ArgumentError, "Missing the required parameter 'params' when calling MessagingApi.send_carousel"
718
+ if @api_client.config.client_side_validation && !opts[:'cards'].nil? && opts[:'cards'].length > 10
719
+ fail ArgumentError, 'invalid value for "opts[:"cards"]" when calling MessagingApi.send_carousel, number of items must be less than or equal to 10.'
685
720
  end
721
+
722
+ if @api_client.config.client_side_validation && !opts[:'cards'].nil? && opts[:'cards'].length < 2
723
+ fail ArgumentError, 'invalid value for "opts[:"cards"]" when calling MessagingApi.send_carousel, number of items must be greater than or equal to 2.'
724
+ end
725
+
686
726
  # resource path
687
727
  local_var_path = '/sendCarousel'
688
728
 
@@ -702,8 +742,9 @@ module OneMsgSdk
702
742
 
703
743
  # form parameters
704
744
  form_params = opts[:form_params] || {}
705
- form_params['params'] = @api_client.build_collection_param(params, :csv)
706
745
  form_params['body'] = opts[:'body'] if !opts[:'body'].nil?
746
+ form_params['cards'] = @api_client.build_collection_param(opts[:'cards'], :csv) if !opts[:'cards'].nil?
747
+ form_params['params'] = @api_client.build_collection_param(opts[:'params'], :csv) if !opts[:'params'].nil?
707
748
  form_params['quotedMsgId'] = opts[:'quoted_msg_id'] if !opts[:'quoted_msg_id'].nil?
708
749
  form_params['chatId'] = opts[:'chat_id'] if !opts[:'chat_id'].nil?
709
750
  form_params['phone'] = opts[:'phone'] if !opts[:'phone'].nil?
@@ -735,6 +776,7 @@ module OneMsgSdk
735
776
  end
736
777
 
737
778
  # Send a Contact
779
+ # Send a WhatsApp contact card. Preferred simple body (legacy-compatible): ```json { \"phone\": \"79001234567\", \"contact\": { \"name\": \"Lida\", \"phone\": \"+79181976551\" } } ``` Cloud API shape also works: `contacts` is an array of objects with `name.formatted_name` and `phones[].phone` (E.164 string, **not** a timestamp).
738
780
  # @param token [String] JWT token or API key for authorization
739
781
  # @param [Hash] opts the optional parameters
740
782
  # @option opts [SendContactRequest] :send_contact_request
@@ -745,6 +787,7 @@ module OneMsgSdk
745
787
  end
746
788
 
747
789
  # Send a Contact
790
+ # Send a WhatsApp contact card. Preferred simple body (legacy-compatible): &#x60;&#x60;&#x60;json { \&quot;phone\&quot;: \&quot;79001234567\&quot;, \&quot;contact\&quot;: { \&quot;name\&quot;: \&quot;Lida\&quot;, \&quot;phone\&quot;: \&quot;+79181976551\&quot; } } &#x60;&#x60;&#x60; Cloud API shape also works: &#x60;contacts&#x60; is an array of objects with &#x60;name.formatted_name&#x60; and &#x60;phones[].phone&#x60; (E.164 string, **not** a timestamp).
748
791
  # @param token [String] JWT token or API key for authorization
749
792
  # @param [Hash] opts the optional parameters
750
793
  # @option opts [SendContactRequest] :send_contact_request
@@ -803,6 +846,77 @@ module OneMsgSdk
803
846
  return data, status_code, headers
804
847
  end
805
848
 
849
+ # Request the user's phone number
850
+ # Send a service-window interactive message that asks the WhatsApp user to share their phone number (`request_contact_info`). Use this when you only know the user by BSUID (WhatsApp username) and the 24-hour customer service window is open. Outside that window, create a UTILITY or MARKETING template with a `REQUEST_CONTACT_INFO` button (`POST /addTemplate`) and send it with `POST /sendTemplate`. `body` is the text shown above the button (1–1024 characters). WhatsApp chooses the button label. This method has no button-text field — do not send one. ```json { \"bsuid\": \"US.13491208655302741918\", \"body\": \"Please share your phone number so we can reach you.\" } ``` `phone`, `chatId` (`…@c.us`, `…@lid`, `…@username`), or `bsuid` identifies the recipient. One of them is enough. After Meta accepts the send, the outgoing webhook and stored history message use this same text as `messages[].body` (`type: interactive`). When the user taps the button, Meta sends an inbound `contacts` message. The sender stays the BSUID. The shared number is on the card with `origin: contact_request`. We write that phone onto the existing BSUID contact automatically — there is no separate “link phone” call. ```json { \"contacts\": [ { \"profile\": { \"name\": \"Ada\", \"username\": \"ada\" }, \"user_id\": \"US.13491208655302741918\" } ], \"messages\": [ { \"from_user_id\": \"US.13491208655302741918\", \"type\": \"contacts\", \"contacts\": [ { \"origin\": \"contact_request\", \"phones\": [{ \"phone\": \"+1 202-555-0123\", \"wa_id\": \"12025550123\" }] } ] } ] } ``` The stored inbound message body is the digits (`12025550123`). If Meta later includes a phone on an ordinary message or status for that same BSUID (`wa_id`, `from`, or `recipient_id`, together with `user_id` / `recipient_user_id`), that phone is merged onto the same contact. A contact card the user forwards (`origin` other than `contact_request`) is someone else's number and is not stored as this sender's phone.
851
+ # @param token [String] JWT token or API key for authorization
852
+ # @param [Hash] opts the optional parameters
853
+ # @option opts [SendContactInfoRequest] :send_contact_info_request
854
+ # @return [MessageSentResponse]
855
+ def send_contact_info(token, opts = {})
856
+ data, _status_code, _headers = send_contact_info_with_http_info(token, opts)
857
+ data
858
+ end
859
+
860
+ # Request the user&#39;s phone number
861
+ # Send a service-window interactive message that asks the WhatsApp user to share their phone number (&#x60;request_contact_info&#x60;). Use this when you only know the user by BSUID (WhatsApp username) and the 24-hour customer service window is open. Outside that window, create a UTILITY or MARKETING template with a &#x60;REQUEST_CONTACT_INFO&#x60; button (&#x60;POST /addTemplate&#x60;) and send it with &#x60;POST /sendTemplate&#x60;. &#x60;body&#x60; is the text shown above the button (1–1024 characters). WhatsApp chooses the button label. This method has no button-text field — do not send one. &#x60;&#x60;&#x60;json { \&quot;bsuid\&quot;: \&quot;US.13491208655302741918\&quot;, \&quot;body\&quot;: \&quot;Please share your phone number so we can reach you.\&quot; } &#x60;&#x60;&#x60; &#x60;phone&#x60;, &#x60;chatId&#x60; (&#x60;…@c.us&#x60;, &#x60;…@lid&#x60;, &#x60;…@username&#x60;), or &#x60;bsuid&#x60; identifies the recipient. One of them is enough. After Meta accepts the send, the outgoing webhook and stored history message use this same text as &#x60;messages[].body&#x60; (&#x60;type: interactive&#x60;). When the user taps the button, Meta sends an inbound &#x60;contacts&#x60; message. The sender stays the BSUID. The shared number is on the card with &#x60;origin: contact_request&#x60;. We write that phone onto the existing BSUID contact automatically — there is no separate “link phone” call. &#x60;&#x60;&#x60;json { \&quot;contacts\&quot;: [ { \&quot;profile\&quot;: { \&quot;name\&quot;: \&quot;Ada\&quot;, \&quot;username\&quot;: \&quot;ada\&quot; }, \&quot;user_id\&quot;: \&quot;US.13491208655302741918\&quot; } ], \&quot;messages\&quot;: [ { \&quot;from_user_id\&quot;: \&quot;US.13491208655302741918\&quot;, \&quot;type\&quot;: \&quot;contacts\&quot;, \&quot;contacts\&quot;: [ { \&quot;origin\&quot;: \&quot;contact_request\&quot;, \&quot;phones\&quot;: [{ \&quot;phone\&quot;: \&quot;+1 202-555-0123\&quot;, \&quot;wa_id\&quot;: \&quot;12025550123\&quot; }] } ] } ] } &#x60;&#x60;&#x60; The stored inbound message body is the digits (&#x60;12025550123&#x60;). If Meta later includes a phone on an ordinary message or status for that same BSUID (&#x60;wa_id&#x60;, &#x60;from&#x60;, or &#x60;recipient_id&#x60;, together with &#x60;user_id&#x60; / &#x60;recipient_user_id&#x60;), that phone is merged onto the same contact. A contact card the user forwards (&#x60;origin&#x60; other than &#x60;contact_request&#x60;) is someone else&#39;s number and is not stored as this sender&#39;s phone.
862
+ # @param token [String] JWT token or API key for authorization
863
+ # @param [Hash] opts the optional parameters
864
+ # @option opts [SendContactInfoRequest] :send_contact_info_request
865
+ # @return [Array<(MessageSentResponse, Integer, Hash)>] MessageSentResponse data, response status code and response headers
866
+ def send_contact_info_with_http_info(token, opts = {})
867
+ if @api_client.config.debugging
868
+ @api_client.config.logger.debug 'Calling API: MessagingApi.send_contact_info ...'
869
+ end
870
+ # verify the required parameter 'token' is set
871
+ if @api_client.config.client_side_validation && token.nil?
872
+ fail ArgumentError, "Missing the required parameter 'token' when calling MessagingApi.send_contact_info"
873
+ end
874
+ # resource path
875
+ local_var_path = '/sendContactInfo'
876
+
877
+ # query parameters
878
+ query_params = opts[:query_params] || {}
879
+ query_params[:'token'] = token
880
+
881
+ # header parameters
882
+ header_params = opts[:header_params] || {}
883
+ # HTTP header 'Accept' (if needed)
884
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
885
+ # HTTP header 'Content-Type'
886
+ content_type = @api_client.select_header_content_type(['application/json'])
887
+ if !content_type.nil?
888
+ header_params['Content-Type'] = content_type
889
+ end
890
+
891
+ # form parameters
892
+ form_params = opts[:form_params] || {}
893
+
894
+ # http body (model)
895
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'send_contact_info_request'])
896
+
897
+ # return_type
898
+ return_type = opts[:debug_return_type] || 'MessageSentResponse'
899
+
900
+ # auth_names
901
+ auth_names = opts[:debug_auth_names] || ['tokenAuth']
902
+
903
+ new_options = opts.merge(
904
+ :operation => :"MessagingApi.send_contact_info",
905
+ :header_params => header_params,
906
+ :query_params => query_params,
907
+ :form_params => form_params,
908
+ :body => post_body,
909
+ :auth_names => auth_names,
910
+ :return_type => return_type
911
+ )
912
+
913
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
914
+ if @api_client.config.debugging
915
+ @api_client.config.logger.debug "API called: MessagingApi#send_contact_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
916
+ end
917
+ return data, status_code, headers
918
+ end
919
+
806
920
  # Send CTA URL interactive message
807
921
  # Send an interactive message with a single call-to-action URL button.
808
922
  # @param token [String] JWT token or API key for authorization
@@ -1357,13 +1471,15 @@ module OneMsgSdk
1357
1471
  end
1358
1472
 
1359
1473
  # Send a Message
1360
- # Send a message to an existing chat. (Only if the dialogue has an Open Session). The message will be added to the queue for sending and delivered even if the phone is disconnected from the Internet or authorization is not passed. Only one of two parameters is needed to determine the destination - chatId or phone.
1474
+ # Send a message to an existing chat. (Only if the dialogue has an Open Session). The message will be added to the queue for sending and delivered even if the phone is disconnected from the Internet or authorization is not passed. Only one of two parameters is needed to determine the destination - chatId or phone. Direct Send is in beta. Meta has not enabled it on every business portfolio, so `category` and `directSend` are a beta option: watch delivery errors before relying on them. Set `category` to `utility` or `authentication` to send outside the 24-hour window as a Meta Direct Send template instead of the 1MSG marketing auto-template. `authentication` is part of that beta and is not recommended. `directSend.serviceFirst: true` tries a free service message first and uses Direct Send only when Meta rejects it because the window is closed (131047). `directSend.templateName` is only valid with `utility` (`^[a-z0-9_]+$`, max 512). Direct Send text is limited to 1024 characters. Without `templateName`, the first unseen phrase may be delivered as Meta's onboarding template. A named template does not guarantee delivery — wait for webhook errors 131000 or 132021. An open 24-hour window is still billed as utility when `category` is set and `serviceFirst` is not true.
1361
1475
  # @param token [String] JWT token or API key for authorization
1362
1476
  # @param body [String] Message text, UTF-8 or UTF-16 string with emoji
1363
1477
  # @param [Hash] opts the optional parameters
1364
1478
  # @option opts [String] :quoted_msg_id Message ID to quote/reply to (Cloud API wamid)
1365
- # @option opts [String] :chat_id Chat ID in format: phone@c.us (individual) or phone@g.us (group)
1479
+ # @option opts [String] :chat_id Recipient chat ID: phone@c.us, group@g.us, or BSUID@lid
1366
1480
  # @option opts [Integer] :phone Phone number starting with country code (alternative to chatId)
1481
+ # @option opts [String] :category Optional Direct Send category. Direct Send is in beta: Meta has not enabled it on every business portfolio. &#x60;utility&#x60; or &#x60;authentication&#x60; enables it. &#x60;authentication&#x60; is part of that beta and is not recommended. Omit or &#x60;service&#x60; keeps a normal service message (and the marketing auto-template outside the 24-hour window). &#x60;marketing&#x60; is rejected.
1482
+ # @option opts [SendMessageRequestDirectSend] :direct_send
1367
1483
  # @return [MessageSentResponse]
1368
1484
  def send_message(token, body, opts = {})
1369
1485
  data, _status_code, _headers = send_message_with_http_info(token, body, opts)
@@ -1371,13 +1487,15 @@ module OneMsgSdk
1371
1487
  end
1372
1488
 
1373
1489
  # Send a Message
1374
- # Send a message to an existing chat. (Only if the dialogue has an Open Session). The message will be added to the queue for sending and delivered even if the phone is disconnected from the Internet or authorization is not passed. Only one of two parameters is needed to determine the destination - chatId or phone.
1490
+ # Send a message to an existing chat. (Only if the dialogue has an Open Session). The message will be added to the queue for sending and delivered even if the phone is disconnected from the Internet or authorization is not passed. Only one of two parameters is needed to determine the destination - chatId or phone. Direct Send is in beta. Meta has not enabled it on every business portfolio, so &#x60;category&#x60; and &#x60;directSend&#x60; are a beta option: watch delivery errors before relying on them. Set &#x60;category&#x60; to &#x60;utility&#x60; or &#x60;authentication&#x60; to send outside the 24-hour window as a Meta Direct Send template instead of the 1MSG marketing auto-template. &#x60;authentication&#x60; is part of that beta and is not recommended. &#x60;directSend.serviceFirst: true&#x60; tries a free service message first and uses Direct Send only when Meta rejects it because the window is closed (131047). &#x60;directSend.templateName&#x60; is only valid with &#x60;utility&#x60; (&#x60;^[a-z0-9_]+$&#x60;, max 512). Direct Send text is limited to 1024 characters. Without &#x60;templateName&#x60;, the first unseen phrase may be delivered as Meta&#39;s onboarding template. A named template does not guarantee delivery — wait for webhook errors 131000 or 132021. An open 24-hour window is still billed as utility when &#x60;category&#x60; is set and &#x60;serviceFirst&#x60; is not true.
1375
1491
  # @param token [String] JWT token or API key for authorization
1376
1492
  # @param body [String] Message text, UTF-8 or UTF-16 string with emoji
1377
1493
  # @param [Hash] opts the optional parameters
1378
1494
  # @option opts [String] :quoted_msg_id Message ID to quote/reply to (Cloud API wamid)
1379
- # @option opts [String] :chat_id Chat ID in format: phone@c.us (individual) or phone@g.us (group)
1495
+ # @option opts [String] :chat_id Recipient chat ID: phone@c.us, group@g.us, or BSUID@lid
1380
1496
  # @option opts [Integer] :phone Phone number starting with country code (alternative to chatId)
1497
+ # @option opts [String] :category Optional Direct Send category. Direct Send is in beta: Meta has not enabled it on every business portfolio. &#x60;utility&#x60; or &#x60;authentication&#x60; enables it. &#x60;authentication&#x60; is part of that beta and is not recommended. Omit or &#x60;service&#x60; keeps a normal service message (and the marketing auto-template outside the 24-hour window). &#x60;marketing&#x60; is rejected.
1498
+ # @option opts [SendMessageRequestDirectSend] :direct_send
1381
1499
  # @return [Array<(MessageSentResponse, Integer, Hash)>] MessageSentResponse data, response status code and response headers
1382
1500
  def send_message_with_http_info(token, body, opts = {})
1383
1501
  if @api_client.config.debugging
@@ -1404,11 +1522,6 @@ module OneMsgSdk
1404
1522
  fail ArgumentError, "invalid value for 'opts[:\"quoted_msg_id\"]' when calling MessagingApi.send_message, must conform to the pattern #{pattern}."
1405
1523
  end
1406
1524
 
1407
- pattern = Regexp.new(/^[0-9]+@[cg]\.us$/)
1408
- if @api_client.config.client_side_validation && !opts[:'chat_id'].nil? && opts[:'chat_id'] !~ pattern
1409
- fail ArgumentError, "invalid value for 'opts[:\"chat_id\"]' when calling MessagingApi.send_message, must conform to the pattern #{pattern}."
1410
- end
1411
-
1412
1525
  if @api_client.config.client_side_validation && !opts[:'phone'].nil? && opts[:'phone'] > 999999999999999
1413
1526
  fail ArgumentError, 'invalid value for "opts[:"phone"]" when calling MessagingApi.send_message, must be smaller than or equal to 999999999999999.'
1414
1527
  end
@@ -1417,6 +1530,10 @@ module OneMsgSdk
1417
1530
  fail ArgumentError, 'invalid value for "opts[:"phone"]" when calling MessagingApi.send_message, must be greater than or equal to 1000000000.'
1418
1531
  end
1419
1532
 
1533
+ allowable_values = ["utility", "authentication", "service"]
1534
+ if @api_client.config.client_side_validation && opts[:'category'] && !allowable_values.include?(opts[:'category'])
1535
+ fail ArgumentError, "invalid value for \"category\", must be one of #{allowable_values}"
1536
+ end
1420
1537
  # resource path
1421
1538
  local_var_path = '/sendMessage'
1422
1539
 
@@ -1440,6 +1557,8 @@ module OneMsgSdk
1440
1557
  form_params['quotedMsgId'] = opts[:'quoted_msg_id'] if !opts[:'quoted_msg_id'].nil?
1441
1558
  form_params['chatId'] = opts[:'chat_id'] if !opts[:'chat_id'].nil?
1442
1559
  form_params['phone'] = opts[:'phone'] if !opts[:'phone'].nil?
1560
+ form_params['category'] = opts[:'category'] if !opts[:'category'].nil?
1561
+ form_params['directSend'] = opts[:'direct_send'] if !opts[:'direct_send'].nil?
1443
1562
 
1444
1563
  # http body (model)
1445
1564
  post_body = opts[:debug_body]
@@ -1618,21 +1737,23 @@ module OneMsgSdk
1618
1737
  end
1619
1738
 
1620
1739
  # Send a Product
1740
+ # Send a single catalog product or a product list. Destination is `chatId` or `phone`. `action` is required: - single product: `{ \"catalog_id\": \"...\", \"product_retailer_id\": \"...\" }` - product list: `{ \"catalog_id\": \"...\", \"sections\": [{ \"title\": \"...\", \"product_items\": [{ \"product_retailer_id\": \"...\" }] }] }`
1621
1741
  # @param token [String] JWT token or API key for authorization
1742
+ # @param send_product_request [SendProductRequest]
1622
1743
  # @param [Hash] opts the optional parameters
1623
- # @option opts [Hash<String, Object>] :request_body
1624
1744
  # @return [MessageSentResponse]
1625
- def send_product(token, opts = {})
1626
- data, _status_code, _headers = send_product_with_http_info(token, opts)
1745
+ def send_product(token, send_product_request, opts = {})
1746
+ data, _status_code, _headers = send_product_with_http_info(token, send_product_request, opts)
1627
1747
  data
1628
1748
  end
1629
1749
 
1630
1750
  # Send a Product
1751
+ # Send a single catalog product or a product list. Destination is &#x60;chatId&#x60; or &#x60;phone&#x60;. &#x60;action&#x60; is required: - single product: &#x60;{ \&quot;catalog_id\&quot;: \&quot;...\&quot;, \&quot;product_retailer_id\&quot;: \&quot;...\&quot; }&#x60; - product list: &#x60;{ \&quot;catalog_id\&quot;: \&quot;...\&quot;, \&quot;sections\&quot;: [{ \&quot;title\&quot;: \&quot;...\&quot;, \&quot;product_items\&quot;: [{ \&quot;product_retailer_id\&quot;: \&quot;...\&quot; }] }] }&#x60;
1631
1752
  # @param token [String] JWT token or API key for authorization
1753
+ # @param send_product_request [SendProductRequest]
1632
1754
  # @param [Hash] opts the optional parameters
1633
- # @option opts [Hash<String, Object>] :request_body
1634
1755
  # @return [Array<(MessageSentResponse, Integer, Hash)>] MessageSentResponse data, response status code and response headers
1635
- def send_product_with_http_info(token, opts = {})
1756
+ def send_product_with_http_info(token, send_product_request, opts = {})
1636
1757
  if @api_client.config.debugging
1637
1758
  @api_client.config.logger.debug 'Calling API: MessagingApi.send_product ...'
1638
1759
  end
@@ -1640,6 +1761,10 @@ module OneMsgSdk
1640
1761
  if @api_client.config.client_side_validation && token.nil?
1641
1762
  fail ArgumentError, "Missing the required parameter 'token' when calling MessagingApi.send_product"
1642
1763
  end
1764
+ # verify the required parameter 'send_product_request' is set
1765
+ if @api_client.config.client_side_validation && send_product_request.nil?
1766
+ fail ArgumentError, "Missing the required parameter 'send_product_request' when calling MessagingApi.send_product"
1767
+ end
1643
1768
  # resource path
1644
1769
  local_var_path = '/sendProduct'
1645
1770
 
@@ -1661,7 +1786,7 @@ module OneMsgSdk
1661
1786
  form_params = opts[:form_params] || {}
1662
1787
 
1663
1788
  # http body (model)
1664
- post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'request_body'])
1789
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(send_product_request)
1665
1790
 
1666
1791
  # return_type
1667
1792
  return_type = opts[:debug_return_type] || 'MessageSentResponse'