one_msg_sdk 2.0.1 → 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.
- checksums.yaml +4 -4
- data/AGENTS.md +65 -19
- data/README.md +102 -34
- data/docs/AddTemplate200Response.md +18 -0
- data/docs/AddTemplateRequest.md +7 -7
- data/docs/CallingApi.md +27 -31
- data/docs/CallingSettings.md +18 -0
- data/docs/CallingSettingsCalling.md +38 -0
- data/docs/CallingSettingsCallingAudio.md +18 -0
- data/docs/CallingSettingsCallingCallHours.md +22 -0
- data/docs/CallingSettingsCallingSip.md +20 -0
- data/docs/CallingSettingsCallingSipServersInner.md +28 -0
- data/docs/CallingSettingsCallingVideo.md +18 -0
- data/docs/CatalogApi.md +1 -1
- data/docs/ChannelApi.md +151 -5
- data/docs/CreateFlowsRequest.md +26 -0
- data/docs/CreateGroupsGroupIdRequest.md +22 -0
- data/docs/CreateGroupsRequest.md +20 -0
- data/docs/CreateSettingsRequest.md +28 -0
- data/docs/CreateSettingsRequestWebhookUrl.md +49 -0
- data/docs/CreateUploadMedia200Response.md +18 -0
- data/docs/CreateUploadMediaRequest.md +20 -0
- data/docs/FlowsApi.md +32 -16
- data/docs/GetStatus200Response.md +26 -0
- data/docs/GetWebhook200Response.md +24 -2
- data/docs/GetWebhook200ResponseWebhookUrl.md +49 -0
- data/docs/GroupsApi.md +38 -18
- data/docs/InitiateCallRequest.md +28 -0
- data/docs/InitiateCallRequestSession.md +20 -0
- data/docs/InitiateCallResponse.md +26 -0
- data/docs/InitiateCallResponseCallsInner.md +18 -0
- data/docs/InitiateCallResponseResponse.md +18 -0
- data/docs/ListSettings200Response.md +52 -0
- data/docs/ListSettings200ResponseWebhookUrl.md +49 -0
- data/docs/MessagingApi.md +140 -35
- data/docs/PatchFlowsFlowIdAssetsRequest.md +18 -0
- data/docs/PatchFlowsFlowIdMetadataRequest.md +22 -0
- data/docs/ProfileApi.md +9 -11
- data/docs/RemoveTemplateRequest.md +18 -0
- data/docs/SendButtonRequest.md +9 -1
- data/docs/SendCarouselRequest1.md +4 -2
- data/docs/SendContactInfoRequest.md +26 -0
- data/docs/SendContactRequest.md +7 -1
- data/docs/SendContactRequestContact.md +26 -0
- data/docs/SendContactRequestContactName.md +49 -0
- data/docs/SendContactRequestContactsInner.md +3 -3
- data/docs/SendContactRequestContactsInnerPhonesInner.md +1 -1
- data/docs/SendListRequest.md +5 -1
- data/docs/SendLocationRequestRequest.md +5 -1
- data/docs/SendMessageRequest.md +6 -2
- data/docs/SendMessageRequestDirectSend.md +20 -0
- data/docs/SendProductRequest.md +30 -0
- data/docs/SendReactionRequest.md +3 -1
- data/docs/SendTemplateRequest.md +9 -5
- data/docs/SendTemplateRequestLanguage.md +3 -3
- data/docs/SetWebhook200Response.md +20 -0
- data/docs/SetWebhook200ResponseWebhookUrl.md +49 -0
- data/docs/SetWebhookRequest.md +18 -0
- data/docs/SetWebhookRequestWebhookUrl.md +49 -0
- data/docs/TemplatesApi.md +29 -17
- data/docs/UpdateCallingSettings200Response.md +22 -0
- data/docs/UpdateCallingSettings200ResponseResponse.md +18 -0
- data/docs/UpdateMe200Response.md +18 -0
- data/docs/UpdateMeRequest.md +6 -6
- data/docs/WebhookUrlStatus.md +34 -0
- data/docs/WebhooksApi.md +10 -12
- data/lib/one_msg_sdk/api/calling_api.rb +39 -31
- data/lib/one_msg_sdk/api/catalog_api.rb +4 -4
- data/lib/one_msg_sdk/api/channel_api.rb +146 -7
- data/lib/one_msg_sdk/api/flows_api.rb +58 -14
- data/lib/one_msg_sdk/api/groups_api.rb +48 -10
- data/lib/one_msg_sdk/api/messaging_api.rb +163 -38
- data/lib/one_msg_sdk/api/profile_api.rb +17 -13
- data/lib/one_msg_sdk/api/templates_api.rb +36 -13
- data/lib/one_msg_sdk/api/users_api.rb +2 -2
- data/lib/one_msg_sdk/api/webhooks_api.rb +19 -15
- data/lib/one_msg_sdk/api_client.rb +2 -2
- data/lib/one_msg_sdk/api_error.rb +2 -2
- data/lib/one_msg_sdk/api_model_base.rb +2 -2
- data/lib/one_msg_sdk/configuration.rb +2 -2
- data/lib/one_msg_sdk/models/add_template200_response.rb +150 -0
- data/lib/one_msg_sdk/models/add_template_request.rb +6 -2
- data/lib/one_msg_sdk/models/block_user_request.rb +2 -2
- data/lib/one_msg_sdk/models/calling_settings.rb +148 -0
- data/lib/one_msg_sdk/models/calling_settings_calling.rb +321 -0
- data/lib/one_msg_sdk/models/calling_settings_calling_audio.rb +148 -0
- data/lib/one_msg_sdk/models/calling_settings_calling_call_hours.rb +166 -0
- data/lib/one_msg_sdk/models/calling_settings_calling_sip.rb +193 -0
- data/lib/one_msg_sdk/models/calling_settings_calling_sip_servers_inner.rb +196 -0
- data/lib/one_msg_sdk/models/calling_settings_calling_video.rb +182 -0
- data/lib/one_msg_sdk/models/conversational_automation.rb +2 -2
- data/lib/one_msg_sdk/models/conversational_automation_commands_inner.rb +2 -2
- data/lib/one_msg_sdk/models/create_commerce200_response.rb +2 -2
- data/lib/one_msg_sdk/models/create_commerce_request.rb +2 -2
- data/lib/one_msg_sdk/models/create_commerce_request_params.rb +2 -2
- data/lib/one_msg_sdk/models/create_flows_request.rb +238 -0
- data/lib/one_msg_sdk/models/create_groups200_response.rb +2 -2
- data/lib/one_msg_sdk/models/create_groups_group_id_request.rb +168 -0
- data/lib/one_msg_sdk/models/create_groups_request.rb +175 -0
- data/lib/one_msg_sdk/models/create_read_message200_response.rb +2 -2
- data/lib/one_msg_sdk/models/create_read_message401_response.rb +2 -2
- data/lib/one_msg_sdk/models/create_read_message_request.rb +2 -2
- data/lib/one_msg_sdk/models/create_settings_request.rb +192 -0
- data/lib/one_msg_sdk/models/create_settings_request_webhook_url.rb +105 -0
- data/lib/one_msg_sdk/models/create_upload_media200_response.rb +147 -0
- data/lib/one_msg_sdk/models/create_upload_media_request.rb +158 -0
- data/lib/one_msg_sdk/models/delete_flows_flow_id200_response.rb +2 -2
- data/lib/one_msg_sdk/models/delete_groups_group_id200_response.rb +2 -2
- data/lib/one_msg_sdk/models/delete_media_legacy_request.rb +2 -2
- data/lib/one_msg_sdk/models/error_response.rb +2 -2
- data/lib/one_msg_sdk/models/get_commerce200_response_inner.rb +2 -2
- data/lib/one_msg_sdk/models/get_mm_lite_status200_response.rb +2 -2
- data/lib/one_msg_sdk/models/get_status200_response.rb +185 -0
- data/lib/one_msg_sdk/models/get_webhook200_response.rb +155 -6
- data/lib/one_msg_sdk/models/get_webhook200_response_webhook_url.rb +105 -0
- data/lib/one_msg_sdk/models/get_whatsapp_business_encryption200_response.rb +2 -2
- data/lib/one_msg_sdk/models/initiate_call_request.rb +277 -0
- data/lib/one_msg_sdk/models/initiate_call_request_session.rb +217 -0
- data/lib/one_msg_sdk/models/initiate_call_response.rb +188 -0
- data/lib/one_msg_sdk/models/initiate_call_response_calls_inner.rb +147 -0
- data/lib/one_msg_sdk/models/initiate_call_response_response.rb +148 -0
- data/lib/one_msg_sdk/models/list_blocked_users200_response.rb +2 -2
- data/lib/one_msg_sdk/models/list_flows200_response.rb +2 -2
- data/lib/one_msg_sdk/models/list_messages200_response.rb +2 -2
- data/lib/one_msg_sdk/models/list_settings200_response.rb +352 -0
- data/lib/one_msg_sdk/models/list_settings200_response_webhook_url.rb +105 -0
- data/lib/one_msg_sdk/models/list_templates200_response.rb +2 -2
- data/lib/one_msg_sdk/models/message_sent_response.rb +2 -2
- data/lib/one_msg_sdk/models/patch_flows_flow_id_assets200_response.rb +2 -2
- data/lib/one_msg_sdk/models/patch_flows_flow_id_assets_request.rb +167 -0
- data/lib/one_msg_sdk/models/patch_flows_flow_id_metadata_request.rb +190 -0
- data/lib/one_msg_sdk/models/profile_info.rb +2 -2
- data/lib/one_msg_sdk/models/remove_template_request.rb +165 -0
- data/lib/one_msg_sdk/models/retrieve_media200_response.rb +2 -2
- data/lib/one_msg_sdk/models/send_address_message_request.rb +2 -2
- data/lib/one_msg_sdk/models/send_button_request.rb +48 -3
- data/lib/one_msg_sdk/models/send_button_request_sections_inner.rb +2 -2
- data/lib/one_msg_sdk/models/send_button_request_sections_inner_reply.rb +2 -2
- data/lib/one_msg_sdk/models/send_carousel_request1.rb +38 -13
- data/lib/one_msg_sdk/models/send_contact_info_request.rb +222 -0
- data/lib/one_msg_sdk/models/send_contact_request.rb +32 -3
- data/lib/one_msg_sdk/models/send_contact_request_contact.rb +221 -0
- data/lib/one_msg_sdk/models/send_contact_request_contact_name.rb +105 -0
- data/lib/one_msg_sdk/models/send_contact_request_contacts_inner.rb +5 -5
- data/lib/one_msg_sdk/models/send_contact_request_contacts_inner_name.rb +2 -2
- data/lib/one_msg_sdk/models/send_contact_request_contacts_inner_org.rb +2 -2
- data/lib/one_msg_sdk/models/send_contact_request_contacts_inner_phones_inner.rb +3 -2
- data/lib/one_msg_sdk/models/send_cta_url_request.rb +2 -2
- data/lib/one_msg_sdk/models/send_file_request.rb +2 -2
- data/lib/one_msg_sdk/models/send_flow_request1.rb +2 -2
- data/lib/one_msg_sdk/models/send_flow_request1_header.rb +2 -2
- data/lib/one_msg_sdk/models/send_flow_request_header.rb +2 -2
- data/lib/one_msg_sdk/models/send_list_request.rb +23 -3
- data/lib/one_msg_sdk/models/send_list_request_sections_inner.rb +2 -2
- data/lib/one_msg_sdk/models/send_list_request_sections_inner_rows_inner.rb +2 -2
- data/lib/one_msg_sdk/models/send_location_request1.rb +2 -2
- data/lib/one_msg_sdk/models/send_location_request_request.rb +23 -3
- data/lib/one_msg_sdk/models/send_message_request.rb +60 -28
- data/lib/one_msg_sdk/models/send_message_request_direct_send.rb +189 -0
- data/lib/one_msg_sdk/models/send_order_details_request.rb +2 -2
- data/lib/one_msg_sdk/models/send_order_details_request_language.rb +2 -2
- data/lib/one_msg_sdk/models/send_order_details_request_order.rb +2 -2
- data/lib/one_msg_sdk/models/send_order_details_request_order_items_inner.rb +2 -2
- data/lib/one_msg_sdk/models/send_order_details_request_order_items_inner_amount.rb +2 -2
- data/lib/one_msg_sdk/models/send_payment_request_request.rb +2 -2
- data/lib/one_msg_sdk/models/send_product_request.rb +225 -0
- data/lib/one_msg_sdk/models/send_reaction_request.rb +14 -3
- data/lib/one_msg_sdk/models/send_sticker_request.rb +2 -2
- data/lib/one_msg_sdk/models/send_template_request.rb +29 -5
- data/lib/one_msg_sdk/models/send_template_request_language.rb +6 -2
- data/lib/one_msg_sdk/models/set_webhook200_response.rb +157 -0
- data/lib/one_msg_sdk/models/set_webhook200_response_webhook_url.rb +105 -0
- data/lib/one_msg_sdk/models/set_webhook_request.rb +164 -0
- data/lib/one_msg_sdk/models/set_webhook_request_webhook_url.rb +105 -0
- data/lib/one_msg_sdk/models/set_whatsapp_business_encryption_request.rb +2 -2
- data/lib/one_msg_sdk/models/success_response.rb +2 -2
- data/lib/one_msg_sdk/models/update_calling_settings200_response.rb +165 -0
- data/lib/one_msg_sdk/models/update_calling_settings200_response_response.rb +147 -0
- data/lib/one_msg_sdk/models/update_me200_response.rb +147 -0
- data/lib/one_msg_sdk/models/update_me_request.rb +6 -3
- data/lib/one_msg_sdk/models/webhook_url_status.rb +287 -0
- data/lib/one_msg_sdk/platform_client.rb +182 -0
- data/lib/one_msg_sdk/version.rb +3 -3
- data/lib/one_msg_sdk.rb +44 -2
- data/one_msg_sdk.gemspec +2 -2
- data/spec/api/calling_api_spec.rb +11 -11
- data/spec/api/catalog_api_spec.rb +3 -3
- data/spec/api/channel_api_spec.rb +29 -4
- data/spec/api/flows_api_spec.rb +10 -2
- data/spec/api/groups_api_spec.rb +10 -2
- data/spec/api/messaging_api_spec.rb +37 -9
- data/spec/api/profile_api_spec.rb +5 -5
- data/spec/api/templates_api_spec.rb +11 -5
- data/spec/api/users_api_spec.rb +2 -2
- data/spec/api/webhooks_api_spec.rb +6 -6
- data/spec/models/add_template200_response_spec.rb +36 -0
- data/spec/models/add_template_request_spec.rb +2 -2
- data/spec/models/block_user_request_spec.rb +2 -2
- data/spec/models/calling_settings_calling_audio_spec.rb +36 -0
- data/spec/models/calling_settings_calling_call_hours_spec.rb +48 -0
- data/spec/models/calling_settings_calling_sip_servers_inner_spec.rb +66 -0
- data/spec/models/calling_settings_calling_sip_spec.rb +46 -0
- data/spec/models/calling_settings_calling_spec.rb +112 -0
- data/spec/models/calling_settings_calling_video_spec.rb +40 -0
- data/spec/models/calling_settings_spec.rb +36 -0
- data/spec/models/conversational_automation_commands_inner_spec.rb +2 -2
- data/spec/models/conversational_automation_spec.rb +2 -2
- data/spec/models/create_commerce200_response_spec.rb +2 -2
- data/spec/models/create_commerce_request_params_spec.rb +2 -2
- data/spec/models/create_commerce_request_spec.rb +2 -2
- data/spec/models/create_flows_request_spec.rb +64 -0
- data/spec/models/create_groups200_response_spec.rb +2 -2
- data/spec/models/create_groups_group_id_request_spec.rb +48 -0
- data/spec/models/create_groups_request_spec.rb +42 -0
- data/spec/models/create_read_message200_response_spec.rb +2 -2
- data/spec/models/create_read_message401_response_spec.rb +2 -2
- data/spec/models/create_read_message_request_spec.rb +2 -2
- data/spec/models/create_settings_request_spec.rb +66 -0
- data/spec/models/create_settings_request_webhook_url_spec.rb +32 -0
- data/spec/models/create_upload_media200_response_spec.rb +36 -0
- data/spec/models/create_upload_media_request_spec.rb +42 -0
- data/spec/models/delete_flows_flow_id200_response_spec.rb +2 -2
- data/spec/models/delete_groups_group_id200_response_spec.rb +2 -2
- data/spec/models/delete_media_legacy_request_spec.rb +2 -2
- data/spec/models/error_response_spec.rb +2 -2
- data/spec/models/get_commerce200_response_inner_spec.rb +2 -2
- data/spec/models/get_mm_lite_status200_response_spec.rb +2 -2
- data/spec/models/get_status200_response_spec.rb +60 -0
- data/spec/models/get_webhook200_response_spec.rb +72 -2
- data/spec/models/get_webhook200_response_webhook_url_spec.rb +32 -0
- data/spec/models/get_whatsapp_business_encryption200_response_spec.rb +2 -2
- data/spec/models/initiate_call_request_session_spec.rb +46 -0
- data/spec/models/initiate_call_request_spec.rb +74 -0
- data/spec/models/initiate_call_response_calls_inner_spec.rb +36 -0
- data/spec/models/initiate_call_response_response_spec.rb +36 -0
- data/spec/models/initiate_call_response_spec.rb +60 -0
- data/spec/models/list_blocked_users200_response_spec.rb +2 -2
- data/spec/models/list_flows200_response_spec.rb +2 -2
- data/spec/models/list_messages200_response_spec.rb +2 -2
- data/spec/models/list_settings200_response_spec.rb +142 -0
- data/spec/models/list_settings200_response_webhook_url_spec.rb +32 -0
- data/spec/models/list_templates200_response_spec.rb +2 -2
- data/spec/models/message_sent_response_spec.rb +2 -2
- data/spec/models/patch_flows_flow_id_assets200_response_spec.rb +2 -2
- data/spec/models/patch_flows_flow_id_assets_request_spec.rb +36 -0
- data/spec/models/patch_flows_flow_id_metadata_request_spec.rb +52 -0
- data/spec/models/profile_info_spec.rb +2 -2
- data/spec/models/remove_template_request_spec.rb +36 -0
- data/spec/models/retrieve_media200_response_spec.rb +2 -2
- data/spec/models/send_address_message_request_spec.rb +2 -2
- data/spec/models/send_button_request_sections_inner_reply_spec.rb +2 -2
- data/spec/models/send_button_request_sections_inner_spec.rb +2 -2
- data/spec/models/send_button_request_spec.rb +26 -2
- data/spec/models/send_carousel_request1_spec.rb +8 -2
- data/spec/models/send_contact_info_request_spec.rb +60 -0
- data/spec/models/send_contact_request_contact_name_spec.rb +32 -0
- data/spec/models/send_contact_request_contact_spec.rb +60 -0
- data/spec/models/send_contact_request_contacts_inner_name_spec.rb +2 -2
- data/spec/models/send_contact_request_contacts_inner_org_spec.rb +2 -2
- data/spec/models/send_contact_request_contacts_inner_phones_inner_spec.rb +2 -2
- data/spec/models/send_contact_request_contacts_inner_spec.rb +2 -2
- data/spec/models/send_contact_request_spec.rb +20 -2
- data/spec/models/send_cta_url_request_spec.rb +2 -2
- data/spec/models/send_file_request_spec.rb +2 -2
- data/spec/models/send_flow_request1_header_spec.rb +2 -2
- data/spec/models/send_flow_request1_spec.rb +2 -2
- data/spec/models/send_flow_request_header_spec.rb +2 -2
- data/spec/models/send_list_request_sections_inner_rows_inner_spec.rb +2 -2
- data/spec/models/send_list_request_sections_inner_spec.rb +2 -2
- data/spec/models/send_list_request_spec.rb +14 -2
- data/spec/models/send_location_request1_spec.rb +2 -2
- data/spec/models/send_location_request_request_spec.rb +14 -2
- data/spec/models/send_message_request_direct_send_spec.rb +42 -0
- data/spec/models/send_message_request_spec.rb +18 -2
- data/spec/models/send_order_details_request_language_spec.rb +2 -2
- data/spec/models/send_order_details_request_order_items_inner_amount_spec.rb +2 -2
- data/spec/models/send_order_details_request_order_items_inner_spec.rb +2 -2
- data/spec/models/send_order_details_request_order_spec.rb +2 -2
- data/spec/models/send_order_details_request_spec.rb +2 -2
- data/spec/models/send_payment_request_request_spec.rb +2 -2
- data/spec/models/send_product_request_spec.rb +72 -0
- data/spec/models/send_reaction_request_spec.rb +8 -2
- data/spec/models/send_sticker_request_spec.rb +2 -2
- data/spec/models/send_template_request_language_spec.rb +2 -2
- data/spec/models/send_template_request_spec.rb +14 -2
- data/spec/models/set_webhook200_response_spec.rb +42 -0
- data/spec/models/set_webhook200_response_webhook_url_spec.rb +32 -0
- data/spec/models/set_webhook_request_spec.rb +36 -0
- data/spec/models/set_webhook_request_webhook_url_spec.rb +32 -0
- data/spec/models/set_whatsapp_business_encryption_request_spec.rb +2 -2
- data/spec/models/success_response_spec.rb +2 -2
- data/spec/models/update_calling_settings200_response_response_spec.rb +36 -0
- data/spec/models/update_calling_settings200_response_spec.rb +48 -0
- data/spec/models/update_me200_response_spec.rb +36 -0
- data/spec/models/update_me_request_spec.rb +2 -2
- data/spec/models/webhook_url_status_spec.rb +88 -0
- data/spec/spec_helper.rb +2 -2
- metadata +319 -89
|
@@ -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:**
|
|
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:
|
|
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
|
-
# @
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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 `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).
|
|
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
|
-
# @
|
|
112
|
-
|
|
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(
|
|
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 (`phone@c.us`, group `@g.us`, or BSUID `@lid`)
|
|
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 `chatId`, `limit`, `last`, 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 (`phone@c.us`, group `@g.us`, or BSUID `@lid`)
|
|
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
|
|
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: {\\\"image\\\": {\\\"link\\\": \\\"https://...\\\"}} - video: {\\\"video\\\": {\\\"link\\\": \\\"https://...\\\"}} - product: {\\\"product\\\": {\\\"catalog_id\\\": \\\"...\\\", \\\"product_retailer_id\\\": \\\"...\\\"}} - button: sub_type url or quick_reply - url: parameters {\\\"text\\\": \\\"Button\\\", \\\"url\\\": \\\"https://...\\\"} - quick_reply: parameters[] of {\\\"id\\\": \\\"...\\\", \\\"text\\\": \\\"...\\\"}
|
|
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: {\\\"image\\\": {\\\"link\\\": \\\"https://...\\\"}} - video: {\\\"video\\\": {\\\"link\\\": \\\"https://...\\\"}} - product: {\\\"product\\\": {\\\"catalog_id\\\": \\\"...\\\", \\\"product_retailer_id\\\": \\\"...\\\"}} - button: sub_type url or quick_reply - url: parameters {\\\"text\\\": \\\"Button\\\", \\\"url\\\": \\\"https://...\\\"} - quick_reply: parameters[] of {\\\"id\\\": \\\"...\\\", \\\"text\\\": \\\"...\\\"}
|
|
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,
|
|
660
|
-
data, _status_code, _headers = send_carousel_with_http_info(token,
|
|
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
|
|
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 `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.
|
|
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: {\\\"image\\\": {\\\"link\\\": \\\"https://...\\\"}} - video: {\\\"video\\\": {\\\"link\\\": \\\"https://...\\\"}} - product: {\\\"product\\\": {\\\"catalog_id\\\": \\\"...\\\", \\\"product_retailer_id\\\": \\\"...\\\"}} - button: sub_type url or quick_reply - url: parameters {\\\"text\\\": \\\"Button\\\", \\\"url\\\": \\\"https://...\\\"} - quick_reply: parameters[] of {\\\"id\\\": \\\"...\\\", \\\"text\\\": \\\"...\\\"}
|
|
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: {\\\"image\\\": {\\\"link\\\": \\\"https://...\\\"}} - video: {\\\"video\\\": {\\\"link\\\": \\\"https://...\\\"}} - product: {\\\"product\\\": {\\\"catalog_id\\\": \\\"...\\\", \\\"product_retailer_id\\\": \\\"...\\\"}} - button: sub_type url or quick_reply - url: parameters {\\\"text\\\": \\\"Button\\\", \\\"url\\\": \\\"https://...\\\"} - quick_reply: parameters[] of {\\\"id\\\": \\\"...\\\", \\\"text\\\": \\\"...\\\"}
|
|
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,
|
|
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
|
-
|
|
683
|
-
|
|
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): ```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).
|
|
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's phone number
|
|
861
|
+
# 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.
|
|
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
|
|
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. `utility` or `authentication` enables it. `authentication` is part of that beta and is not recommended. Omit or `service` keeps a normal service message (and the marketing auto-template outside the 24-hour window). `marketing` 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 `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.
|
|
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
|
|
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. `utility` or `authentication` enables it. `authentication` is part of that beta and is not recommended. Omit or `service` keeps a normal service message (and the marketing auto-template outside the 24-hour window). `marketing` 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 `chatId` or `phone`. `action` is required: - single product: `{ \"catalog_id\": \"...\", \"product_retailer_id\": \"...\" }` - product list: `{ \"catalog_id\": \"...\", \"sections\": [{ \"title\": \"...\", \"product_items\": [{ \"product_retailer_id\": \"...\" }] }] }`
|
|
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(
|
|
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'
|
|
@@ -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:**
|
|
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:
|
|
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
|
|
@@ -20,7 +20,7 @@ module OneMsgSdk
|
|
|
20
20
|
@api_client = api_client
|
|
21
21
|
end
|
|
22
22
|
# Get Profile Info
|
|
23
|
-
#
|
|
23
|
+
# Return the WhatsApp Business profile for this channel: About, address, description, email, phone, websites, industry (`vertical`), and profile photo URL.
|
|
24
24
|
# @param token [String] JWT token or API key for authorization
|
|
25
25
|
# @param [Hash] opts the optional parameters
|
|
26
26
|
# @return [ProfileInfo]
|
|
@@ -30,7 +30,7 @@ module OneMsgSdk
|
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
# Get Profile Info
|
|
33
|
-
#
|
|
33
|
+
# Return the WhatsApp Business profile for this channel: About, address, description, email, phone, websites, industry (`vertical`), and profile photo URL.
|
|
34
34
|
# @param token [String] JWT token or API key for authorization
|
|
35
35
|
# @param [Hash] opts the optional parameters
|
|
36
36
|
# @return [Array<(ProfileInfo, Integer, Hash)>] ProfileInfo data, response status code and response headers
|
|
@@ -86,21 +86,21 @@ module OneMsgSdk
|
|
|
86
86
|
# Update profile info
|
|
87
87
|
# Update WhatsApp Business Account profile fields. At least one of about, description, email, photo, address, vertical, websites is required. Blocked when the channel subscription limit is exceeded.
|
|
88
88
|
# @param token [String] JWT token or API key for authorization
|
|
89
|
+
# @param update_me_request [UpdateMeRequest]
|
|
89
90
|
# @param [Hash] opts the optional parameters
|
|
90
|
-
# @
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
data, _status_code, _headers = update_me_with_http_info(token, opts)
|
|
91
|
+
# @return [UpdateMe200Response]
|
|
92
|
+
def update_me(token, update_me_request, opts = {})
|
|
93
|
+
data, _status_code, _headers = update_me_with_http_info(token, update_me_request, opts)
|
|
94
94
|
data
|
|
95
95
|
end
|
|
96
96
|
|
|
97
97
|
# Update profile info
|
|
98
98
|
# Update WhatsApp Business Account profile fields. At least one of about, description, email, photo, address, vertical, websites is required. Blocked when the channel subscription limit is exceeded.
|
|
99
99
|
# @param token [String] JWT token or API key for authorization
|
|
100
|
+
# @param update_me_request [UpdateMeRequest]
|
|
100
101
|
# @param [Hash] opts the optional parameters
|
|
101
|
-
# @
|
|
102
|
-
|
|
103
|
-
def update_me_with_http_info(token, opts = {})
|
|
102
|
+
# @return [Array<(UpdateMe200Response, Integer, Hash)>] UpdateMe200Response data, response status code and response headers
|
|
103
|
+
def update_me_with_http_info(token, update_me_request, opts = {})
|
|
104
104
|
if @api_client.config.debugging
|
|
105
105
|
@api_client.config.logger.debug 'Calling API: ProfileApi.update_me ...'
|
|
106
106
|
end
|
|
@@ -108,6 +108,10 @@ module OneMsgSdk
|
|
|
108
108
|
if @api_client.config.client_side_validation && token.nil?
|
|
109
109
|
fail ArgumentError, "Missing the required parameter 'token' when calling ProfileApi.update_me"
|
|
110
110
|
end
|
|
111
|
+
# verify the required parameter 'update_me_request' is set
|
|
112
|
+
if @api_client.config.client_side_validation && update_me_request.nil?
|
|
113
|
+
fail ArgumentError, "Missing the required parameter 'update_me_request' when calling ProfileApi.update_me"
|
|
114
|
+
end
|
|
111
115
|
# resource path
|
|
112
116
|
local_var_path = '/me'
|
|
113
117
|
|
|
@@ -129,10 +133,10 @@ module OneMsgSdk
|
|
|
129
133
|
form_params = opts[:form_params] || {}
|
|
130
134
|
|
|
131
135
|
# http body (model)
|
|
132
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(
|
|
136
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(update_me_request)
|
|
133
137
|
|
|
134
138
|
# return_type
|
|
135
|
-
return_type = opts[:debug_return_type] || '
|
|
139
|
+
return_type = opts[:debug_return_type] || 'UpdateMe200Response'
|
|
136
140
|
|
|
137
141
|
# auth_names
|
|
138
142
|
auth_names = opts[:debug_auth_names] || ['tokenAuth']
|