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.
- checksums.yaml +4 -4
- data/AGENTS.md +62 -16
- data/README.md +97 -29
- data/docs/AddTemplate200Response.md +18 -0
- data/docs/AddTemplateRequest.md +7 -7
- data/docs/CallingApi.md +1 -1
- 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/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/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 +4 -4
- 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 +2 -2
- data/lib/one_msg_sdk/models/calling_settings_calling.rb +2 -2
- data/lib/one_msg_sdk/models/calling_settings_calling_audio.rb +2 -2
- data/lib/one_msg_sdk/models/calling_settings_calling_call_hours.rb +2 -2
- data/lib/one_msg_sdk/models/calling_settings_calling_sip.rb +2 -2
- data/lib/one_msg_sdk/models/calling_settings_calling_sip_servers_inner.rb +2 -2
- data/lib/one_msg_sdk/models/calling_settings_calling_video.rb +2 -2
- 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 +2 -2
- data/lib/one_msg_sdk/models/initiate_call_request_session.rb +2 -2
- data/lib/one_msg_sdk/models/initiate_call_response.rb +2 -2
- data/lib/one_msg_sdk/models/initiate_call_response_calls_inner.rb +2 -2
- data/lib/one_msg_sdk/models/initiate_call_response_response.rb +2 -2
- 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 +2 -2
- data/lib/one_msg_sdk/models/update_calling_settings200_response_response.rb +2 -2
- 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 +30 -2
- data/one_msg_sdk.gemspec +2 -2
- data/spec/api/calling_api_spec.rb +3 -3
- 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 +2 -2
- data/spec/models/calling_settings_calling_call_hours_spec.rb +2 -2
- data/spec/models/calling_settings_calling_sip_servers_inner_spec.rb +2 -2
- data/spec/models/calling_settings_calling_sip_spec.rb +2 -2
- data/spec/models/calling_settings_calling_spec.rb +2 -2
- data/spec/models/calling_settings_calling_video_spec.rb +2 -2
- data/spec/models/calling_settings_spec.rb +2 -2
- 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 +2 -2
- data/spec/models/initiate_call_request_spec.rb +2 -2
- data/spec/models/initiate_call_response_calls_inner_spec.rb +2 -2
- data/spec/models/initiate_call_response_response_spec.rb +2 -2
- data/spec/models/initiate_call_response_spec.rb +2 -2
- 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 +2 -2
- data/spec/models/update_calling_settings200_response_spec.rb +2 -2
- 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 +204 -31
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4bcad9987ca509a9b8ce9d2ae69aea111f98855766965e14de1e4b0de30fb463
|
|
4
|
+
data.tar.gz: bb2a0f0f67370144fafd06705471cda1ae41496e4091ad48c8b548b47f7fb65f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3d68432db2ccb76d84e53f26fea641d416adb00455102cf8b9d5a4b2c28bc592201f4f5e704245ed39db813dfdf0c3aa7d8ca49523e9c2925ba2adc5522b206b
|
|
7
|
+
data.tar.gz: 0b2b363cb4826aab4bee477679649eccec2b2f5ce75e8664c8c9d87983e40c266cb142eb25d848ffa81f7c5a6c31b5809646bad842574dea36a00db63018aa91
|
data/AGENTS.md
CHANGED
|
@@ -10,7 +10,7 @@ package: "one_msg_sdk"
|
|
|
10
10
|
registry: https://rubygems.org/gems/one_msg_sdk
|
|
11
11
|
repository: https://github.com/1msg/1msg-sdk/tree/main/ruby
|
|
12
12
|
language: Ruby
|
|
13
|
-
version: 2.0.
|
|
13
|
+
version: 2.0.3
|
|
14
14
|
public_only: true
|
|
15
15
|
never_mention: chat-api
|
|
16
16
|
```
|
|
@@ -86,7 +86,7 @@ operationId: initiateCall
|
|
|
86
86
|
http: POST /initiateCall
|
|
87
87
|
clientGroup: calling
|
|
88
88
|
summary: Call action (connect / pre_accept / accept / reject / terminate)
|
|
89
|
-
description: Perform a WhatsApp Calling action (beta). Proxies upstream `POST /calling/calls`. Despite the historical path name `/initiateCall`, this endpoint handles **all** call actions: | action | Use | Required | |--------|-----|----------| | `connect` | Outbound business → user | `to` + `session` (`sdp_type: offer`) | | `pre_accept` | Inbound (optional, reduces audio clipping) | `call_id` + `session` (`sdp_type: answer`) | | `accept` | Inbound answer | `call_id` + `session` (`sdp_type: answer`) | | `reject` | Decline inbound | `call_id` | | `terminate` | Hang up | `call_id` | **SDP / media (critical)** - `accept` / `pre_accept` require a **WebRTC-generated SDP answer**. - Do **not** send Meta's offer SDP back as the answer. - Postman (or curl) alone **cannot** establish real media — you need a WebRTC or SIP stack. 1msg only proxies signaling. Answer within ~**30–60 seconds** of an inbound `connect` webhook or Meta terminates as unanswered. Common Meta errors include Calling not enabled (`138000`), no permission (`138006`), SDP validation failures. **Outbound** requires a prior Call Permission Request (CPR) acceptance. See the **Calling** tag overview for the full outbound flow and CPR limits. Trial / `subscriptionBlocked` → **403** plain text. Upstream failures often return HTTP 200 with `{ "response": { "error": "
|
|
89
|
+
description: Perform a WhatsApp Calling action (beta). Proxies upstream `POST /calling/calls`. Despite the historical path name `/initiateCall`, this endpoint handles **all** call actions: | action | Use | Required | |--------|-----|----------| | `connect` | Outbound business → user | `to` + `session` (`sdp_type: offer`) | | `pre_accept` | Inbound (optional, reduces audio clipping) | `call_id` + `session` (`sdp_type: answer`) | | `accept` | Inbound answer | `call_id` + `session` (`sdp_type: answer`) | | `reject` | Decline inbound | `call_id` | | `terminate` | Hang up | `call_id` | **SDP / media (critical)** - `accept` / `pre_accept` require a **WebRTC-generated SDP answer**. - Do **not** send Meta's offer SDP back as the answer. - Postman (or curl) alone **cannot** establish real media — you need a WebRTC or SIP stack. 1msg only proxies signaling. Answer within ~**30–60 seconds** of an inbound `connect` webhook or Meta terminates as unanswered. Common Meta errors include Calling not enabled (`138000`), no permission (`138006`), SDP validation failures. **Outbound** requires a prior Call Permission Request (CPR) acceptance. See the **Calling** tag overview for the full outbound flow and CPR limits. Trial / `subscriptionBlocked` → **403** plain text. Upstream failures often return HTTP 200 with `{ "response": { "error": "<upstream message>" } }`. `Invalid API KEY` is used only when Meta/360 body actually indicates an invalid API key or token. Other upstream 401s (notably call permission `138006`) pass through `error.message` / `error_user_msg`.
|
|
90
90
|
responses: 200, 401, 500
|
|
91
91
|
```
|
|
92
92
|
|
|
@@ -119,7 +119,18 @@ operationId: getCommerce
|
|
|
119
119
|
http: GET /commerce
|
|
120
120
|
clientGroup: catalog
|
|
121
121
|
summary: Get Commerce Settings
|
|
122
|
-
description: Returns catalog/cart commerce settings for the channel. - `is_catalog_visible` — show catalog storefront icon (`true`) or hide it (`false`). - `is_cart_enabled` — enable cart (`true`) or disable it (`false`).
|
|
122
|
+
description: Returns catalog/cart commerce settings for the channel. Fails with a provider error when the WABA has no catalog linked — that is an API/account limitation, not an MCP schema bug. - `is_catalog_visible` — show catalog storefront icon (`true`) or hide it (`false`). - `is_cart_enabled` — enable cart (`true`) or disable it (`false`).
|
|
123
|
+
responses: 200, 401, 500
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### createSettings
|
|
127
|
+
|
|
128
|
+
```yaml
|
|
129
|
+
operationId: createSettings
|
|
130
|
+
http: POST /settings
|
|
131
|
+
clientGroup: channel
|
|
132
|
+
summary: Update channel settings
|
|
133
|
+
description: Update channel settings. Only send fields you want to change. `webhookUrl` **replaces** the stored list (one URL string, or up to 5 URLs as an array). Passing an empty value clears webhooks. Repeating the same URL(s) also clears a sticky auto-disable. With several URLs, send the complete array to re-enable one of them — omitting a URL removes it from the channel.
|
|
123
134
|
responses: 200, 401, 500
|
|
124
135
|
```
|
|
125
136
|
|
|
@@ -141,7 +152,18 @@ operationId: getStatus
|
|
|
141
152
|
http: GET /status
|
|
142
153
|
clientGroup: channel
|
|
143
154
|
summary: Get channel status
|
|
144
|
-
description:
|
|
155
|
+
description: Return WhatsApp Cloud API connection status for this channel (`connected` when the number can send). May include `accountStatus`, messaging limit, and MM Lite availability. Optional `health_status_warning` appears only when Meta Graph health could not be loaded and a soft `connected` response is returned. Omitted on the normal path and when health details are not applicable for the channel — never an internal provider/transport name.
|
|
156
|
+
responses: 200, 401, 500
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### listSettings
|
|
160
|
+
|
|
161
|
+
```yaml
|
|
162
|
+
operationId: listSettings
|
|
163
|
+
http: GET /settings
|
|
164
|
+
clientGroup: channel
|
|
165
|
+
summary: Get channel settings
|
|
166
|
+
description: Return channel settings: webhook URL(s), delivery flags, and analytics toggles. Auto-disable / circuit state matches `GET /webhook`. **Prefer `webhookStatuses`** (one row per configured URL). The breaker is per URL, not per channel. Channel-level `haveDisabledWebhooks` is `true` when **at least one** URL in `webhookUrl` is sticky auto-disabled — not "the channel is dead". Live URLs still receive events. Top-level `circuitState` / `reason` / `fails` / `trips` are a compatibility summary of one URL (first sticky-disabled, else first configured). This is the same `GET /settings` endpoint as the REST API (previously missing from MCP).
|
|
145
167
|
responses: 200, 401, 500
|
|
146
168
|
```
|
|
147
169
|
|
|
@@ -163,7 +185,8 @@ operationId: createFlows
|
|
|
163
185
|
http: POST /flows
|
|
164
186
|
clientGroup: flows
|
|
165
187
|
summary: Create Flow
|
|
166
|
-
|
|
188
|
+
description: Create a WhatsApp Flow (`name` + `categories` required). Currently returns HTTP 501 until the Meta Graph Flows rewrite is available.
|
|
189
|
+
responses: 200, 501
|
|
167
190
|
```
|
|
168
191
|
|
|
169
192
|
### createFlowsFlowIdDeprecate
|
|
@@ -234,7 +257,8 @@ operationId: listFlows
|
|
|
234
257
|
http: GET /flows
|
|
235
258
|
clientGroup: flows
|
|
236
259
|
summary: List Flows
|
|
237
|
-
|
|
260
|
+
description: List WhatsApp Flows for the WABA. Currently returns HTTP 501 until the Meta Graph Flows rewrite is available.
|
|
261
|
+
responses: 200, 501
|
|
238
262
|
```
|
|
239
263
|
|
|
240
264
|
### patchFlowsFlowIdAssets
|
|
@@ -244,7 +268,8 @@ operationId: patchFlowsFlowIdAssets
|
|
|
244
268
|
http: PATCH /flows/{flowId}/assets
|
|
245
269
|
clientGroup: flows
|
|
246
270
|
summary: Update Flow Structure
|
|
247
|
-
|
|
271
|
+
description: Replace the Flow JSON document (`flowJson`). Currently returns HTTP 501 until the Meta Graph Flows rewrite is available.
|
|
272
|
+
responses: 200, 501
|
|
248
273
|
```
|
|
249
274
|
|
|
250
275
|
### patchFlowsFlowIdMetadata
|
|
@@ -254,7 +279,8 @@ operationId: patchFlowsFlowIdMetadata
|
|
|
254
279
|
http: PATCH /flows/{flowId}/metadata
|
|
255
280
|
clientGroup: flows
|
|
256
281
|
summary: Update Flow Metadata
|
|
257
|
-
|
|
282
|
+
description: Update Flow `name`, `categories`, and/or `endpointUri`. Currently returns HTTP 501 until the Meta Graph Flows rewrite is available.
|
|
283
|
+
responses: 200, 501
|
|
258
284
|
```
|
|
259
285
|
|
|
260
286
|
### setWhatsappBusinessEncryption
|
|
@@ -285,6 +311,7 @@ operationId: createGroupsGroupId
|
|
|
285
311
|
http: POST /groups/{groupId}
|
|
286
312
|
clientGroup: groups
|
|
287
313
|
summary: Update Group Info
|
|
314
|
+
description: Update group subject, description, and/or profile picture. Path `groupId` is the WABA group id (without `@g.us`).
|
|
288
315
|
responses: 200
|
|
289
316
|
```
|
|
290
317
|
|
|
@@ -335,6 +362,7 @@ operationId: listGroups
|
|
|
335
362
|
http: GET /groups
|
|
336
363
|
clientGroup: groups
|
|
337
364
|
summary: Get Groups List
|
|
365
|
+
description: List WhatsApp groups for this channel. Paginate with `limit`, `before`, and `after`.
|
|
338
366
|
responses: 200
|
|
339
367
|
```
|
|
340
368
|
|
|
@@ -355,6 +383,7 @@ operationId: createUploadMedia
|
|
|
355
383
|
http: POST /uploadMedia
|
|
356
384
|
clientGroup: messaging
|
|
357
385
|
summary: Upload media
|
|
386
|
+
description: 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).
|
|
358
387
|
responses: 200
|
|
359
388
|
```
|
|
360
389
|
|
|
@@ -397,6 +426,7 @@ operationId: listMessages
|
|
|
397
426
|
http: GET /messages
|
|
398
427
|
clientGroup: messaging
|
|
399
428
|
summary: Get messages list
|
|
429
|
+
description: List stored chat history for this channel (requires history storage). Filter with `chatId`, `limit`, `last`, message numbers, or time bounds.
|
|
400
430
|
responses: 200
|
|
401
431
|
```
|
|
402
432
|
|
|
@@ -439,7 +469,7 @@ operationId: sendCarousel
|
|
|
439
469
|
http: POST /sendCarousel
|
|
440
470
|
clientGroup: messaging
|
|
441
471
|
summary: Send Carousel
|
|
442
|
-
description: 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
|
|
472
|
+
description: 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.
|
|
443
473
|
responses: 200, 400, 401, 429, 500
|
|
444
474
|
```
|
|
445
475
|
|
|
@@ -450,6 +480,18 @@ operationId: sendContact
|
|
|
450
480
|
http: POST /sendContact
|
|
451
481
|
clientGroup: messaging
|
|
452
482
|
summary: Send a Contact
|
|
483
|
+
description: 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).
|
|
484
|
+
responses: 200, 400, 401, 429, 500
|
|
485
|
+
```
|
|
486
|
+
|
|
487
|
+
### sendContactInfo
|
|
488
|
+
|
|
489
|
+
```yaml
|
|
490
|
+
operationId: sendContactInfo
|
|
491
|
+
http: POST /sendContactInfo
|
|
492
|
+
clientGroup: messaging
|
|
493
|
+
summary: Request the user's phone number
|
|
494
|
+
description: 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.
|
|
453
495
|
responses: 200, 400, 401, 429, 500
|
|
454
496
|
```
|
|
455
497
|
|
|
@@ -524,7 +566,7 @@ operationId: sendMessage
|
|
|
524
566
|
http: POST /sendMessage
|
|
525
567
|
clientGroup: messaging
|
|
526
568
|
summary: Send a Message
|
|
527
|
-
description: 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.
|
|
569
|
+
description: 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.
|
|
528
570
|
responses: 200, 400, 401, 429, 500
|
|
529
571
|
```
|
|
530
572
|
|
|
@@ -557,6 +599,7 @@ operationId: sendProduct
|
|
|
557
599
|
http: POST /sendProduct
|
|
558
600
|
clientGroup: messaging
|
|
559
601
|
summary: Send a Product
|
|
602
|
+
description: 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": "..." }] }] }`
|
|
560
603
|
responses: 200, 400, 401, 429, 500
|
|
561
604
|
```
|
|
562
605
|
|
|
@@ -588,7 +631,7 @@ operationId: getMe
|
|
|
588
631
|
http: GET /me
|
|
589
632
|
clientGroup: profile
|
|
590
633
|
summary: Get Profile Info
|
|
591
|
-
description:
|
|
634
|
+
description: Return the WhatsApp Business profile for this channel: About, address, description, email, phone, websites, industry (`vertical`), and profile photo URL.
|
|
592
635
|
responses: 200, 401, 500
|
|
593
636
|
```
|
|
594
637
|
|
|
@@ -610,6 +653,7 @@ operationId: addTemplate
|
|
|
610
653
|
http: POST /addTemplate
|
|
611
654
|
clientGroup: templates
|
|
612
655
|
summary: Create message template
|
|
656
|
+
description: Create a WABA message template (`name`, `category`, `language`, `components`). After create, Meta reviews the template; list it with `GET /templates`. Authentication OTP templates (`category: AUTHENTICATION`, copy-code / OTP button) can later be sent only to a phone number. Meta does not accept a BSUID recipient for them (error 131062). If the recipient is known only by BSUID — for example they use a username and their phone number is not in your Business Portfolio — that template cannot be sent. To ask a BSUID user for their phone number, add a `REQUEST_CONTACT_INFO` button on a `UTILITY` or `MARKETING` template. Do not send `text` on that button — WhatsApp sets the label (and rejects a custom one). The button also has no send-time parameters: `POST /sendTemplate` does not take a button component for it. Inside an open 24-hour window, call `POST /sendContactInfo` instead of a template. When the user shares the number, the inbound webhook is a `contacts` message with `origin: contact_request`. The phone is stored on that BSUID automatically. See `POST /sendContactInfo`. ```json { "name": "request_phone", "category": "UTILITY", "language": "en_US", "components": [ { "type": "BODY", "text": "Please share your phone number so we can continue." }, { "type": "BUTTONS", "buttons": [{ "type": "REQUEST_CONTACT_INFO" }] } ] } ```
|
|
613
657
|
responses: 200, 401, 500
|
|
614
658
|
```
|
|
615
659
|
|
|
@@ -620,6 +664,7 @@ operationId: listTemplates
|
|
|
620
664
|
http: GET /templates
|
|
621
665
|
clientGroup: templates
|
|
622
666
|
summary: Get templates list
|
|
667
|
+
description: List message templates. Paginate with `limit` / `offset`; sort by `id`, `name`, or `status`.
|
|
623
668
|
responses: 200
|
|
624
669
|
```
|
|
625
670
|
|
|
@@ -630,6 +675,7 @@ operationId: removeTemplate
|
|
|
630
675
|
http: POST /removeTemplate
|
|
631
676
|
clientGroup: templates
|
|
632
677
|
summary: Remove message template
|
|
678
|
+
description: Delete a message template by `name` (all language versions of that name).
|
|
633
679
|
responses: 200, 401, 500
|
|
634
680
|
```
|
|
635
681
|
|
|
@@ -640,7 +686,7 @@ operationId: sendTemplate
|
|
|
640
686
|
http: POST /sendTemplate
|
|
641
687
|
clientGroup: templates
|
|
642
688
|
summary: Send Template Message
|
|
643
|
-
description: Send a WhatsApp template message (works outside the 24-hour session window). Supported `params` button `sub_type` values include: `url`, `quick_reply`, `copy_code` / `coupon_code`, `catalog`, `flow`, `limited_time_offer`, and **`order_details`** (WhatsApp Payments **India only** — requires an approved Utility template with an ORDER_DETAILS button).
|
|
689
|
+
description: Send a WhatsApp **template** message (works outside the 24-hour session window). Use this tool — not `send_message` — when the 24h session is closed. `params` MUST be Cloud API **component objects**, never a flat list of strings and never the old On-Prem `hsm` / `localizable_params` format. Example body variable `{{1}}`: ```json { "type": "body", "parameters": [{ "type": "text", "text": "Ivan" }] } ``` Do not send `"type": "hsm"` and do not send `params: ["Ivan", "123"]`. Supported `params` button `sub_type` values include: `url`, `quick_reply`, `copy_code` / `coupon_code`, `catalog`, `flow`, `limited_time_offer`, and **`order_details`** (WhatsApp Payments **India only** — requires an approved Utility template with an ORDER_DETAILS button). Convenience wrapper with structured fields: `POST /sendOrderDetails`. Authentication OTP templates (category `AUTHENTICATION`, or a template with an OTP / copy-code button) can only be sent to a phone number (`phone` or a phone `chatId`). Meta rejects a BSUID `recipient` for these templates with error 131062. If the recipient is known only by BSUID — for example they use a username and their phone number is not in your Business Portfolio — the template cannot be sent. A `REQUEST_CONTACT_INFO` button (UTILITY or MARKETING only) has no send-time parameters. Do not add a button component for it in `params`, and do not send button text — WhatsApp sets that label on the template. Create the button with `POST /addTemplate` as `{ "type": "REQUEST_CONTACT_INFO" }` with no `text`. Inside an open 24-hour window, `POST /sendContactInfo` asks for the number without a template.
|
|
644
690
|
responses: 200
|
|
645
691
|
```
|
|
646
692
|
|
|
@@ -682,7 +728,7 @@ operationId: getWebhook
|
|
|
682
728
|
http: GET /webhook
|
|
683
729
|
clientGroup: webhooks
|
|
684
730
|
summary: Get webhook URL
|
|
685
|
-
description:
|
|
731
|
+
description: Return the webhook URL(s) currently configured for this channel, plus delivery status for each URL. `webhookUrl` is a string when a single URL is set, an array of strings when multiple URLs are configured, or `null` if none is set. **Prefer `webhookStatuses`.** The circuit breaker is per URL, not per channel. If 1 of 4 URLs is sticky-disabled, that URL is skipped; the other three still receive events. Send/receive are not affected. Channel-level `haveDisabledWebhooks`, `circuitState`, `reason`, `fails`, `trips`, and timestamps are a compatibility summary of **one** URL (the first sticky-disabled URL, else the first configured URL). They are not "the channel is dead". - `haveDisabledWebhooks` — `true` when **at least one** URL in `webhookUrl` is sticky auto-disabled. Live URLs still get events. - `circuitState` — compressed scalar for that same primary URL: `ok` | `degraded` | `open` | `half_open` | `disabled`. - `disabledWebhooks` — currently configured URLs that are sticky-disabled (subset of `webhookUrl`). - `webhookStatuses` — one row per currently configured URL. Use this array to see which endpoints are live vs skipped. - `fails` / `trips` / `firstFailAt` — **diagnostics for support**, not product UI. `fails` = failures in a rolling ~10 minute window (not lifetime). `trips` = failed recovery probes on the 15 min → 1 h → 6 h schedule (sticky disable after 3). Clients can ignore these and use `webhookStatuses` + `disabledWebhooks` only. Sticky disable skips delivery; it does not unconfigure the URL (it stays in `webhookUrl`). Re-enable with `POST /webhook` or `POST /settings`. Those endpoints **replace** the whole list — with multiple URLs, send the full array.
|
|
686
732
|
responses: 200, 401, 500
|
|
687
733
|
```
|
|
688
734
|
|
|
@@ -693,15 +739,15 @@ operationId: setWebhook
|
|
|
693
739
|
http: POST /webhook
|
|
694
740
|
clientGroup: webhooks
|
|
695
741
|
summary: Set webhook URL
|
|
696
|
-
description:
|
|
742
|
+
description: Set the client webhook URL that receives inbound events for this channel. **Replaces** the stored webhook list (it does not append). To deliver the same events to several endpoints, pass an array in `webhookUrl` (max 5) or use `POST /settings`. With several URLs already configured, posting only the disabled URL **drops the others** — send the complete array to re-enable one of many. Incoming payloads include messages, delivery ACKs, group updates, coexistence echoes, and calling events. WhatsApp Calling payloads (`type: "calls"`) are documented under the **Calling** tag. Call permission replies arrive on the normal messages path (`call_permission_reply`). Repeating `POST /webhook` with the same URL(s) clears an auto-disable (self-serve re-enable). Send/receive are not affected by webhook auto-disable.
|
|
697
743
|
responses: 200, 401, 500
|
|
698
744
|
```
|
|
699
745
|
|
|
700
746
|
## Metadata
|
|
701
747
|
|
|
702
748
|
openapi_title: 1MSG WhatsApp Business API (Public)
|
|
703
|
-
openapi_version:
|
|
704
|
-
operations:
|
|
749
|
+
openapi_version: 2.0.0
|
|
750
|
+
operations: 63
|
|
705
751
|
package: one_msg_sdk
|
|
706
752
|
registry: RubyGems
|
|
707
753
|
|
data/README.md
CHANGED
|
@@ -5,32 +5,35 @@ Official Ruby SDK for the **1MSG WhatsApp Business API**.
|
|
|
5
5
|
This document is generated from the public OpenAPI contract. It covers install,
|
|
6
6
|
auth, quick start, and every public operation available in the client.
|
|
7
7
|
|
|
8
|
-
|
|
|
9
|
-
|
|
10
|
-
| **RubyGems** | [`one_msg_sdk`](https://rubygems.org/gems/one_msg_sdk)
|
|
11
|
-
| **Source**
|
|
12
|
-
| **API docs**
|
|
13
|
-
| **Platform**
|
|
14
|
-
| **
|
|
15
|
-
| **
|
|
16
|
-
| **
|
|
17
|
-
| **
|
|
8
|
+
| | |
|
|
9
|
+
| ------------------------- | ------------------------------------------------------------------------------------------------------- |
|
|
10
|
+
| **RubyGems** | [`one_msg_sdk`](https://rubygems.org/gems/one_msg_sdk) |
|
|
11
|
+
| **Source** | [github.com/1msg/1msg-sdk/ruby](https://github.com/1msg/1msg-sdk/tree/main/ruby) |
|
|
12
|
+
| **API docs** | [docs.1msg.io](https://docs.1msg.io/) |
|
|
13
|
+
| **Platform API** | [Inbox](https://1msg.io/docs/reference/inbox) and [Campaigns](https://1msg.io/docs/reference/campaigns) |
|
|
14
|
+
| **Platform** | [platform.1msg.io](https://platform.1msg.io/) |
|
|
15
|
+
| **Support** | support@1msg.io |
|
|
16
|
+
| **OpenAPI version** | 2.0.0 |
|
|
17
|
+
| **Operations** | 63 |
|
|
18
|
+
| **AI agent guide** | [AGENTS.md](./AGENTS.md) |
|
|
19
|
+
|
|
20
|
+
Inbox and Campaigns ship in this package as `PlatformClient` (Bearer API key, not the channel token). Reference: [Inbox](https://1msg.io/docs/reference/inbox) and [Campaigns](https://1msg.io/docs/reference/campaigns). CLI: `1msg inbox` and `1msg campaigns`.
|
|
18
21
|
|
|
19
22
|
---
|
|
20
23
|
|
|
21
24
|
## Install
|
|
22
25
|
|
|
23
26
|
```bash
|
|
24
|
-
gem install one_msg_sdk -v 2.0.
|
|
27
|
+
gem install one_msg_sdk -v 2.0.3
|
|
25
28
|
```
|
|
26
29
|
|
|
27
30
|
## Requirements
|
|
28
31
|
|
|
29
|
-
| Variable
|
|
30
|
-
|
|
31
|
-
| `baseUrl`
|
|
32
|
-
| `instanceId` | Platform → channel id
|
|
33
|
-
| `token`
|
|
32
|
+
| Variable | Where to get it | Example |
|
|
33
|
+
| ------------ | ------------------------------ | --------------------- |
|
|
34
|
+
| `baseUrl` | Platform → channel → API host | `https://api.1msg.io` |
|
|
35
|
+
| `instanceId` | Platform → channel id | `ODI371267300` |
|
|
36
|
+
| `token` | Platform → channel → API token | JWT or API key |
|
|
34
37
|
|
|
35
38
|
Use environment variables (`MSG_API_TOKEN`, `MSG_INSTANCE_ID`). Never commit tokens.
|
|
36
39
|
|
|
@@ -113,7 +116,7 @@ responses: 200, 401, 500
|
|
|
113
116
|
|
|
114
117
|
Call action (connect / pre_accept / accept / reject / terminate)
|
|
115
118
|
|
|
116
|
-
Perform a WhatsApp Calling action (beta). Proxies upstream `POST /calling/calls`. Despite the historical path name `/initiateCall`, this endpoint handles **all** call actions: | action | Use | Required | |--------|-----|----------| | `connect` | Outbound business → user | `to` + `session` (`sdp_type: offer`) | | `pre_accept` | Inbound (optional, reduces audio clipping) | `call_id` + `session` (`sdp_type: answer`) | | `accept` | Inbound answer | `call_id` + `session` (`sdp_type: answer`) | | `reject` | Decline inbound | `call_id` | | `terminate` | Hang up | `call_id` | **SDP / media (critical)** - `accept` / `pre_accept` require a **WebRTC-generated SDP answer**. - Do **not** send Meta's offer SDP back as the answer. - Postman (or curl) alone **cannot** establish real media — you need a WebRTC or SIP stack. 1msg only proxies signaling. Answer within ~**30–60 seconds** of an inbound `connect` webhook or Meta terminates as unanswered. Common Meta errors include Calling not enabled (`138000`), no permission (`138006`), SDP validation failures. **Outbound** requires a prior Call Permission Request (CPR) acceptance. See the **Calling** tag overview for the full outbound flow and CPR limits. Trial / `subscriptionBlocked` → **403** plain text. Upstream failures often return HTTP 200 with `{ "response": { "error": "
|
|
119
|
+
Perform a WhatsApp Calling action (beta). Proxies upstream `POST /calling/calls`. Despite the historical path name `/initiateCall`, this endpoint handles **all** call actions: | action | Use | Required | |--------|-----|----------| | `connect` | Outbound business → user | `to` + `session` (`sdp_type: offer`) | | `pre_accept` | Inbound (optional, reduces audio clipping) | `call_id` + `session` (`sdp_type: answer`) | | `accept` | Inbound answer | `call_id` + `session` (`sdp_type: answer`) | | `reject` | Decline inbound | `call_id` | | `terminate` | Hang up | `call_id` | **SDP / media (critical)** - `accept` / `pre_accept` require a **WebRTC-generated SDP answer**. - Do **not** send Meta's offer SDP back as the answer. - Postman (or curl) alone **cannot** establish real media — you need a WebRTC or SIP stack. 1msg only proxies signaling. Answer within ~**30–60 seconds** of an inbound `connect` webhook or Meta terminates as unanswered. Common Meta errors include Calling not enabled (`138000`), no permission (`138006`), SDP validation failures. **Outbound** requires a prior Call Permission Request (CPR) acceptance. See the **Calling** tag overview for the full outbound flow and CPR limits. Trial / `subscriptionBlocked` → **403** plain text. Upstream failures often return HTTP 200 with `{ "response": { "error": "<upstream message>" } }`. `Invalid API KEY` is used only when Meta/360 body actually indicates an invalid API key or token. Other upstream 401s (notably call permission `138006`) pass through `error.message` / `error_user_msg`.
|
|
117
120
|
|
|
118
121
|
```yaml
|
|
119
122
|
http: POST /initiateCall
|
|
@@ -154,7 +157,7 @@ responses: 200, 401, 500
|
|
|
154
157
|
|
|
155
158
|
Get Commerce Settings
|
|
156
159
|
|
|
157
|
-
Returns catalog/cart commerce settings for the channel. - `is_catalog_visible` — show catalog storefront icon (`true`) or hide it (`false`). - `is_cart_enabled` — enable cart (`true`) or disable it (`false`).
|
|
160
|
+
Returns catalog/cart commerce settings for the channel. Fails with a provider error when the WABA has no catalog linked — that is an API/account limitation, not an MCP schema bug. - `is_catalog_visible` — show catalog storefront icon (`true`) or hide it (`false`). - `is_cart_enabled` — enable cart (`true`) or disable it (`false`).
|
|
158
161
|
|
|
159
162
|
```yaml
|
|
160
163
|
http: GET /commerce
|
|
@@ -165,6 +168,19 @@ responses: 200, 401, 500
|
|
|
165
168
|
|
|
166
169
|
### channel
|
|
167
170
|
|
|
171
|
+
#### `createSettings`
|
|
172
|
+
|
|
173
|
+
Update channel settings
|
|
174
|
+
|
|
175
|
+
Update channel settings. Only send fields you want to change. `webhookUrl` **replaces** the stored list (one URL string, or up to 5 URLs as an array). Passing an empty value clears webhooks. Repeating the same URL(s) also clears a sticky auto-disable. With several URLs, send the complete array to re-enable one of them — omitting a URL removes it from the channel.
|
|
176
|
+
|
|
177
|
+
```yaml
|
|
178
|
+
http: POST /settings
|
|
179
|
+
operationId: createSettings
|
|
180
|
+
clientGroup: channel
|
|
181
|
+
responses: 200, 401, 500
|
|
182
|
+
```
|
|
183
|
+
|
|
168
184
|
#### `getConversationalAutomation`
|
|
169
185
|
|
|
170
186
|
Get conversational automation settings
|
|
@@ -182,7 +198,7 @@ responses: 200, 401, 500
|
|
|
182
198
|
|
|
183
199
|
Get channel status
|
|
184
200
|
|
|
185
|
-
|
|
201
|
+
Return WhatsApp Cloud API connection status for this channel (`connected` when the number can send). May include `accountStatus`, messaging limit, and MM Lite availability. Optional `health_status_warning` appears only when Meta Graph health could not be loaded and a soft `connected` response is returned. Omitted on the normal path and when health details are not applicable for the channel — never an internal provider/transport name.
|
|
186
202
|
|
|
187
203
|
```yaml
|
|
188
204
|
http: GET /status
|
|
@@ -191,6 +207,19 @@ clientGroup: channel
|
|
|
191
207
|
responses: 200, 401, 500
|
|
192
208
|
```
|
|
193
209
|
|
|
210
|
+
#### `listSettings`
|
|
211
|
+
|
|
212
|
+
Get channel settings
|
|
213
|
+
|
|
214
|
+
Return channel settings: webhook URL(s), delivery flags, and analytics toggles. Auto-disable / circuit state matches `GET /webhook`. **Prefer `webhookStatuses`** (one row per configured URL). The breaker is per URL, not per channel. Channel-level `haveDisabledWebhooks` is `true` when **at least one** URL in `webhookUrl` is sticky auto-disabled — not "the channel is dead". Live URLs still receive events. Top-level `circuitState` / `reason` / `fails` / `trips` are a compatibility summary of one URL (first sticky-disabled, else first configured). This is the same `GET /settings` endpoint as the REST API (previously missing from MCP).
|
|
215
|
+
|
|
216
|
+
```yaml
|
|
217
|
+
http: GET /settings
|
|
218
|
+
operationId: listSettings
|
|
219
|
+
clientGroup: channel
|
|
220
|
+
responses: 200, 401, 500
|
|
221
|
+
```
|
|
222
|
+
|
|
194
223
|
#### `setConversationalAutomation`
|
|
195
224
|
|
|
196
225
|
Set conversational automation settings
|
|
@@ -210,11 +239,13 @@ responses: 200, 401, 500
|
|
|
210
239
|
|
|
211
240
|
Create Flow
|
|
212
241
|
|
|
242
|
+
Create a WhatsApp Flow (`name` + `categories` required). Currently returns HTTP 501 until the Meta Graph Flows rewrite is available.
|
|
243
|
+
|
|
213
244
|
```yaml
|
|
214
245
|
http: POST /flows
|
|
215
246
|
operationId: createFlows
|
|
216
247
|
clientGroup: flows
|
|
217
|
-
responses: 200
|
|
248
|
+
responses: 200, 501
|
|
218
249
|
```
|
|
219
250
|
|
|
220
251
|
#### `createFlowsFlowIdDeprecate`
|
|
@@ -289,33 +320,39 @@ responses: 200, 401, 500
|
|
|
289
320
|
|
|
290
321
|
List Flows
|
|
291
322
|
|
|
323
|
+
List WhatsApp Flows for the WABA. Currently returns HTTP 501 until the Meta Graph Flows rewrite is available.
|
|
324
|
+
|
|
292
325
|
```yaml
|
|
293
326
|
http: GET /flows
|
|
294
327
|
operationId: listFlows
|
|
295
328
|
clientGroup: flows
|
|
296
|
-
responses: 200
|
|
329
|
+
responses: 200, 501
|
|
297
330
|
```
|
|
298
331
|
|
|
299
332
|
#### `patchFlowsFlowIdAssets`
|
|
300
333
|
|
|
301
334
|
Update Flow Structure
|
|
302
335
|
|
|
336
|
+
Replace the Flow JSON document (`flowJson`). Currently returns HTTP 501 until the Meta Graph Flows rewrite is available.
|
|
337
|
+
|
|
303
338
|
```yaml
|
|
304
339
|
http: PATCH /flows/{flowId}/assets
|
|
305
340
|
operationId: patchFlowsFlowIdAssets
|
|
306
341
|
clientGroup: flows
|
|
307
|
-
responses: 200
|
|
342
|
+
responses: 200, 501
|
|
308
343
|
```
|
|
309
344
|
|
|
310
345
|
#### `patchFlowsFlowIdMetadata`
|
|
311
346
|
|
|
312
347
|
Update Flow Metadata
|
|
313
348
|
|
|
349
|
+
Update Flow `name`, `categories`, and/or `endpointUri`. Currently returns HTTP 501 until the Meta Graph Flows rewrite is available.
|
|
350
|
+
|
|
314
351
|
```yaml
|
|
315
352
|
http: PATCH /flows/{flowId}/metadata
|
|
316
353
|
operationId: patchFlowsFlowIdMetadata
|
|
317
354
|
clientGroup: flows
|
|
318
|
-
responses: 200
|
|
355
|
+
responses: 200, 501
|
|
319
356
|
```
|
|
320
357
|
|
|
321
358
|
#### `setWhatsappBusinessEncryption`
|
|
@@ -348,6 +385,8 @@ responses: 200
|
|
|
348
385
|
|
|
349
386
|
Update Group Info
|
|
350
387
|
|
|
388
|
+
Update group subject, description, and/or profile picture. Path `groupId` is the WABA group id (without `@g.us`).
|
|
389
|
+
|
|
351
390
|
```yaml
|
|
352
391
|
http: POST /groups/{groupId}
|
|
353
392
|
operationId: createGroupsGroupId
|
|
@@ -403,6 +442,8 @@ responses: 200
|
|
|
403
442
|
|
|
404
443
|
Get Groups List
|
|
405
444
|
|
|
445
|
+
List WhatsApp groups for this channel. Paginate with `limit`, `before`, and `after`.
|
|
446
|
+
|
|
406
447
|
```yaml
|
|
407
448
|
http: GET /groups
|
|
408
449
|
operationId: listGroups
|
|
@@ -427,6 +468,8 @@ responses: 200, 401
|
|
|
427
468
|
|
|
428
469
|
Upload media
|
|
429
470
|
|
|
471
|
+
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).
|
|
472
|
+
|
|
430
473
|
```yaml
|
|
431
474
|
http: POST /uploadMedia
|
|
432
475
|
operationId: createUploadMedia
|
|
@@ -475,6 +518,8 @@ responses: 200, 401, 500
|
|
|
475
518
|
|
|
476
519
|
Get messages list
|
|
477
520
|
|
|
521
|
+
List stored chat history for this channel (requires history storage). Filter with `chatId`, `limit`, `last`, message numbers, or time bounds.
|
|
522
|
+
|
|
478
523
|
```yaml
|
|
479
524
|
http: GET /messages
|
|
480
525
|
operationId: listMessages
|
|
@@ -523,7 +568,7 @@ responses: 200, 400, 401, 429, 500
|
|
|
523
568
|
|
|
524
569
|
Send Carousel
|
|
525
570
|
|
|
526
|
-
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
|
|
571
|
+
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.
|
|
527
572
|
|
|
528
573
|
```yaml
|
|
529
574
|
http: POST /sendCarousel
|
|
@@ -536,6 +581,8 @@ responses: 200, 400, 401, 429, 500
|
|
|
536
581
|
|
|
537
582
|
Send a Contact
|
|
538
583
|
|
|
584
|
+
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).
|
|
585
|
+
|
|
539
586
|
```yaml
|
|
540
587
|
http: POST /sendContact
|
|
541
588
|
operationId: sendContact
|
|
@@ -543,6 +590,19 @@ clientGroup: messaging
|
|
|
543
590
|
responses: 200, 400, 401, 429, 500
|
|
544
591
|
```
|
|
545
592
|
|
|
593
|
+
#### `sendContactInfo`
|
|
594
|
+
|
|
595
|
+
Request the user's phone number
|
|
596
|
+
|
|
597
|
+
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.
|
|
598
|
+
|
|
599
|
+
```yaml
|
|
600
|
+
http: POST /sendContactInfo
|
|
601
|
+
operationId: sendContactInfo
|
|
602
|
+
clientGroup: messaging
|
|
603
|
+
responses: 200, 400, 401, 429, 500
|
|
604
|
+
```
|
|
605
|
+
|
|
546
606
|
#### `sendCtaUrl`
|
|
547
607
|
|
|
548
608
|
Send CTA URL interactive message
|
|
@@ -621,7 +681,7 @@ responses: 200, 400, 401, 429, 500
|
|
|
621
681
|
|
|
622
682
|
Send a Message
|
|
623
683
|
|
|
624
|
-
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.
|
|
684
|
+
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.
|
|
625
685
|
|
|
626
686
|
```yaml
|
|
627
687
|
http: POST /sendMessage
|
|
@@ -660,6 +720,8 @@ responses: 200, 400, 401, 500
|
|
|
660
720
|
|
|
661
721
|
Send a Product
|
|
662
722
|
|
|
723
|
+
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": "..." }] }] }`
|
|
724
|
+
|
|
663
725
|
```yaml
|
|
664
726
|
http: POST /sendProduct
|
|
665
727
|
operationId: sendProduct
|
|
@@ -697,7 +759,7 @@ responses: 200, 400, 401, 429, 500
|
|
|
697
759
|
|
|
698
760
|
Get Profile Info
|
|
699
761
|
|
|
700
|
-
|
|
762
|
+
Return the WhatsApp Business profile for this channel: About, address, description, email, phone, websites, industry (`vertical`), and profile photo URL.
|
|
701
763
|
|
|
702
764
|
```yaml
|
|
703
765
|
http: GET /me
|
|
@@ -725,6 +787,8 @@ responses: 200, 401, 422, 500
|
|
|
725
787
|
|
|
726
788
|
Create message template
|
|
727
789
|
|
|
790
|
+
Create a WABA message template (`name`, `category`, `language`, `components`). After create, Meta reviews the template; list it with `GET /templates`. Authentication OTP templates (`category: AUTHENTICATION`, copy-code / OTP button) can later be sent only to a phone number. Meta does not accept a BSUID recipient for them (error 131062). If the recipient is known only by BSUID — for example they use a username and their phone number is not in your Business Portfolio — that template cannot be sent. To ask a BSUID user for their phone number, add a `REQUEST_CONTACT_INFO` button on a `UTILITY` or `MARKETING` template. Do not send `text` on that button — WhatsApp sets the label (and rejects a custom one). The button also has no send-time parameters: `POST /sendTemplate` does not take a button component for it. Inside an open 24-hour window, call `POST /sendContactInfo` instead of a template. When the user shares the number, the inbound webhook is a `contacts` message with `origin: contact_request`. The phone is stored on that BSUID automatically. See `POST /sendContactInfo`. ```json { "name": "request_phone", "category": "UTILITY", "language": "en_US", "components": [ { "type": "BODY", "text": "Please share your phone number so we can continue." }, { "type": "BUTTONS", "buttons": [{ "type": "REQUEST_CONTACT_INFO" }] } ] } ```
|
|
791
|
+
|
|
728
792
|
```yaml
|
|
729
793
|
http: POST /addTemplate
|
|
730
794
|
operationId: addTemplate
|
|
@@ -736,6 +800,8 @@ responses: 200, 401, 500
|
|
|
736
800
|
|
|
737
801
|
Get templates list
|
|
738
802
|
|
|
803
|
+
List message templates. Paginate with `limit` / `offset`; sort by `id`, `name`, or `status`.
|
|
804
|
+
|
|
739
805
|
```yaml
|
|
740
806
|
http: GET /templates
|
|
741
807
|
operationId: listTemplates
|
|
@@ -747,6 +813,8 @@ responses: 200
|
|
|
747
813
|
|
|
748
814
|
Remove message template
|
|
749
815
|
|
|
816
|
+
Delete a message template by `name` (all language versions of that name).
|
|
817
|
+
|
|
750
818
|
```yaml
|
|
751
819
|
http: POST /removeTemplate
|
|
752
820
|
operationId: removeTemplate
|
|
@@ -758,7 +826,7 @@ responses: 200, 401, 500
|
|
|
758
826
|
|
|
759
827
|
Send Template Message
|
|
760
828
|
|
|
761
|
-
Send a WhatsApp template message (works outside the 24-hour session window). Supported `params` button `sub_type` values include: `url`, `quick_reply`, `copy_code` / `coupon_code`, `catalog`, `flow`, `limited_time_offer`, and **`order_details`** (WhatsApp Payments **India only** — requires an approved Utility template with an ORDER_DETAILS button).
|
|
829
|
+
Send a WhatsApp **template** message (works outside the 24-hour session window). Use this tool — not `send_message` — when the 24h session is closed. `params` MUST be Cloud API **component objects**, never a flat list of strings and never the old On-Prem `hsm` / `localizable_params` format. Example body variable `{{1}}`: ```json { "type": "body", "parameters": [{ "type": "text", "text": "Ivan" }] } ``` Do not send `"type": "hsm"` and do not send `params: ["Ivan", "123"]`. Supported `params` button `sub_type` values include: `url`, `quick_reply`, `copy_code` / `coupon_code`, `catalog`, `flow`, `limited_time_offer`, and **`order_details`** (WhatsApp Payments **India only** — requires an approved Utility template with an ORDER_DETAILS button). Convenience wrapper with structured fields: `POST /sendOrderDetails`. Authentication OTP templates (category `AUTHENTICATION`, or a template with an OTP / copy-code button) can only be sent to a phone number (`phone` or a phone `chatId`). Meta rejects a BSUID `recipient` for these templates with error 131062. If the recipient is known only by BSUID — for example they use a username and their phone number is not in your Business Portfolio — the template cannot be sent. A `REQUEST_CONTACT_INFO` button (UTILITY or MARKETING only) has no send-time parameters. Do not add a button component for it in `params`, and do not send button text — WhatsApp sets that label on the template. Create the button with `POST /addTemplate` as `{ "type": "REQUEST_CONTACT_INFO" }` with no `text`. Inside an open 24-hour window, `POST /sendContactInfo` asks for the number without a template.
|
|
762
830
|
|
|
763
831
|
```yaml
|
|
764
832
|
http: POST /sendTemplate
|
|
@@ -810,7 +878,7 @@ responses: 200, 400, 401, 500
|
|
|
810
878
|
|
|
811
879
|
Get webhook URL
|
|
812
880
|
|
|
813
|
-
|
|
881
|
+
Return the webhook URL(s) currently configured for this channel, plus delivery status for each URL. `webhookUrl` is a string when a single URL is set, an array of strings when multiple URLs are configured, or `null` if none is set. **Prefer `webhookStatuses`.** The circuit breaker is per URL, not per channel. If 1 of 4 URLs is sticky-disabled, that URL is skipped; the other three still receive events. Send/receive are not affected. Channel-level `haveDisabledWebhooks`, `circuitState`, `reason`, `fails`, `trips`, and timestamps are a compatibility summary of **one** URL (the first sticky-disabled URL, else the first configured URL). They are not "the channel is dead". - `haveDisabledWebhooks` — `true` when **at least one** URL in `webhookUrl` is sticky auto-disabled. Live URLs still get events. - `circuitState` — compressed scalar for that same primary URL: `ok` | `degraded` | `open` | `half_open` | `disabled`. - `disabledWebhooks` — currently configured URLs that are sticky-disabled (subset of `webhookUrl`). - `webhookStatuses` — one row per currently configured URL. Use this array to see which endpoints are live vs skipped. - `fails` / `trips` / `firstFailAt` — **diagnostics for support**, not product UI. `fails` = failures in a rolling ~10 minute window (not lifetime). `trips` = failed recovery probes on the 15 min → 1 h → 6 h schedule (sticky disable after 3). Clients can ignore these and use `webhookStatuses` + `disabledWebhooks` only. Sticky disable skips delivery; it does not unconfigure the URL (it stays in `webhookUrl`). Re-enable with `POST /webhook` or `POST /settings`. Those endpoints **replace** the whole list — with multiple URLs, send the full array.
|
|
814
882
|
|
|
815
883
|
```yaml
|
|
816
884
|
http: GET /webhook
|
|
@@ -823,7 +891,7 @@ responses: 200, 401, 500
|
|
|
823
891
|
|
|
824
892
|
Set webhook URL
|
|
825
893
|
|
|
826
|
-
|
|
894
|
+
Set the client webhook URL that receives inbound events for this channel. **Replaces** the stored webhook list (it does not append). To deliver the same events to several endpoints, pass an array in `webhookUrl` (max 5) or use `POST /settings`. With several URLs already configured, posting only the disabled URL **drops the others** — send the complete array to re-enable one of many. Incoming payloads include messages, delivery ACKs, group updates, coexistence echoes, and calling events. WhatsApp Calling payloads (`type: "calls"`) are documented under the **Calling** tag. Call permission replies arrive on the normal messages path (`call_permission_reply`). Repeating `POST /webhook` with the same URL(s) clears an auto-disable (self-serve re-enable). Send/receive are not affected by webhook auto-disable.
|
|
827
895
|
|
|
828
896
|
```yaml
|
|
829
897
|
http: POST /webhook
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# OneMsgSdk::AddTemplate200Response
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **response** | **Hash<String, Object>** | Upstream create-template payload | [optional] |
|
|
8
|
+
|
|
9
|
+
## Example
|
|
10
|
+
|
|
11
|
+
```ruby
|
|
12
|
+
require 'one_msg_sdk'
|
|
13
|
+
|
|
14
|
+
instance = OneMsgSdk::AddTemplate200Response.new(
|
|
15
|
+
response: null
|
|
16
|
+
)
|
|
17
|
+
```
|
|
18
|
+
|