one_msg_chat_api 1.0.0
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 +7 -0
- data/Gemfile +9 -0
- data/LICENSE.txt +21 -0
- data/Rakefile +10 -0
- data/docs/AddTemplateRequest.md +24 -0
- data/docs/BlockUserRequest.md +18 -0
- data/docs/CallingApi.md +231 -0
- data/docs/CatalogApi.md +153 -0
- data/docs/ChannelApi.md +225 -0
- data/docs/ConversationalAutomation.md +22 -0
- data/docs/ConversationalAutomationCommandsInner.md +20 -0
- data/docs/CreateCommerce200Response.md +18 -0
- data/docs/CreateCommerceRequest.md +18 -0
- data/docs/CreateCommerceRequestParams.md +20 -0
- data/docs/CreateGroups200Response.md +18 -0
- data/docs/CreateReadMessage200Response.md +18 -0
- data/docs/CreateReadMessage401Response.md +18 -0
- data/docs/CreateReadMessageRequest.md +22 -0
- data/docs/DeleteFlowsFlowId200Response.md +20 -0
- data/docs/DeleteGroupsGroupId200Response.md +20 -0
- data/docs/DeleteMediaLegacyRequest.md +18 -0
- data/docs/ErrorResponse.md +18 -0
- data/docs/FlowsApi.md +836 -0
- data/docs/GetCommerce200ResponseInner.md +22 -0
- data/docs/GetMmLiteStatus200Response.md +22 -0
- data/docs/GetWebhook200Response.md +18 -0
- data/docs/GetWhatsappBusinessEncryption200Response.md +22 -0
- data/docs/GroupsApi.md +507 -0
- data/docs/ListBlockedUsers200Response.md +18 -0
- data/docs/ListFlows200Response.md +26 -0
- data/docs/ListMessages200Response.md +20 -0
- data/docs/ListTemplates200Response.md +22 -0
- data/docs/MessageSentResponse.md +24 -0
- data/docs/MessagingApi.md +1784 -0
- data/docs/PatchFlowsFlowIdAssets200Response.md +22 -0
- data/docs/ProfileApi.md +155 -0
- data/docs/ProfileInfo.md +32 -0
- data/docs/RetrieveMedia200Response.md +26 -0
- data/docs/SendAddressMessageRequest.md +32 -0
- data/docs/SendButtonRequest.md +24 -0
- data/docs/SendButtonRequestSectionsInner.md +20 -0
- data/docs/SendButtonRequestSectionsInnerReply.md +20 -0
- data/docs/SendCarouselRequest1.md +26 -0
- data/docs/SendContactRequest.md +20 -0
- data/docs/SendContactRequestContactsInner.md +30 -0
- data/docs/SendContactRequestContactsInnerName.md +28 -0
- data/docs/SendContactRequestContactsInnerOrg.md +22 -0
- data/docs/SendContactRequestContactsInnerPhonesInner.md +22 -0
- data/docs/SendCtaUrlRequest.md +32 -0
- data/docs/SendFileRequest.md +34 -0
- data/docs/SendFlowRequest1.md +46 -0
- data/docs/SendFlowRequest1Header.md +49 -0
- data/docs/SendFlowRequestHeader.md +49 -0
- data/docs/SendListRequest.md +26 -0
- data/docs/SendListRequestSectionsInner.md +20 -0
- data/docs/SendListRequestSectionsInnerRowsInner.md +22 -0
- data/docs/SendLocationRequest1.md +30 -0
- data/docs/SendLocationRequestRequest.md +20 -0
- data/docs/SendMessageRequest.md +24 -0
- data/docs/SendOrderDetailsRequest.md +36 -0
- data/docs/SendOrderDetailsRequestLanguage.md +20 -0
- data/docs/SendOrderDetailsRequestOrder.md +28 -0
- data/docs/SendOrderDetailsRequestOrderItemsInner.md +24 -0
- data/docs/SendOrderDetailsRequestOrderItemsInnerAmount.md +20 -0
- data/docs/SendPaymentRequestRequest.md +26 -0
- data/docs/SendReactionRequest.md +22 -0
- data/docs/SendStickerRequest.md +26 -0
- data/docs/SendTemplateRequest.md +32 -0
- data/docs/SendTemplateRequestLanguage.md +20 -0
- data/docs/SetWhatsappBusinessEncryptionRequest.md +21 -0
- data/docs/SuccessResponse.md +18 -0
- data/docs/TemplatesApi.md +301 -0
- data/docs/UpdateMeRequest.md +30 -0
- data/docs/UsersApi.md +223 -0
- data/docs/WebhooksApi.md +155 -0
- data/git_push.sh +57 -0
- data/lib/one_msg_chat_api/api/calling_api.rb +228 -0
- data/lib/one_msg_chat_api/api/catalog_api.rb +161 -0
- data/lib/one_msg_chat_api/api/channel_api.rb +225 -0
- data/lib/one_msg_chat_api/api/flows_api.rb +788 -0
- data/lib/one_msg_chat_api/api/groups_api.rb +486 -0
- data/lib/one_msg_chat_api/api/messaging_api.rb +1833 -0
- data/lib/one_msg_chat_api/api/profile_api.rb +157 -0
- data/lib/one_msg_chat_api/api/templates_api.rb +293 -0
- data/lib/one_msg_chat_api/api/users_api.rb +232 -0
- data/lib/one_msg_chat_api/api/webhooks_api.rb +157 -0
- data/lib/one_msg_chat_api/api_client.rb +441 -0
- data/lib/one_msg_chat_api/api_error.rb +58 -0
- data/lib/one_msg_chat_api/api_model_base.rb +88 -0
- data/lib/one_msg_chat_api/configuration.rb +400 -0
- data/lib/one_msg_chat_api/models/add_template_request.rb +176 -0
- data/lib/one_msg_chat_api/models/block_user_request.rb +164 -0
- data/lib/one_msg_chat_api/models/conversational_automation.rb +210 -0
- data/lib/one_msg_chat_api/models/conversational_automation_commands_inner.rb +208 -0
- data/lib/one_msg_chat_api/models/create_commerce200_response.rb +147 -0
- data/lib/one_msg_chat_api/models/create_commerce_request.rb +164 -0
- data/lib/one_msg_chat_api/models/create_commerce_request_params.rb +192 -0
- data/lib/one_msg_chat_api/models/create_groups200_response.rb +149 -0
- data/lib/one_msg_chat_api/models/create_read_message200_response.rb +147 -0
- data/lib/one_msg_chat_api/models/create_read_message401_response.rb +147 -0
- data/lib/one_msg_chat_api/models/create_read_message_request.rb +168 -0
- data/lib/one_msg_chat_api/models/delete_flows_flow_id200_response.rb +158 -0
- data/lib/one_msg_chat_api/models/delete_groups_group_id200_response.rb +158 -0
- data/lib/one_msg_chat_api/models/delete_media_legacy_request.rb +165 -0
- data/lib/one_msg_chat_api/models/error_response.rb +149 -0
- data/lib/one_msg_chat_api/models/get_commerce200_response_inner.rb +168 -0
- data/lib/one_msg_chat_api/models/get_mm_lite_status200_response.rb +165 -0
- data/lib/one_msg_chat_api/models/get_webhook200_response.rb +147 -0
- data/lib/one_msg_chat_api/models/get_whatsapp_business_encryption200_response.rb +202 -0
- data/lib/one_msg_chat_api/models/list_blocked_users200_response.rb +149 -0
- data/lib/one_msg_chat_api/models/list_flows200_response.rb +189 -0
- data/lib/one_msg_chat_api/models/list_messages200_response.rb +158 -0
- data/lib/one_msg_chat_api/models/list_templates200_response.rb +169 -0
- data/lib/one_msg_chat_api/models/message_sent_response.rb +179 -0
- data/lib/one_msg_chat_api/models/patch_flows_flow_id_assets200_response.rb +169 -0
- data/lib/one_msg_chat_api/models/profile_info.rb +254 -0
- data/lib/one_msg_chat_api/models/retrieve_media200_response.rb +183 -0
- data/lib/one_msg_chat_api/models/send_address_message_request.rb +273 -0
- data/lib/one_msg_chat_api/models/send_button_request.rb +176 -0
- data/lib/one_msg_chat_api/models/send_button_request_sections_inner.rb +156 -0
- data/lib/one_msg_chat_api/models/send_button_request_sections_inner_reply.rb +156 -0
- data/lib/one_msg_chat_api/models/send_carousel_request1.rb +202 -0
- data/lib/one_msg_chat_api/models/send_contact_request.rb +158 -0
- data/lib/one_msg_chat_api/models/send_contact_request_contacts_inner.rb +209 -0
- data/lib/one_msg_chat_api/models/send_contact_request_contacts_inner_name.rb +192 -0
- data/lib/one_msg_chat_api/models/send_contact_request_contacts_inner_org.rb +165 -0
- data/lib/one_msg_chat_api/models/send_contact_request_contacts_inner_phones_inner.rb +165 -0
- data/lib/one_msg_chat_api/models/send_cta_url_request.rb +264 -0
- data/lib/one_msg_chat_api/models/send_file_request.rb +278 -0
- data/lib/one_msg_chat_api/models/send_flow_request1.rb +387 -0
- data/lib/one_msg_chat_api/models/send_flow_request1_header.rb +104 -0
- data/lib/one_msg_chat_api/models/send_flow_request_header.rb +105 -0
- data/lib/one_msg_chat_api/models/send_list_request.rb +185 -0
- data/lib/one_msg_chat_api/models/send_list_request_sections_inner.rb +158 -0
- data/lib/one_msg_chat_api/models/send_list_request_sections_inner_rows_inner.rb +165 -0
- data/lib/one_msg_chat_api/models/send_location_request1.rb +235 -0
- data/lib/one_msg_chat_api/models/send_location_request_request.rb +156 -0
- data/lib/one_msg_chat_api/models/send_message_request.rb +284 -0
- data/lib/one_msg_chat_api/models/send_order_details_request.rb +308 -0
- data/lib/one_msg_chat_api/models/send_order_details_request_language.rb +176 -0
- data/lib/one_msg_chat_api/models/send_order_details_request_order.rb +220 -0
- data/lib/one_msg_chat_api/models/send_order_details_request_order_items_inner.rb +174 -0
- data/lib/one_msg_chat_api/models/send_order_details_request_order_items_inner_amount.rb +156 -0
- data/lib/one_msg_chat_api/models/send_payment_request_request.rb +245 -0
- data/lib/one_msg_chat_api/models/send_reaction_request.rb +165 -0
- data/lib/one_msg_chat_api/models/send_sticker_request.rb +185 -0
- data/lib/one_msg_chat_api/models/send_template_request.rb +215 -0
- data/lib/one_msg_chat_api/models/send_template_request_language.rb +156 -0
- data/lib/one_msg_chat_api/models/set_whatsapp_business_encryption_request.rb +165 -0
- data/lib/one_msg_chat_api/models/success_response.rb +149 -0
- data/lib/one_msg_chat_api/models/update_me_request.rb +207 -0
- data/lib/one_msg_chat_api/version.rb +15 -0
- data/lib/one_msg_chat_api.rb +111 -0
- data/one_msg_chat_api.gemspec +41 -0
- data/spec/api/calling_api_spec.rb +73 -0
- data/spec/api/catalog_api_spec.rb +60 -0
- data/spec/api/channel_api_spec.rb +72 -0
- data/spec/api/flows_api_spec.rb +175 -0
- data/spec/api/groups_api_spec.rb +117 -0
- data/spec/api/messaging_api_spec.rb +359 -0
- data/spec/api/profile_api_spec.rb +60 -0
- data/spec/api/templates_api_spec.rb +83 -0
- data/spec/api/users_api_spec.rb +71 -0
- data/spec/api/webhooks_api_spec.rb +60 -0
- data/spec/models/add_template_request_spec.rb +54 -0
- data/spec/models/block_user_request_spec.rb +36 -0
- data/spec/models/conversational_automation_commands_inner_spec.rb +42 -0
- data/spec/models/conversational_automation_spec.rb +48 -0
- data/spec/models/create_commerce200_response_spec.rb +36 -0
- data/spec/models/create_commerce_request_params_spec.rb +42 -0
- data/spec/models/create_commerce_request_spec.rb +36 -0
- data/spec/models/create_groups200_response_spec.rb +36 -0
- data/spec/models/create_read_message200_response_spec.rb +36 -0
- data/spec/models/create_read_message401_response_spec.rb +36 -0
- data/spec/models/create_read_message_request_spec.rb +48 -0
- data/spec/models/delete_flows_flow_id200_response_spec.rb +42 -0
- data/spec/models/delete_groups_group_id200_response_spec.rb +42 -0
- data/spec/models/delete_media_legacy_request_spec.rb +36 -0
- data/spec/models/error_response_spec.rb +36 -0
- data/spec/models/get_commerce200_response_inner_spec.rb +48 -0
- data/spec/models/get_mm_lite_status200_response_spec.rb +48 -0
- data/spec/models/get_webhook200_response_spec.rb +36 -0
- data/spec/models/get_whatsapp_business_encryption200_response_spec.rb +52 -0
- data/spec/models/list_blocked_users200_response_spec.rb +36 -0
- data/spec/models/list_flows200_response_spec.rb +60 -0
- data/spec/models/list_messages200_response_spec.rb +42 -0
- data/spec/models/list_templates200_response_spec.rb +48 -0
- data/spec/models/message_sent_response_spec.rb +54 -0
- data/spec/models/patch_flows_flow_id_assets200_response_spec.rb +48 -0
- data/spec/models/profile_info_spec.rb +82 -0
- data/spec/models/retrieve_media200_response_spec.rb +60 -0
- data/spec/models/send_address_message_request_spec.rb +82 -0
- data/spec/models/send_button_request_sections_inner_reply_spec.rb +42 -0
- data/spec/models/send_button_request_sections_inner_spec.rb +42 -0
- data/spec/models/send_button_request_spec.rb +54 -0
- data/spec/models/send_carousel_request1_spec.rb +60 -0
- data/spec/models/send_contact_request_contacts_inner_name_spec.rb +66 -0
- data/spec/models/send_contact_request_contacts_inner_org_spec.rb +48 -0
- data/spec/models/send_contact_request_contacts_inner_phones_inner_spec.rb +48 -0
- data/spec/models/send_contact_request_contacts_inner_spec.rb +72 -0
- data/spec/models/send_contact_request_spec.rb +42 -0
- data/spec/models/send_cta_url_request_spec.rb +78 -0
- data/spec/models/send_file_request_spec.rb +88 -0
- data/spec/models/send_flow_request1_header_spec.rb +32 -0
- data/spec/models/send_flow_request1_spec.rb +128 -0
- data/spec/models/send_flow_request_header_spec.rb +32 -0
- data/spec/models/send_list_request_sections_inner_rows_inner_spec.rb +48 -0
- data/spec/models/send_list_request_sections_inner_spec.rb +42 -0
- data/spec/models/send_list_request_spec.rb +60 -0
- data/spec/models/send_location_request1_spec.rb +72 -0
- data/spec/models/send_location_request_request_spec.rb +42 -0
- data/spec/models/send_message_request_spec.rb +54 -0
- data/spec/models/send_order_details_request_language_spec.rb +42 -0
- data/spec/models/send_order_details_request_order_items_inner_amount_spec.rb +42 -0
- data/spec/models/send_order_details_request_order_items_inner_spec.rb +54 -0
- data/spec/models/send_order_details_request_order_spec.rb +66 -0
- data/spec/models/send_order_details_request_spec.rb +90 -0
- data/spec/models/send_payment_request_request_spec.rb +64 -0
- data/spec/models/send_reaction_request_spec.rb +48 -0
- data/spec/models/send_sticker_request_spec.rb +60 -0
- data/spec/models/send_template_request_language_spec.rb +42 -0
- data/spec/models/send_template_request_spec.rb +78 -0
- data/spec/models/set_whatsapp_business_encryption_request_spec.rb +36 -0
- data/spec/models/success_response_spec.rb +36 -0
- data/spec/models/update_me_request_spec.rb +72 -0
- data/spec/spec_helper.rb +111 -0
- metadata +408 -0
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#1MSG WhatsApp Business API (Public)
|
|
3
|
+
|
|
4
|
+
#Public client API for sending messages, managing groups, flows, and templates. This is the API exposed to end customers via platform.1msg.io **Authentication:** All requests require `token` query parameter with JWT or API key. **Documentation:** https://help.1msg.io/platform-1msg/getting-start/quick-start **API Docs:** https://docs.1msg.io/
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: support@1msg.io
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.22.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
|
|
16
|
+
# Unit tests for OneMsgChatApi::MessagingApi
|
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
18
|
+
# Please update as you see appropriate
|
|
19
|
+
describe 'MessagingApi' do
|
|
20
|
+
before do
|
|
21
|
+
# run before each test
|
|
22
|
+
@api_instance = OneMsgChatApi::MessagingApi.new
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
after do
|
|
26
|
+
# run after each test
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
describe 'test an instance of MessagingApi' do
|
|
30
|
+
it 'should create an instance of MessagingApi' do
|
|
31
|
+
expect(@api_instance).to be_instance_of(OneMsgChatApi::MessagingApi)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# unit tests for create_read_message
|
|
36
|
+
# Mark message as read
|
|
37
|
+
# @param token JWT token or API key for authorization
|
|
38
|
+
# @param [Hash] opts the optional parameters
|
|
39
|
+
# @option opts [String] :message_id
|
|
40
|
+
# @option opts [String] :msg_id
|
|
41
|
+
# @option opts [Boolean] :typing_indicator Show WhatsApp typing indicator (max 25s or until reply)
|
|
42
|
+
# @return [CreateReadMessage200Response]
|
|
43
|
+
describe 'create_read_message test' do
|
|
44
|
+
it 'should work' do
|
|
45
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# unit tests for create_upload_media
|
|
50
|
+
# Upload media
|
|
51
|
+
# @param token JWT token or API key for authorization
|
|
52
|
+
# @param [Hash] opts the optional parameters
|
|
53
|
+
# @option opts [Hash<String, Object>] :request_body
|
|
54
|
+
# @return [nil]
|
|
55
|
+
describe 'create_upload_media test' do
|
|
56
|
+
it 'should work' do
|
|
57
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# unit tests for delete_media
|
|
62
|
+
# Delete media from WABA storage
|
|
63
|
+
# Delete previously uploaded media by numeric `mediaId` (from `/uploadMedia`). This is the canonical deletion endpoint and uses the REST `DELETE` verb on the media resource path. The older `POST /deleteMedia` is a deprecated alias.
|
|
64
|
+
# @param token JWT token or API key for authorization
|
|
65
|
+
# @param media_id Numeric WABA media id
|
|
66
|
+
# @param [Hash] opts the optional parameters
|
|
67
|
+
# @return [SuccessResponse]
|
|
68
|
+
describe 'delete_media test' do
|
|
69
|
+
it 'should work' do
|
|
70
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# unit tests for delete_media_legacy
|
|
75
|
+
# Delete media from WABA storage (deprecated alias)
|
|
76
|
+
# **Deprecated.** Use `DELETE /media/{mediaId}` instead. This POST alias is kept for backward compatibility with earlier integrations. New integrations should call `DELETE /media/{mediaId}`: 1msg follows REST conventions for resource deletion going forward (delete a resource with the `DELETE` verb on its resource path).
|
|
77
|
+
# @param token JWT token or API key for authorization
|
|
78
|
+
# @param delete_media_legacy_request
|
|
79
|
+
# @param [Hash] opts the optional parameters
|
|
80
|
+
# @return [SuccessResponse]
|
|
81
|
+
describe 'delete_media_legacy test' do
|
|
82
|
+
it 'should work' do
|
|
83
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# unit tests for get_mm_lite_status
|
|
88
|
+
# Get MM Lite availability and status
|
|
89
|
+
# @param token JWT token or API key for authorization
|
|
90
|
+
# @param [Hash] opts the optional parameters
|
|
91
|
+
# @return [GetMmLiteStatus200Response]
|
|
92
|
+
describe 'get_mm_lite_status test' do
|
|
93
|
+
it 'should work' do
|
|
94
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
# unit tests for list_messages
|
|
99
|
+
# Get messages list
|
|
100
|
+
# @param token JWT token or API key for authorization
|
|
101
|
+
# @param [Hash] opts the optional parameters
|
|
102
|
+
# @return [ListMessages200Response]
|
|
103
|
+
describe 'list_messages test' do
|
|
104
|
+
it 'should work' do
|
|
105
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
# unit tests for retrieve_media
|
|
110
|
+
# Retrieve uploaded media metadata
|
|
111
|
+
# Get WABA media URL and metadata by mediaId (from uploadMedia). The returned `url` is temporary and typically expires within ~5 minutes.
|
|
112
|
+
# @param token JWT token or API key for authorization
|
|
113
|
+
# @param media_id
|
|
114
|
+
# @param [Hash] opts the optional parameters
|
|
115
|
+
# @return [RetrieveMedia200Response]
|
|
116
|
+
describe 'retrieve_media test' do
|
|
117
|
+
it 'should work' do
|
|
118
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
119
|
+
end
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# unit tests for send_address_message
|
|
123
|
+
# Send address request message
|
|
124
|
+
# Request shipping address from the user (WhatsApp interactive `address_message`). **India and Singapore only.** Requires: - Business WhatsApp number registered in that country - Recipient phone matching the country (`+91` ↔ `IN`, `+65` ↔ `SG`) Pass `country: \"IN\"` or `country: \"SG\"`. Eligibility is validated upstream; mismatches (e.g. Singapore phone with `country: \"IN\"`) return errors such as `Unsupported Interactive Message type` (HTTP 200 with `sent: false`). Optional action parameters: `values`, `saved_addresses`, `validation_errors`.
|
|
125
|
+
# @param token JWT token or API key for authorization
|
|
126
|
+
# @param send_address_message_request
|
|
127
|
+
# @param [Hash] opts the optional parameters
|
|
128
|
+
# @return [MessageSentResponse]
|
|
129
|
+
describe 'send_address_message test' do
|
|
130
|
+
it 'should work' do
|
|
131
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
132
|
+
end
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# unit tests for send_button
|
|
136
|
+
# Send Reply Buttons Message
|
|
137
|
+
# @param token JWT token or API key for authorization
|
|
138
|
+
# @param [Hash] opts the optional parameters
|
|
139
|
+
# @option opts [SendButtonRequest] :send_button_request
|
|
140
|
+
# @return [MessageSentResponse]
|
|
141
|
+
describe 'send_button test' do
|
|
142
|
+
it 'should work' do
|
|
143
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
144
|
+
end
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
# unit tests for send_carousel
|
|
148
|
+
# Send Carousel
|
|
149
|
+
# You can send product cards via Carousel in two ways: Template messages: do not require a 24-hour customer service window between you and the recipient. Use sendTemplate. Free-form messages: can be sent only when a customer service window is open between you and the recipient. Use sendCarousel. The message structure in /sendCarousel is largely similar to sending a template. However, in this case you must explicitly specify all elements that are created in advance when working with templates. This is because the message is sent without using a template. In /sendCarousel, for sending a Catalog Carousel there can be either 1 URL button or one or more quick reply buttons.
|
|
150
|
+
# @param token JWT token or API key for authorization
|
|
151
|
+
# @param params Required. Template-like structure (same as sendTemplate params). Must include a CAROUSEL component and its cards. Structure: - params[] item with type CAROUSEL and cards (2..10) - cards[] item: - components[] items: - header: parameters[0] with type image/video/product - image: {\\\"image\\\": {\\\"link\\\": \\\"https://...\\\"}} - video: {\\\"video\\\": {\\\"link\\\": \\\"https://...\\\"}} - product: {\\\"product\\\": {\\\"catalog_id\\\": \\\"...\\\", \\\"product_retailer_id\\\": \\\"...\\\"}} - button: sub_type url or quick_reply - url: parameters {\\\"text\\\": \\\"Button\\\", \\\"url\\\": \\\"https://...\\\"} - quick_reply: parameters[] of {\\\"id\\\": \\\"...\\\", \\\"text\\\": \\\"...\\\"}
|
|
152
|
+
# @param [Hash] opts the optional parameters
|
|
153
|
+
# @option opts [String] :body Text shown above the carousel. Optional. If omitted and params include a body component, the body will be taken from params.
|
|
154
|
+
# @option opts [String] :quoted_msg_id Quoted message ID (Cloud API)
|
|
155
|
+
# @option opts [String] :chat_id Required if phone is not set. Chat ID from the message list. Examples: 12020721369@c.us or 120363046942338209@g.us(group)
|
|
156
|
+
# @option opts [Integer] :phone Required if chatId is not set. A phone number starting with the country code. USA example: 12020721369.
|
|
157
|
+
# @return [MessageSentResponse]
|
|
158
|
+
describe 'send_carousel test' do
|
|
159
|
+
it 'should work' do
|
|
160
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
161
|
+
end
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# unit tests for send_contact
|
|
165
|
+
# Send a Contact
|
|
166
|
+
# @param token JWT token or API key for authorization
|
|
167
|
+
# @param [Hash] opts the optional parameters
|
|
168
|
+
# @option opts [SendContactRequest] :send_contact_request
|
|
169
|
+
# @return [MessageSentResponse]
|
|
170
|
+
describe 'send_contact test' do
|
|
171
|
+
it 'should work' do
|
|
172
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
173
|
+
end
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
# unit tests for send_cta_url
|
|
177
|
+
# Send CTA URL interactive message
|
|
178
|
+
# Send an interactive message with a single call-to-action URL button.
|
|
179
|
+
# @param token JWT token or API key for authorization
|
|
180
|
+
# @param send_cta_url_request
|
|
181
|
+
# @param [Hash] opts the optional parameters
|
|
182
|
+
# @return [MessageSentResponse]
|
|
183
|
+
describe 'send_cta_url test' do
|
|
184
|
+
it 'should work' do
|
|
185
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
186
|
+
end
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# unit tests for send_file
|
|
190
|
+
# Send a File
|
|
191
|
+
# Send a file to an existing chat. (Only if the dialogue has an Open Session). Only one of two parameters is needed to determine the destination - chatId or phone.
|
|
192
|
+
# @param token JWT token or API key for authorization
|
|
193
|
+
# @param [Hash] opts the optional parameters
|
|
194
|
+
# @option opts [String] :body File source (required unless mediaId is set): - HTTP/HTTPS URL - Base64 data URI
|
|
195
|
+
# @option opts [String] :filename File name with extension (required with body, not with mediaId)
|
|
196
|
+
# @option opts [String] :media_id WABA media id from uploadMedia (alternative to body)
|
|
197
|
+
# @option opts [String] :media_type Required when using mediaId
|
|
198
|
+
# @option opts [Boolean] :voice Native WhatsApp voice note (audio/ogg only)
|
|
199
|
+
# @option opts [String] :caption
|
|
200
|
+
# @option opts [String] :quoted_msg_id
|
|
201
|
+
# @option opts [String] :chat_id
|
|
202
|
+
# @option opts [Integer] :phone
|
|
203
|
+
# @return [MessageSentResponse]
|
|
204
|
+
describe 'send_file test' do
|
|
205
|
+
it 'should work' do
|
|
206
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
207
|
+
end
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
# unit tests for send_flow
|
|
211
|
+
# Send WhatsApp Flow Message
|
|
212
|
+
# Send Interactive WhatsApp Flow message to an existing chat. (Only if the dialogue has an Open Session). Only one of two parameters is needed to determine the destination - chatId or phone. Use this method to send a published WhatsApp Flow as a service (interactive) message. If the 24-hour window is closed, send a template with a FLOW button via /sendTemplate.
|
|
213
|
+
# @param token JWT token or API key for authorization
|
|
214
|
+
# @param body Flow message body text
|
|
215
|
+
# @param flow_id Published Flow ID
|
|
216
|
+
# @param flow_token Flow token generated by the business
|
|
217
|
+
# @param flow_cta CTA button text
|
|
218
|
+
# @param [Hash] opts the optional parameters
|
|
219
|
+
# @option opts [SendFlowRequestHeader] :header
|
|
220
|
+
# @option opts [String] :footer Footer text
|
|
221
|
+
# @option opts [String] :flow_action Flow action type
|
|
222
|
+
# @option opts [Object] :flow_action_payload Required for flowAction=navigate (screen is required). Ignored for data_exchange. If data is provided, it must be a non-empty object.
|
|
223
|
+
# @option opts [String] :flow_message_version Flow message version (default \\\"3\\\")
|
|
224
|
+
# @option opts [String] :mode Flow mode (draft or published). If omitted, provider default applies
|
|
225
|
+
# @option opts [Object] :flow_action_data Shortcut for flowActionPayload.data (optional)
|
|
226
|
+
# @option opts [String] :flow_action_screen Shortcut for flowActionPayload.screen (optional)
|
|
227
|
+
# @option opts [String] :quoted_msg_id Quoted message ID (Cloud API)
|
|
228
|
+
# @option opts [String] :chat_id Required if phone is not set. Chat ID from the message list. Examples: 12020721369@c.us or 120363046942338209@g.us(group)
|
|
229
|
+
# @option opts [Integer] :phone Required if chatId is not set. A phone number starting with the country code. USA example: 12020721369.
|
|
230
|
+
# @return [MessageSentResponse]
|
|
231
|
+
describe 'send_flow test' do
|
|
232
|
+
it 'should work' do
|
|
233
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
234
|
+
end
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
# unit tests for send_list
|
|
238
|
+
# Send List Message
|
|
239
|
+
# @param token JWT token or API key for authorization
|
|
240
|
+
# @param [Hash] opts the optional parameters
|
|
241
|
+
# @option opts [SendListRequest] :send_list_request
|
|
242
|
+
# @return [MessageSentResponse]
|
|
243
|
+
describe 'send_list test' do
|
|
244
|
+
it 'should work' do
|
|
245
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
246
|
+
end
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
# unit tests for send_location
|
|
250
|
+
# Send a Location
|
|
251
|
+
# Send a location to an existing chat. (Only if the dialogue has an Open Session). Only one of two parameters is needed to determine the destination - chatId or phone.
|
|
252
|
+
# @param token JWT token or API key for authorization
|
|
253
|
+
# @param lat Latitude of the location. Example: 45.018337
|
|
254
|
+
# @param lng Longitude of the location. Example: -73.968285
|
|
255
|
+
# @param [Hash] opts the optional parameters
|
|
256
|
+
# @option opts [String] :address Address of the location. Only displayed if name is present. Example: 9766 Valley View St., New York, NY 10024
|
|
257
|
+
# @option opts [String] :name Name of the location. Example: Facebook HQ
|
|
258
|
+
# @option opts [String] :quoted_msg_id Quoted message ID (Cloud API)
|
|
259
|
+
# @option opts [String] :chat_id Required if phone is not set. Chat ID from the message list. Examples: 12020721369@c.us or 120363046942338209@g.us(group)
|
|
260
|
+
# @option opts [Integer] :phone Required if chatId is not set. A phone number starting with the country code. USA example: 12020721369.
|
|
261
|
+
# @return [MessageSentResponse]
|
|
262
|
+
describe 'send_location test' do
|
|
263
|
+
it 'should work' do
|
|
264
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
265
|
+
end
|
|
266
|
+
end
|
|
267
|
+
|
|
268
|
+
# unit tests for send_location_request
|
|
269
|
+
# Send Location Request Message
|
|
270
|
+
# @param token JWT token or API key for authorization
|
|
271
|
+
# @param [Hash] opts the optional parameters
|
|
272
|
+
# @option opts [SendLocationRequestRequest] :send_location_request_request
|
|
273
|
+
# @return [MessageSentResponse]
|
|
274
|
+
describe 'send_location_request test' do
|
|
275
|
+
it 'should work' do
|
|
276
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
277
|
+
end
|
|
278
|
+
end
|
|
279
|
+
|
|
280
|
+
# unit tests for send_message
|
|
281
|
+
# Send a Message
|
|
282
|
+
# 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.
|
|
283
|
+
# @param token JWT token or API key for authorization
|
|
284
|
+
# @param body Message text, UTF-8 or UTF-16 string with emoji
|
|
285
|
+
# @param [Hash] opts the optional parameters
|
|
286
|
+
# @option opts [String] :quoted_msg_id Message ID to quote/reply to (Cloud API wamid)
|
|
287
|
+
# @option opts [String] :chat_id Chat ID in format: phone@c.us (individual) or phone@g.us (group)
|
|
288
|
+
# @option opts [Integer] :phone Phone number starting with country code (alternative to chatId)
|
|
289
|
+
# @return [MessageSentResponse]
|
|
290
|
+
describe 'send_message test' do
|
|
291
|
+
it 'should work' do
|
|
292
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
293
|
+
end
|
|
294
|
+
end
|
|
295
|
+
|
|
296
|
+
# unit tests for send_order_details
|
|
297
|
+
# Send order details (India payments template)
|
|
298
|
+
# Send a WhatsApp **order details** payment / invoice message using a pre-approved **Utility** template that has an `ORDER_DETAILS` button. **India only** (WhatsApp Payments India). Requires: - India WhatsApp Business number - Commerce enabled on the channel (`GET`/`POST /commerce`) - Approved template with an `ORDER_DETAILS` button Use this method when you need structured fields (`order`, `referenceId`, `currency`, `paymentSettings`). The API appends a template button `sub_type: order_details` and sends via the same path as `POST /sendTemplate`. Works **outside the 24-hour session window** (template message). You can also send the same payload yourself with `POST /sendTemplate` by including a button component in `params`: ```json { \"type\": \"button\", \"sub_type\": \"order_details\", \"index\": 0, \"parameters\": [{ \"type\": \"action\", \"action\": { \"order_details\": { \"reference_id\": \"order-123\", \"currency\": \"INR\", \"order\": { \"status\": \"pending\", \"items\": [], \"subtotal\": { \"offset\": 100, \"value\": 50000 } } } } }] } ```
|
|
299
|
+
# @param token JWT token or API key for authorization
|
|
300
|
+
# @param send_order_details_request
|
|
301
|
+
# @param [Hash] opts the optional parameters
|
|
302
|
+
# @return [MessageSentResponse]
|
|
303
|
+
describe 'send_order_details test' do
|
|
304
|
+
it 'should work' do
|
|
305
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
306
|
+
end
|
|
307
|
+
end
|
|
308
|
+
|
|
309
|
+
# unit tests for send_payment_request
|
|
310
|
+
# Send payment request (regional)
|
|
311
|
+
# Send a regional payment request interactive message (beta scaffold). `region` must be IN, SG, or BR. Payload shape follows Meta regional payments docs; verify on stage before production use. Full regional builders are not implemented yet.
|
|
312
|
+
# @param token JWT token or API key for authorization
|
|
313
|
+
# @param send_payment_request_request
|
|
314
|
+
# @param [Hash] opts the optional parameters
|
|
315
|
+
# @return [MessageSentResponse]
|
|
316
|
+
describe 'send_payment_request test' do
|
|
317
|
+
it 'should work' do
|
|
318
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
319
|
+
end
|
|
320
|
+
end
|
|
321
|
+
|
|
322
|
+
# unit tests for send_product
|
|
323
|
+
# Send a Product
|
|
324
|
+
# @param token JWT token or API key for authorization
|
|
325
|
+
# @param [Hash] opts the optional parameters
|
|
326
|
+
# @option opts [Hash<String, Object>] :request_body
|
|
327
|
+
# @return [MessageSentResponse]
|
|
328
|
+
describe 'send_product test' do
|
|
329
|
+
it 'should work' do
|
|
330
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
331
|
+
end
|
|
332
|
+
end
|
|
333
|
+
|
|
334
|
+
# unit tests for send_reaction
|
|
335
|
+
# Send Reaction
|
|
336
|
+
# @param token JWT token or API key for authorization
|
|
337
|
+
# @param [Hash] opts the optional parameters
|
|
338
|
+
# @option opts [SendReactionRequest] :send_reaction_request
|
|
339
|
+
# @return [MessageSentResponse]
|
|
340
|
+
describe 'send_reaction test' do
|
|
341
|
+
it 'should work' do
|
|
342
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
343
|
+
end
|
|
344
|
+
end
|
|
345
|
+
|
|
346
|
+
# unit tests for send_sticker
|
|
347
|
+
# Send sticker message
|
|
348
|
+
# Send a WhatsApp sticker by mediaId or link URL.
|
|
349
|
+
# @param token JWT token or API key for authorization
|
|
350
|
+
# @param send_sticker_request
|
|
351
|
+
# @param [Hash] opts the optional parameters
|
|
352
|
+
# @return [MessageSentResponse]
|
|
353
|
+
describe 'send_sticker test' do
|
|
354
|
+
it 'should work' do
|
|
355
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
356
|
+
end
|
|
357
|
+
end
|
|
358
|
+
|
|
359
|
+
end
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#1MSG WhatsApp Business API (Public)
|
|
3
|
+
|
|
4
|
+
#Public client API for sending messages, managing groups, flows, and templates. This is the API exposed to end customers via platform.1msg.io **Authentication:** All requests require `token` query parameter with JWT or API key. **Documentation:** https://help.1msg.io/platform-1msg/getting-start/quick-start **API Docs:** https://docs.1msg.io/
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: support@1msg.io
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.22.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
|
|
16
|
+
# Unit tests for OneMsgChatApi::ProfileApi
|
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
18
|
+
# Please update as you see appropriate
|
|
19
|
+
describe 'ProfileApi' do
|
|
20
|
+
before do
|
|
21
|
+
# run before each test
|
|
22
|
+
@api_instance = OneMsgChatApi::ProfileApi.new
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
after do
|
|
26
|
+
# run after each test
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
describe 'test an instance of ProfileApi' do
|
|
30
|
+
it 'should create an instance of ProfileApi' do
|
|
31
|
+
expect(@api_instance).to be_instance_of(OneMsgChatApi::ProfileApi)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# unit tests for get_me
|
|
36
|
+
# Get Profile Info
|
|
37
|
+
# Get WhatsApp Business Account profile information
|
|
38
|
+
# @param token JWT token or API key for authorization
|
|
39
|
+
# @param [Hash] opts the optional parameters
|
|
40
|
+
# @return [ProfileInfo]
|
|
41
|
+
describe 'get_me test' do
|
|
42
|
+
it 'should work' do
|
|
43
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# unit tests for update_me
|
|
48
|
+
# Update profile info
|
|
49
|
+
# Update WhatsApp Business Account profile fields. At least one of about, description, email, photo, address, vertical, websites is required. Blocked when the channel subscription limit is exceeded.
|
|
50
|
+
# @param token JWT token or API key for authorization
|
|
51
|
+
# @param [Hash] opts the optional parameters
|
|
52
|
+
# @option opts [UpdateMeRequest] :update_me_request
|
|
53
|
+
# @return [Hash<String, Object>]
|
|
54
|
+
describe 'update_me test' do
|
|
55
|
+
it 'should work' do
|
|
56
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
end
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#1MSG WhatsApp Business API (Public)
|
|
3
|
+
|
|
4
|
+
#Public client API for sending messages, managing groups, flows, and templates. This is the API exposed to end customers via platform.1msg.io **Authentication:** All requests require `token` query parameter with JWT or API key. **Documentation:** https://help.1msg.io/platform-1msg/getting-start/quick-start **API Docs:** https://docs.1msg.io/
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: support@1msg.io
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.22.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
|
|
16
|
+
# Unit tests for OneMsgChatApi::TemplatesApi
|
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
18
|
+
# Please update as you see appropriate
|
|
19
|
+
describe 'TemplatesApi' do
|
|
20
|
+
before do
|
|
21
|
+
# run before each test
|
|
22
|
+
@api_instance = OneMsgChatApi::TemplatesApi.new
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
after do
|
|
26
|
+
# run after each test
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
describe 'test an instance of TemplatesApi' do
|
|
30
|
+
it 'should create an instance of TemplatesApi' do
|
|
31
|
+
expect(@api_instance).to be_instance_of(OneMsgChatApi::TemplatesApi)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# unit tests for add_template
|
|
36
|
+
# Create message template
|
|
37
|
+
# @param token JWT token or API key for authorization
|
|
38
|
+
# @param [Hash] opts the optional parameters
|
|
39
|
+
# @option opts [AddTemplateRequest] :add_template_request
|
|
40
|
+
# @return [Hash<String, Object>]
|
|
41
|
+
describe 'add_template test' do
|
|
42
|
+
it 'should work' do
|
|
43
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# unit tests for list_templates
|
|
48
|
+
# Get templates list
|
|
49
|
+
# @param token JWT token or API key for authorization
|
|
50
|
+
# @param [Hash] opts the optional parameters
|
|
51
|
+
# @return [ListTemplates200Response]
|
|
52
|
+
describe 'list_templates test' do
|
|
53
|
+
it 'should work' do
|
|
54
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# unit tests for remove_template
|
|
59
|
+
# Remove message template
|
|
60
|
+
# @param token JWT token or API key for authorization
|
|
61
|
+
# @param [Hash] opts the optional parameters
|
|
62
|
+
# @option opts [Hash<String, Object>] :request_body
|
|
63
|
+
# @return [Hash<String, Object>]
|
|
64
|
+
describe 'remove_template test' do
|
|
65
|
+
it 'should work' do
|
|
66
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# unit tests for send_template
|
|
71
|
+
# Send Template Message
|
|
72
|
+
# 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). For India order/invoice payments outside 24h, include a button component: ```json { \"type\": \"button\", \"sub_type\": \"order_details\", \"index\": 0, \"parameters\": [{ \"type\": \"action\", \"action\": { \"order_details\": { \"reference_id\": \"...\", \"currency\": \"INR\", \"order\": {} } } }] } ``` Convenience wrapper with structured fields: `POST /sendOrderDetails`.
|
|
73
|
+
# @param token JWT token or API key for authorization
|
|
74
|
+
# @param [Hash] opts the optional parameters
|
|
75
|
+
# @option opts [SendTemplateRequest] :send_template_request
|
|
76
|
+
# @return [Hash<String, Object>]
|
|
77
|
+
describe 'send_template test' do
|
|
78
|
+
it 'should work' do
|
|
79
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
end
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#1MSG WhatsApp Business API (Public)
|
|
3
|
+
|
|
4
|
+
#Public client API for sending messages, managing groups, flows, and templates. This is the API exposed to end customers via platform.1msg.io **Authentication:** All requests require `token` query parameter with JWT or API key. **Documentation:** https://help.1msg.io/platform-1msg/getting-start/quick-start **API Docs:** https://docs.1msg.io/
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: support@1msg.io
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.22.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
|
|
16
|
+
# Unit tests for OneMsgChatApi::UsersApi
|
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
18
|
+
# Please update as you see appropriate
|
|
19
|
+
describe 'UsersApi' do
|
|
20
|
+
before do
|
|
21
|
+
# run before each test
|
|
22
|
+
@api_instance = OneMsgChatApi::UsersApi.new
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
after do
|
|
26
|
+
# run after each test
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
describe 'test an instance of UsersApi' do
|
|
30
|
+
it 'should create an instance of UsersApi' do
|
|
31
|
+
expect(@api_instance).to be_instance_of(OneMsgChatApi::UsersApi)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# unit tests for block_user
|
|
36
|
+
# Block WhatsApp user
|
|
37
|
+
# @param token JWT token or API key for authorization
|
|
38
|
+
# @param block_user_request
|
|
39
|
+
# @param [Hash] opts the optional parameters
|
|
40
|
+
# @return [SuccessResponse]
|
|
41
|
+
describe 'block_user test' do
|
|
42
|
+
it 'should work' do
|
|
43
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# unit tests for list_blocked_users
|
|
48
|
+
# List blocked WhatsApp users
|
|
49
|
+
# Returns users currently blocked on this WhatsApp channel (WABA `GET /block_users`). Same channel token auth as `blockUser` / `unblockUser`.
|
|
50
|
+
# @param token JWT token or API key for authorization
|
|
51
|
+
# @param [Hash] opts the optional parameters
|
|
52
|
+
# @return [ListBlockedUsers200Response]
|
|
53
|
+
describe 'list_blocked_users test' do
|
|
54
|
+
it 'should work' do
|
|
55
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# unit tests for unblock_user
|
|
60
|
+
# Unblock WhatsApp user
|
|
61
|
+
# @param token JWT token or API key for authorization
|
|
62
|
+
# @param block_user_request
|
|
63
|
+
# @param [Hash] opts the optional parameters
|
|
64
|
+
# @return [SuccessResponse]
|
|
65
|
+
describe 'unblock_user test' do
|
|
66
|
+
it 'should work' do
|
|
67
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
end
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#1MSG WhatsApp Business API (Public)
|
|
3
|
+
|
|
4
|
+
#Public client API for sending messages, managing groups, flows, and templates. This is the API exposed to end customers via platform.1msg.io **Authentication:** All requests require `token` query parameter with JWT or API key. **Documentation:** https://help.1msg.io/platform-1msg/getting-start/quick-start **API Docs:** https://docs.1msg.io/
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
|
7
|
+
Contact: support@1msg.io
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.22.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
|
|
16
|
+
# Unit tests for OneMsgChatApi::WebhooksApi
|
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
18
|
+
# Please update as you see appropriate
|
|
19
|
+
describe 'WebhooksApi' do
|
|
20
|
+
before do
|
|
21
|
+
# run before each test
|
|
22
|
+
@api_instance = OneMsgChatApi::WebhooksApi.new
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
after do
|
|
26
|
+
# run after each test
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
describe 'test an instance of WebhooksApi' do
|
|
30
|
+
it 'should create an instance of WebhooksApi' do
|
|
31
|
+
expect(@api_instance).to be_instance_of(OneMsgChatApi::WebhooksApi)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
# unit tests for get_webhook
|
|
36
|
+
# Get webhook URL
|
|
37
|
+
# Returns the configured client webhook URL for this channel.
|
|
38
|
+
# @param token JWT token or API key for authorization
|
|
39
|
+
# @param [Hash] opts the optional parameters
|
|
40
|
+
# @return [GetWebhook200Response]
|
|
41
|
+
describe 'get_webhook test' do
|
|
42
|
+
it 'should work' do
|
|
43
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# unit tests for set_webhook
|
|
48
|
+
# Set webhook URL
|
|
49
|
+
# Configure the client webhook URL for inbound events.
|
|
50
|
+
# @param token JWT token or API key for authorization
|
|
51
|
+
# @param [Hash] opts the optional parameters
|
|
52
|
+
# @option opts [GetWebhook200Response] :get_webhook200_response
|
|
53
|
+
# @return [Hash<String, Object>]
|
|
54
|
+
describe 'set_webhook test' do
|
|
55
|
+
it 'should work' do
|
|
56
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
end
|