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
data/docs/MessagingApi.md
CHANGED
|
@@ -15,6 +15,7 @@ All URIs are relative to *https://api.1msg.io*
|
|
|
15
15
|
| [**send_button**](MessagingApi.md#send_button) | **POST** /sendButton | Send Reply Buttons Message |
|
|
16
16
|
| [**send_carousel**](MessagingApi.md#send_carousel) | **POST** /sendCarousel | Send Carousel |
|
|
17
17
|
| [**send_contact**](MessagingApi.md#send_contact) | **POST** /sendContact | Send a Contact |
|
|
18
|
+
| [**send_contact_info**](MessagingApi.md#send_contact_info) | **POST** /sendContactInfo | Request the user's phone number |
|
|
18
19
|
| [**send_cta_url**](MessagingApi.md#send_cta_url) | **POST** /sendCtaUrl | Send CTA URL interactive message |
|
|
19
20
|
| [**send_file**](MessagingApi.md#send_file) | **POST** /sendFile | Send a File |
|
|
20
21
|
| [**send_flow**](MessagingApi.md#send_flow) | **POST** /sendFlow | Send WhatsApp Flow Message |
|
|
@@ -108,10 +109,12 @@ end
|
|
|
108
109
|
|
|
109
110
|
## create_upload_media
|
|
110
111
|
|
|
111
|
-
> create_upload_media(token,
|
|
112
|
+
> <CreateUploadMedia200Response> create_upload_media(token, create_upload_media_request)
|
|
112
113
|
|
|
113
114
|
Upload media
|
|
114
115
|
|
|
116
|
+
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).
|
|
117
|
+
|
|
115
118
|
### Examples
|
|
116
119
|
|
|
117
120
|
```ruby
|
|
@@ -127,13 +130,12 @@ end
|
|
|
127
130
|
|
|
128
131
|
api_instance = OneMsgSdk::MessagingApi.new
|
|
129
132
|
token = 'token_example' # String | JWT token or API key for authorization
|
|
130
|
-
|
|
131
|
-
request_body: { key: 3.56} # Hash<String, Object> |
|
|
132
|
-
}
|
|
133
|
+
create_upload_media_request = OneMsgSdk::CreateUploadMediaRequest.new # CreateUploadMediaRequest |
|
|
133
134
|
|
|
134
135
|
begin
|
|
135
136
|
# Upload media
|
|
136
|
-
api_instance.create_upload_media(token,
|
|
137
|
+
result = api_instance.create_upload_media(token, create_upload_media_request)
|
|
138
|
+
p result
|
|
137
139
|
rescue OneMsgSdk::ApiError => e
|
|
138
140
|
puts "Error when calling MessagingApi->create_upload_media: #{e}"
|
|
139
141
|
end
|
|
@@ -141,17 +143,17 @@ end
|
|
|
141
143
|
|
|
142
144
|
#### Using the create_upload_media_with_http_info variant
|
|
143
145
|
|
|
144
|
-
This returns an Array which contains the response data
|
|
146
|
+
This returns an Array which contains the response data, status code and headers.
|
|
145
147
|
|
|
146
|
-
> <Array(
|
|
148
|
+
> <Array(<CreateUploadMedia200Response>, Integer, Hash)> create_upload_media_with_http_info(token, create_upload_media_request)
|
|
147
149
|
|
|
148
150
|
```ruby
|
|
149
151
|
begin
|
|
150
152
|
# Upload media
|
|
151
|
-
data, status_code, headers = api_instance.create_upload_media_with_http_info(token,
|
|
153
|
+
data, status_code, headers = api_instance.create_upload_media_with_http_info(token, create_upload_media_request)
|
|
152
154
|
p status_code # => 2xx
|
|
153
155
|
p headers # => { ... }
|
|
154
|
-
p data # =>
|
|
156
|
+
p data # => <CreateUploadMedia200Response>
|
|
155
157
|
rescue OneMsgSdk::ApiError => e
|
|
156
158
|
puts "Error when calling MessagingApi->create_upload_media_with_http_info: #{e}"
|
|
157
159
|
end
|
|
@@ -162,11 +164,11 @@ end
|
|
|
162
164
|
| Name | Type | Description | Notes |
|
|
163
165
|
| ---- | ---- | ----------- | ----- |
|
|
164
166
|
| **token** | **String** | JWT token or API key for authorization | |
|
|
165
|
-
| **
|
|
167
|
+
| **create_upload_media_request** | [**CreateUploadMediaRequest**](CreateUploadMediaRequest.md) | | |
|
|
166
168
|
|
|
167
169
|
### Return type
|
|
168
170
|
|
|
169
|
-
|
|
171
|
+
[**CreateUploadMedia200Response**](CreateUploadMedia200Response.md)
|
|
170
172
|
|
|
171
173
|
### Authorization
|
|
172
174
|
|
|
@@ -175,7 +177,7 @@ nil (empty response body)
|
|
|
175
177
|
### HTTP request headers
|
|
176
178
|
|
|
177
179
|
- **Content-Type**: application/json
|
|
178
|
-
- **Accept**:
|
|
180
|
+
- **Accept**: application/json
|
|
179
181
|
|
|
180
182
|
|
|
181
183
|
## delete_media
|
|
@@ -395,10 +397,12 @@ end
|
|
|
395
397
|
|
|
396
398
|
## list_messages
|
|
397
399
|
|
|
398
|
-
> <ListMessages200Response> list_messages(token)
|
|
400
|
+
> <ListMessages200Response> list_messages(token, opts)
|
|
399
401
|
|
|
400
402
|
Get messages list
|
|
401
403
|
|
|
404
|
+
List stored chat history for this channel (requires history storage). Filter with `chatId`, `limit`, `last`, message numbers, or time bounds.
|
|
405
|
+
|
|
402
406
|
### Examples
|
|
403
407
|
|
|
404
408
|
```ruby
|
|
@@ -414,10 +418,20 @@ end
|
|
|
414
418
|
|
|
415
419
|
api_instance = OneMsgSdk::MessagingApi.new
|
|
416
420
|
token = 'token_example' # String | JWT token or API key for authorization
|
|
421
|
+
opts = {
|
|
422
|
+
chat_id: 'chat_id_example', # String | Filter messages for one chat (`phone@c.us`, group `@g.us`, or BSUID `@lid`)
|
|
423
|
+
limit: 56, # Integer | Max rows to return (default 100)
|
|
424
|
+
last: true, # Boolean | If true, return the latest messages (DESC). Default false.
|
|
425
|
+
last_message_number: 56, # Integer |
|
|
426
|
+
first_message_number: 56, # Integer |
|
|
427
|
+
min_time: 56, # Integer | Unix timestamp lower bound
|
|
428
|
+
max_time: 56, # Integer | Unix timestamp upper bound
|
|
429
|
+
msg_id: 'msg_id_example' # String | Filter by stored message id
|
|
430
|
+
}
|
|
417
431
|
|
|
418
432
|
begin
|
|
419
433
|
# Get messages list
|
|
420
|
-
result = api_instance.list_messages(token)
|
|
434
|
+
result = api_instance.list_messages(token, opts)
|
|
421
435
|
p result
|
|
422
436
|
rescue OneMsgSdk::ApiError => e
|
|
423
437
|
puts "Error when calling MessagingApi->list_messages: #{e}"
|
|
@@ -428,12 +442,12 @@ end
|
|
|
428
442
|
|
|
429
443
|
This returns an Array which contains the response data, status code and headers.
|
|
430
444
|
|
|
431
|
-
> <Array(<ListMessages200Response>, Integer, Hash)> list_messages_with_http_info(token)
|
|
445
|
+
> <Array(<ListMessages200Response>, Integer, Hash)> list_messages_with_http_info(token, opts)
|
|
432
446
|
|
|
433
447
|
```ruby
|
|
434
448
|
begin
|
|
435
449
|
# Get messages list
|
|
436
|
-
data, status_code, headers = api_instance.list_messages_with_http_info(token)
|
|
450
|
+
data, status_code, headers = api_instance.list_messages_with_http_info(token, opts)
|
|
437
451
|
p status_code # => 2xx
|
|
438
452
|
p headers # => { ... }
|
|
439
453
|
p data # => <ListMessages200Response>
|
|
@@ -447,6 +461,14 @@ end
|
|
|
447
461
|
| Name | Type | Description | Notes |
|
|
448
462
|
| ---- | ---- | ----------- | ----- |
|
|
449
463
|
| **token** | **String** | JWT token or API key for authorization | |
|
|
464
|
+
| **chat_id** | **String** | Filter messages for one chat (`phone@c.us`, group `@g.us`, or BSUID `@lid`) | [optional] |
|
|
465
|
+
| **limit** | **Integer** | Max rows to return (default 100) | [optional] |
|
|
466
|
+
| **last** | **Boolean** | If true, return the latest messages (DESC). Default false. | [optional] |
|
|
467
|
+
| **last_message_number** | **Integer** | | [optional] |
|
|
468
|
+
| **first_message_number** | **Integer** | | [optional] |
|
|
469
|
+
| **min_time** | **Integer** | Unix timestamp lower bound | [optional] |
|
|
470
|
+
| **max_time** | **Integer** | Unix timestamp upper bound | [optional] |
|
|
471
|
+
| **msg_id** | **String** | Filter by stored message id | [optional] |
|
|
450
472
|
|
|
451
473
|
### Return type
|
|
452
474
|
|
|
@@ -683,11 +705,11 @@ end
|
|
|
683
705
|
|
|
684
706
|
## send_carousel
|
|
685
707
|
|
|
686
|
-
> <MessageSentResponse> send_carousel(token,
|
|
708
|
+
> <MessageSentResponse> send_carousel(token, opts)
|
|
687
709
|
|
|
688
710
|
Send Carousel
|
|
689
711
|
|
|
690
|
-
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
|
|
712
|
+
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.
|
|
691
713
|
|
|
692
714
|
### Examples
|
|
693
715
|
|
|
@@ -704,9 +726,10 @@ end
|
|
|
704
726
|
|
|
705
727
|
api_instance = OneMsgSdk::MessagingApi.new
|
|
706
728
|
token = 'token_example' # String | JWT token or API key for authorization
|
|
707
|
-
params = [3.56] # 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\\\": \\\"...\\\"}
|
|
708
729
|
opts = {
|
|
709
730
|
body: 'body_example', # String | Text shown above the carousel. Optional. If omitted and params include a body component, the body will be taken from params.
|
|
731
|
+
cards: [{ key: 3.56}], # Array<Hash<String, Object>> | Preferred. 2–10 carousel cards (header + body + CTA or quick replies).
|
|
732
|
+
params: [3.56], # 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\\\": \\\"...\\\"}
|
|
710
733
|
quoted_msg_id: 'quoted_msg_id_example', # String | Quoted message ID (Cloud API)
|
|
711
734
|
chat_id: 'chat_id_example', # String | Required if phone is not set. Chat ID from the message list. Examples: 12020721369@c.us or 120363046942338209@g.us(group)
|
|
712
735
|
phone: 56 # Integer | Required if chatId is not set. A phone number starting with the country code. USA example: 12020721369.
|
|
@@ -714,7 +737,7 @@ opts = {
|
|
|
714
737
|
|
|
715
738
|
begin
|
|
716
739
|
# Send Carousel
|
|
717
|
-
result = api_instance.send_carousel(token,
|
|
740
|
+
result = api_instance.send_carousel(token, opts)
|
|
718
741
|
p result
|
|
719
742
|
rescue OneMsgSdk::ApiError => e
|
|
720
743
|
puts "Error when calling MessagingApi->send_carousel: #{e}"
|
|
@@ -725,12 +748,12 @@ end
|
|
|
725
748
|
|
|
726
749
|
This returns an Array which contains the response data, status code and headers.
|
|
727
750
|
|
|
728
|
-
> <Array(<MessageSentResponse>, Integer, Hash)> send_carousel_with_http_info(token,
|
|
751
|
+
> <Array(<MessageSentResponse>, Integer, Hash)> send_carousel_with_http_info(token, opts)
|
|
729
752
|
|
|
730
753
|
```ruby
|
|
731
754
|
begin
|
|
732
755
|
# Send Carousel
|
|
733
|
-
data, status_code, headers = api_instance.send_carousel_with_http_info(token,
|
|
756
|
+
data, status_code, headers = api_instance.send_carousel_with_http_info(token, opts)
|
|
734
757
|
p status_code # => 2xx
|
|
735
758
|
p headers # => { ... }
|
|
736
759
|
p data # => <MessageSentResponse>
|
|
@@ -744,8 +767,9 @@ end
|
|
|
744
767
|
| Name | Type | Description | Notes |
|
|
745
768
|
| ---- | ---- | ----------- | ----- |
|
|
746
769
|
| **token** | **String** | JWT token or API key for authorization | |
|
|
747
|
-
| **params** | [**Array<Object>**](Object.md) | 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\\\": \\\"...\\\"} | |
|
|
748
770
|
| **body** | **String** | Text shown above the carousel. Optional. If omitted and params include a body component, the body will be taken from params. | [optional] |
|
|
771
|
+
| **cards** | [**Array<Hash<String, Object>>**](Hash<String, Object>.md) | Preferred. 2–10 carousel cards (header + body + CTA or quick replies). | [optional] |
|
|
772
|
+
| **params** | [**Array<Object>**](Object.md) | 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\\\": \\\"...\\\"} | [optional] |
|
|
749
773
|
| **quoted_msg_id** | **String** | Quoted message ID (Cloud API) | [optional] |
|
|
750
774
|
| **chat_id** | **String** | Required if phone is not set. Chat ID from the message list. Examples: 12020721369@c.us or 120363046942338209@g.us(group) | [optional] |
|
|
751
775
|
| **phone** | **Integer** | Required if chatId is not set. A phone number starting with the country code. USA example: 12020721369. | [optional] |
|
|
@@ -770,6 +794,8 @@ end
|
|
|
770
794
|
|
|
771
795
|
Send a Contact
|
|
772
796
|
|
|
797
|
+
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).
|
|
798
|
+
|
|
773
799
|
### Examples
|
|
774
800
|
|
|
775
801
|
```ruby
|
|
@@ -837,6 +863,81 @@ end
|
|
|
837
863
|
- **Accept**: application/json
|
|
838
864
|
|
|
839
865
|
|
|
866
|
+
## send_contact_info
|
|
867
|
+
|
|
868
|
+
> <MessageSentResponse> send_contact_info(token, opts)
|
|
869
|
+
|
|
870
|
+
Request the user's phone number
|
|
871
|
+
|
|
872
|
+
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.
|
|
873
|
+
|
|
874
|
+
### Examples
|
|
875
|
+
|
|
876
|
+
```ruby
|
|
877
|
+
require 'time'
|
|
878
|
+
require 'one_msg_sdk'
|
|
879
|
+
# setup authorization
|
|
880
|
+
OneMsgSdk.configure do |config|
|
|
881
|
+
# Configure API key authorization: tokenAuth
|
|
882
|
+
config.api_key['token'] = 'YOUR API KEY'
|
|
883
|
+
# Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
|
|
884
|
+
# config.api_key_prefix['token'] = 'Bearer'
|
|
885
|
+
end
|
|
886
|
+
|
|
887
|
+
api_instance = OneMsgSdk::MessagingApi.new
|
|
888
|
+
token = 'token_example' # String | JWT token or API key for authorization
|
|
889
|
+
opts = {
|
|
890
|
+
send_contact_info_request: OneMsgSdk::SendContactInfoRequest.new({body: 'body_example'}) # SendContactInfoRequest |
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
begin
|
|
894
|
+
# Request the user's phone number
|
|
895
|
+
result = api_instance.send_contact_info(token, opts)
|
|
896
|
+
p result
|
|
897
|
+
rescue OneMsgSdk::ApiError => e
|
|
898
|
+
puts "Error when calling MessagingApi->send_contact_info: #{e}"
|
|
899
|
+
end
|
|
900
|
+
```
|
|
901
|
+
|
|
902
|
+
#### Using the send_contact_info_with_http_info variant
|
|
903
|
+
|
|
904
|
+
This returns an Array which contains the response data, status code and headers.
|
|
905
|
+
|
|
906
|
+
> <Array(<MessageSentResponse>, Integer, Hash)> send_contact_info_with_http_info(token, opts)
|
|
907
|
+
|
|
908
|
+
```ruby
|
|
909
|
+
begin
|
|
910
|
+
# Request the user's phone number
|
|
911
|
+
data, status_code, headers = api_instance.send_contact_info_with_http_info(token, opts)
|
|
912
|
+
p status_code # => 2xx
|
|
913
|
+
p headers # => { ... }
|
|
914
|
+
p data # => <MessageSentResponse>
|
|
915
|
+
rescue OneMsgSdk::ApiError => e
|
|
916
|
+
puts "Error when calling MessagingApi->send_contact_info_with_http_info: #{e}"
|
|
917
|
+
end
|
|
918
|
+
```
|
|
919
|
+
|
|
920
|
+
### Parameters
|
|
921
|
+
|
|
922
|
+
| Name | Type | Description | Notes |
|
|
923
|
+
| ---- | ---- | ----------- | ----- |
|
|
924
|
+
| **token** | **String** | JWT token or API key for authorization | |
|
|
925
|
+
| **send_contact_info_request** | [**SendContactInfoRequest**](SendContactInfoRequest.md) | | [optional] |
|
|
926
|
+
|
|
927
|
+
### Return type
|
|
928
|
+
|
|
929
|
+
[**MessageSentResponse**](MessageSentResponse.md)
|
|
930
|
+
|
|
931
|
+
### Authorization
|
|
932
|
+
|
|
933
|
+
[tokenAuth](../README.md#tokenAuth)
|
|
934
|
+
|
|
935
|
+
### HTTP request headers
|
|
936
|
+
|
|
937
|
+
- **Content-Type**: application/json
|
|
938
|
+
- **Accept**: application/json
|
|
939
|
+
|
|
940
|
+
|
|
840
941
|
## send_cta_url
|
|
841
942
|
|
|
842
943
|
> <MessageSentResponse> send_cta_url(token, send_cta_url_request)
|
|
@@ -1343,7 +1444,7 @@ end
|
|
|
1343
1444
|
|
|
1344
1445
|
Send a Message
|
|
1345
1446
|
|
|
1346
|
-
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.
|
|
1447
|
+
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.
|
|
1347
1448
|
|
|
1348
1449
|
### Examples
|
|
1349
1450
|
|
|
@@ -1363,8 +1464,10 @@ token = 'token_example' # String | JWT token or API key for authorization
|
|
|
1363
1464
|
body = 'body_example' # String | Message text, UTF-8 or UTF-16 string with emoji
|
|
1364
1465
|
opts = {
|
|
1365
1466
|
quoted_msg_id: 'quoted_msg_id_example', # String | Message ID to quote/reply to (Cloud API wamid)
|
|
1366
|
-
chat_id: 'chat_id_example', # String |
|
|
1367
|
-
phone: 56 # Integer | Phone number starting with country code (alternative to chatId)
|
|
1467
|
+
chat_id: 'chat_id_example', # String | Recipient chat ID: phone@c.us, group@g.us, or BSUID@lid
|
|
1468
|
+
phone: 56, # Integer | Phone number starting with country code (alternative to chatId)
|
|
1469
|
+
category: 'utility', # String | 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.
|
|
1470
|
+
direct_send: OneMsgSdk::SendMessageRequestDirectSend.new # SendMessageRequestDirectSend |
|
|
1368
1471
|
}
|
|
1369
1472
|
|
|
1370
1473
|
begin
|
|
@@ -1401,8 +1504,10 @@ end
|
|
|
1401
1504
|
| **token** | **String** | JWT token or API key for authorization | |
|
|
1402
1505
|
| **body** | **String** | Message text, UTF-8 or UTF-16 string with emoji | |
|
|
1403
1506
|
| **quoted_msg_id** | **String** | Message ID to quote/reply to (Cloud API wamid) | [optional] |
|
|
1404
|
-
| **chat_id** | **String** |
|
|
1507
|
+
| **chat_id** | **String** | Recipient chat ID: phone@c.us, group@g.us, or BSUID@lid | [optional] |
|
|
1405
1508
|
| **phone** | **Integer** | Phone number starting with country code (alternative to chatId) | [optional] |
|
|
1509
|
+
| **category** | **String** | 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. | [optional] |
|
|
1510
|
+
| **direct_send** | [**SendMessageRequestDirectSend**](SendMessageRequestDirectSend.md) | | [optional] |
|
|
1406
1511
|
|
|
1407
1512
|
### Return type
|
|
1408
1513
|
|
|
@@ -1566,10 +1671,12 @@ end
|
|
|
1566
1671
|
|
|
1567
1672
|
## send_product
|
|
1568
1673
|
|
|
1569
|
-
> <MessageSentResponse> send_product(token,
|
|
1674
|
+
> <MessageSentResponse> send_product(token, send_product_request)
|
|
1570
1675
|
|
|
1571
1676
|
Send a Product
|
|
1572
1677
|
|
|
1678
|
+
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\": \"...\" }] }] }`
|
|
1679
|
+
|
|
1573
1680
|
### Examples
|
|
1574
1681
|
|
|
1575
1682
|
```ruby
|
|
@@ -1585,13 +1692,11 @@ end
|
|
|
1585
1692
|
|
|
1586
1693
|
api_instance = OneMsgSdk::MessagingApi.new
|
|
1587
1694
|
token = 'token_example' # String | JWT token or API key for authorization
|
|
1588
|
-
|
|
1589
|
-
request_body: { key: 3.56} # Hash<String, Object> |
|
|
1590
|
-
}
|
|
1695
|
+
send_product_request = OneMsgSdk::SendProductRequest.new({action: { key: 3.56}}) # SendProductRequest |
|
|
1591
1696
|
|
|
1592
1697
|
begin
|
|
1593
1698
|
# Send a Product
|
|
1594
|
-
result = api_instance.send_product(token,
|
|
1699
|
+
result = api_instance.send_product(token, send_product_request)
|
|
1595
1700
|
p result
|
|
1596
1701
|
rescue OneMsgSdk::ApiError => e
|
|
1597
1702
|
puts "Error when calling MessagingApi->send_product: #{e}"
|
|
@@ -1602,12 +1707,12 @@ end
|
|
|
1602
1707
|
|
|
1603
1708
|
This returns an Array which contains the response data, status code and headers.
|
|
1604
1709
|
|
|
1605
|
-
> <Array(<MessageSentResponse>, Integer, Hash)> send_product_with_http_info(token,
|
|
1710
|
+
> <Array(<MessageSentResponse>, Integer, Hash)> send_product_with_http_info(token, send_product_request)
|
|
1606
1711
|
|
|
1607
1712
|
```ruby
|
|
1608
1713
|
begin
|
|
1609
1714
|
# Send a Product
|
|
1610
|
-
data, status_code, headers = api_instance.send_product_with_http_info(token,
|
|
1715
|
+
data, status_code, headers = api_instance.send_product_with_http_info(token, send_product_request)
|
|
1611
1716
|
p status_code # => 2xx
|
|
1612
1717
|
p headers # => { ... }
|
|
1613
1718
|
p data # => <MessageSentResponse>
|
|
@@ -1621,7 +1726,7 @@ end
|
|
|
1621
1726
|
| Name | Type | Description | Notes |
|
|
1622
1727
|
| ---- | ---- | ----------- | ----- |
|
|
1623
1728
|
| **token** | **String** | JWT token or API key for authorization | |
|
|
1624
|
-
| **
|
|
1729
|
+
| **send_product_request** | [**SendProductRequest**](SendProductRequest.md) | | |
|
|
1625
1730
|
|
|
1626
1731
|
### Return type
|
|
1627
1732
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# OneMsgSdk::PatchFlowsFlowIdAssetsRequest
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **flow_json** | **Hash<String, Object>** | WhatsApp Flow JSON document | |
|
|
8
|
+
|
|
9
|
+
## Example
|
|
10
|
+
|
|
11
|
+
```ruby
|
|
12
|
+
require 'one_msg_sdk'
|
|
13
|
+
|
|
14
|
+
instance = OneMsgSdk::PatchFlowsFlowIdAssetsRequest.new(
|
|
15
|
+
flow_json: null
|
|
16
|
+
)
|
|
17
|
+
```
|
|
18
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# OneMsgSdk::PatchFlowsFlowIdMetadataRequest
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **name** | **String** | | [optional] |
|
|
8
|
+
| **categories** | **Array<String>** | | [optional] |
|
|
9
|
+
| **endpoint_uri** | **String** | HTTPS endpoint for the Flow data channel | [optional] |
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```ruby
|
|
14
|
+
require 'one_msg_sdk'
|
|
15
|
+
|
|
16
|
+
instance = OneMsgSdk::PatchFlowsFlowIdMetadataRequest.new(
|
|
17
|
+
name: null,
|
|
18
|
+
categories: null,
|
|
19
|
+
endpoint_uri: null
|
|
20
|
+
)
|
|
21
|
+
```
|
|
22
|
+
|
data/docs/ProfileApi.md
CHANGED
|
@@ -14,7 +14,7 @@ All URIs are relative to *https://api.1msg.io*
|
|
|
14
14
|
|
|
15
15
|
Get Profile Info
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Return the WhatsApp Business profile for this channel: About, address, description, email, phone, websites, industry (`vertical`), and profile photo URL.
|
|
18
18
|
|
|
19
19
|
### Examples
|
|
20
20
|
|
|
@@ -81,7 +81,7 @@ end
|
|
|
81
81
|
|
|
82
82
|
## update_me
|
|
83
83
|
|
|
84
|
-
>
|
|
84
|
+
> <UpdateMe200Response> update_me(token, update_me_request)
|
|
85
85
|
|
|
86
86
|
Update profile info
|
|
87
87
|
|
|
@@ -102,13 +102,11 @@ end
|
|
|
102
102
|
|
|
103
103
|
api_instance = OneMsgSdk::ProfileApi.new
|
|
104
104
|
token = 'token_example' # String | JWT token or API key for authorization
|
|
105
|
-
|
|
106
|
-
update_me_request: OneMsgSdk::UpdateMeRequest.new # UpdateMeRequest |
|
|
107
|
-
}
|
|
105
|
+
update_me_request = OneMsgSdk::UpdateMeRequest.new # UpdateMeRequest |
|
|
108
106
|
|
|
109
107
|
begin
|
|
110
108
|
# Update profile info
|
|
111
|
-
result = api_instance.update_me(token,
|
|
109
|
+
result = api_instance.update_me(token, update_me_request)
|
|
112
110
|
p result
|
|
113
111
|
rescue OneMsgSdk::ApiError => e
|
|
114
112
|
puts "Error when calling ProfileApi->update_me: #{e}"
|
|
@@ -119,15 +117,15 @@ end
|
|
|
119
117
|
|
|
120
118
|
This returns an Array which contains the response data, status code and headers.
|
|
121
119
|
|
|
122
|
-
> <Array(
|
|
120
|
+
> <Array(<UpdateMe200Response>, Integer, Hash)> update_me_with_http_info(token, update_me_request)
|
|
123
121
|
|
|
124
122
|
```ruby
|
|
125
123
|
begin
|
|
126
124
|
# Update profile info
|
|
127
|
-
data, status_code, headers = api_instance.update_me_with_http_info(token,
|
|
125
|
+
data, status_code, headers = api_instance.update_me_with_http_info(token, update_me_request)
|
|
128
126
|
p status_code # => 2xx
|
|
129
127
|
p headers # => { ... }
|
|
130
|
-
p data # =>
|
|
128
|
+
p data # => <UpdateMe200Response>
|
|
131
129
|
rescue OneMsgSdk::ApiError => e
|
|
132
130
|
puts "Error when calling ProfileApi->update_me_with_http_info: #{e}"
|
|
133
131
|
end
|
|
@@ -138,11 +136,11 @@ end
|
|
|
138
136
|
| Name | Type | Description | Notes |
|
|
139
137
|
| ---- | ---- | ----------- | ----- |
|
|
140
138
|
| **token** | **String** | JWT token or API key for authorization | |
|
|
141
|
-
| **update_me_request** | [**UpdateMeRequest**](UpdateMeRequest.md) | |
|
|
139
|
+
| **update_me_request** | [**UpdateMeRequest**](UpdateMeRequest.md) | | |
|
|
142
140
|
|
|
143
141
|
### Return type
|
|
144
142
|
|
|
145
|
-
**
|
|
143
|
+
[**UpdateMe200Response**](UpdateMe200Response.md)
|
|
146
144
|
|
|
147
145
|
### Authorization
|
|
148
146
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# OneMsgSdk::RemoveTemplateRequest
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **name** | **String** | Template name to delete | |
|
|
8
|
+
|
|
9
|
+
## Example
|
|
10
|
+
|
|
11
|
+
```ruby
|
|
12
|
+
require 'one_msg_sdk'
|
|
13
|
+
|
|
14
|
+
instance = OneMsgSdk::RemoveTemplateRequest.new(
|
|
15
|
+
name: null
|
|
16
|
+
)
|
|
17
|
+
```
|
|
18
|
+
|
data/docs/SendButtonRequest.md
CHANGED
|
@@ -4,9 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
|
-
| **phone** | **String** |
|
|
7
|
+
| **phone** | **String** | Recipient phone with country code. Use phone or chatId. | [optional] |
|
|
8
|
+
| **chat_id** | **String** | Recipient chat ID (`phone@c.us`, group `@g.us`, or BSUID `@lid`). Use phone or chatId. | [optional] |
|
|
9
|
+
| **quoted_msg_id** | **String** | Optional Cloud API wamid to quote | [optional] |
|
|
8
10
|
| **body** | **String** | | [optional] |
|
|
9
11
|
| **footer** | **String** | | [optional] |
|
|
12
|
+
| **header** | **Hash<String, Object>** | Optional interactive header (text/image/video/document) | [optional] |
|
|
13
|
+
| **buttons** | **Array<Object>** | Legacy alias for sections (`[{id,title}]`) | [optional] |
|
|
10
14
|
| **sections** | [**Array<SendButtonRequestSectionsInner>**](SendButtonRequestSectionsInner.md) | | [optional] |
|
|
11
15
|
|
|
12
16
|
## Example
|
|
@@ -16,8 +20,12 @@ require 'one_msg_sdk'
|
|
|
16
20
|
|
|
17
21
|
instance = OneMsgSdk::SendButtonRequest.new(
|
|
18
22
|
phone: null,
|
|
23
|
+
chat_id: null,
|
|
24
|
+
quoted_msg_id: null,
|
|
19
25
|
body: null,
|
|
20
26
|
footer: null,
|
|
27
|
+
header: null,
|
|
28
|
+
buttons: null,
|
|
21
29
|
sections: null
|
|
22
30
|
)
|
|
23
31
|
```
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
|
-
| **body** | **String** |
|
|
8
|
-
| **
|
|
7
|
+
| **body** | **String** | Text shown above the carousel | [optional] |
|
|
8
|
+
| **cards** | **Array<Hash<String, Object>>** | Preferred. 2–10 carousel cards. | [optional] |
|
|
9
|
+
| **params** | **Array<Object>** | Template-like alternative — include a CAROUSEL component with cards | [optional] |
|
|
9
10
|
| **quoted_msg_id** | **String** | | [optional] |
|
|
10
11
|
| **chat_id** | **String** | | [optional] |
|
|
11
12
|
| **phone** | **Integer** | | [optional] |
|
|
@@ -17,6 +18,7 @@ require 'one_msg_sdk'
|
|
|
17
18
|
|
|
18
19
|
instance = OneMsgSdk::SendCarouselRequest1.new(
|
|
19
20
|
body: null,
|
|
21
|
+
cards: null,
|
|
20
22
|
params: null,
|
|
21
23
|
quoted_msg_id: null,
|
|
22
24
|
chat_id: null,
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# OneMsgSdk::SendContactInfoRequest
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **phone** | **String** | Recipient phone with country code. Use phone, chatId, or bsuid. | [optional] |
|
|
8
|
+
| **chat_id** | **String** | Recipient chat ID (`phone@c.us`, BSUID `@lid`, or username `@username`). | [optional] |
|
|
9
|
+
| **bsuid** | **String** | Business-scoped user id, for example `US.13491208655302741918`. | [optional] |
|
|
10
|
+
| **quoted_msg_id** | **String** | | [optional] |
|
|
11
|
+
| **body** | **String** | Text shown above the share-contact button. WhatsApp sets the button label; do not send button text. | |
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```ruby
|
|
16
|
+
require 'one_msg_sdk'
|
|
17
|
+
|
|
18
|
+
instance = OneMsgSdk::SendContactInfoRequest.new(
|
|
19
|
+
phone: null,
|
|
20
|
+
chat_id: null,
|
|
21
|
+
bsuid: null,
|
|
22
|
+
quoted_msg_id: null,
|
|
23
|
+
body: null
|
|
24
|
+
)
|
|
25
|
+
```
|
|
26
|
+
|
data/docs/SendContactRequest.md
CHANGED
|
@@ -4,7 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
|
-
| **phone** | **String** |
|
|
7
|
+
| **phone** | **String** | Recipient phone with country code. Use phone or chatId. | [optional] |
|
|
8
|
+
| **chat_id** | **String** | Recipient chat ID (`phone@c.us`, group `@g.us`, or BSUID `@lid`). Use phone or chatId. | [optional] |
|
|
9
|
+
| **quoted_msg_id** | **String** | | [optional] |
|
|
10
|
+
| **contact** | [**SendContactRequestContact**](SendContactRequestContact.md) | | [optional] |
|
|
8
11
|
| **contacts** | [**Array<SendContactRequestContactsInner>**](SendContactRequestContactsInner.md) | | [optional] |
|
|
9
12
|
|
|
10
13
|
## Example
|
|
@@ -14,6 +17,9 @@ require 'one_msg_sdk'
|
|
|
14
17
|
|
|
15
18
|
instance = OneMsgSdk::SendContactRequest.new(
|
|
16
19
|
phone: null,
|
|
20
|
+
chat_id: null,
|
|
21
|
+
quoted_msg_id: null,
|
|
22
|
+
contact: null,
|
|
17
23
|
contacts: null
|
|
18
24
|
)
|
|
19
25
|
```
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# OneMsgSdk::SendContactRequestContact
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **name** | [**SendContactRequestContactName**](SendContactRequestContactName.md) | | |
|
|
8
|
+
| **phone** | **String** | Contact phone in E.164 (`+79181976551`), not a timestamp | |
|
|
9
|
+
| **email** | **String** | | [optional] |
|
|
10
|
+
| **org** | **Hash<String, Object>** | | [optional] |
|
|
11
|
+
| **url** | **String** | | [optional] |
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```ruby
|
|
16
|
+
require 'one_msg_sdk'
|
|
17
|
+
|
|
18
|
+
instance = OneMsgSdk::SendContactRequestContact.new(
|
|
19
|
+
name: null,
|
|
20
|
+
phone: null,
|
|
21
|
+
email: null,
|
|
22
|
+
org: null,
|
|
23
|
+
url: null
|
|
24
|
+
)
|
|
25
|
+
```
|
|
26
|
+
|