one_msg_sdk 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/AGENTS.md +6 -6
  3. data/README.md +8 -8
  4. data/docs/CallingApi.md +27 -31
  5. data/docs/CallingSettings.md +18 -0
  6. data/docs/CallingSettingsCalling.md +38 -0
  7. data/docs/CallingSettingsCallingAudio.md +18 -0
  8. data/docs/CallingSettingsCallingCallHours.md +22 -0
  9. data/docs/CallingSettingsCallingSip.md +20 -0
  10. data/docs/CallingSettingsCallingSipServersInner.md +28 -0
  11. data/docs/CallingSettingsCallingVideo.md +18 -0
  12. data/docs/InitiateCallRequest.md +28 -0
  13. data/docs/InitiateCallRequestSession.md +20 -0
  14. data/docs/InitiateCallResponse.md +26 -0
  15. data/docs/InitiateCallResponseCallsInner.md +18 -0
  16. data/docs/InitiateCallResponseResponse.md +18 -0
  17. data/docs/UpdateCallingSettings200Response.md +22 -0
  18. data/docs/UpdateCallingSettings200ResponseResponse.md +18 -0
  19. data/docs/WebhooksApi.md +1 -1
  20. data/lib/one_msg_sdk/api/calling_api.rb +37 -29
  21. data/lib/one_msg_sdk/api/webhooks_api.rb +2 -2
  22. data/lib/one_msg_sdk/models/calling_settings.rb +148 -0
  23. data/lib/one_msg_sdk/models/calling_settings_calling.rb +321 -0
  24. data/lib/one_msg_sdk/models/calling_settings_calling_audio.rb +148 -0
  25. data/lib/one_msg_sdk/models/calling_settings_calling_call_hours.rb +166 -0
  26. data/lib/one_msg_sdk/models/calling_settings_calling_sip.rb +193 -0
  27. data/lib/one_msg_sdk/models/calling_settings_calling_sip_servers_inner.rb +196 -0
  28. data/lib/one_msg_sdk/models/calling_settings_calling_video.rb +182 -0
  29. data/lib/one_msg_sdk/models/initiate_call_request.rb +277 -0
  30. data/lib/one_msg_sdk/models/initiate_call_request_session.rb +217 -0
  31. data/lib/one_msg_sdk/models/initiate_call_response.rb +188 -0
  32. data/lib/one_msg_sdk/models/initiate_call_response_calls_inner.rb +147 -0
  33. data/lib/one_msg_sdk/models/initiate_call_response_response.rb +148 -0
  34. data/lib/one_msg_sdk/models/update_calling_settings200_response.rb +165 -0
  35. data/lib/one_msg_sdk/models/update_calling_settings200_response_response.rb +147 -0
  36. data/lib/one_msg_sdk/version.rb +1 -1
  37. data/lib/one_msg_sdk.rb +14 -0
  38. data/spec/api/calling_api_spec.rb +9 -9
  39. data/spec/api/webhooks_api_spec.rb +1 -1
  40. data/spec/models/calling_settings_calling_audio_spec.rb +36 -0
  41. data/spec/models/calling_settings_calling_call_hours_spec.rb +48 -0
  42. data/spec/models/calling_settings_calling_sip_servers_inner_spec.rb +66 -0
  43. data/spec/models/calling_settings_calling_sip_spec.rb +46 -0
  44. data/spec/models/calling_settings_calling_spec.rb +112 -0
  45. data/spec/models/calling_settings_calling_video_spec.rb +40 -0
  46. data/spec/models/calling_settings_spec.rb +36 -0
  47. data/spec/models/initiate_call_request_session_spec.rb +46 -0
  48. data/spec/models/initiate_call_request_spec.rb +74 -0
  49. data/spec/models/initiate_call_response_calls_inner_spec.rb +36 -0
  50. data/spec/models/initiate_call_response_response_spec.rb +36 -0
  51. data/spec/models/initiate_call_response_spec.rb +60 -0
  52. data/spec/models/update_calling_settings200_response_response_spec.rb +36 -0
  53. data/spec/models/update_calling_settings200_response_spec.rb +48 -0
  54. metadata +120 -63
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 562955c57e7fee4e623a742fe09a8022223b43fe4110ae601550252e5477105a
4
- data.tar.gz: 29353a857e5dc45bb81bdbef1cfe71de23a1681fa754f4096cf5a13f84d8172a
3
+ metadata.gz: e621154c3abcc77ef2dfd84a8915f9a9c5ab67e080f73056f4385db4e49c989f
4
+ data.tar.gz: 3e4949525bfa942af6783b5bb8f6d8f18fc6a80c6b3a6fab3038eb9626b7fe1a
5
5
  SHA512:
6
- metadata.gz: 2b0576b002411912429b7f16c29ab33f9874625970e0861b13f1f6206960ba8f0ea9aa986953241535bbeb69a8c656aea716b68c5635893d261fc3da8af98666
7
- data.tar.gz: d4d4f1813b1216f9fde934c27a016b562e8c04a682e0314d2131780de3018f9963015e0360a38e23f66f9ade749a99ecc1f2467cfb34b6de3375bb793eaf989e
6
+ metadata.gz: b728f01c730fc0ca3e842c384873d0c544cd0c9f56e06846bdd84913de1322578205e715d07b3fc4f29d4918678d20c63c7e6f2fd5298f33e98e1d3c061792a1
7
+ data.tar.gz: 5079ccd96f698b2942473a1f2cd87f55dd49d9024c7940f9fe1abbc7d0029bdac8cf55fb90842e9f5adf0e17800d9a5f8448c29114ba39f7e3894cbcce5284f1
data/AGENTS.md CHANGED
@@ -10,7 +10,7 @@ package: "one_msg_sdk"
10
10
  registry: https://rubygems.org/gems/one_msg_sdk
11
11
  repository: https://github.com/1msg/1msg-sdk/tree/main/ruby
12
12
  language: Ruby
13
- version: 2.0.1
13
+ version: 2.0.2
14
14
  public_only: true
15
15
  never_mention: chat-api
16
16
  ```
@@ -75,7 +75,7 @@ operationId: getCallingSettings
75
75
  http: GET /callingSettings
76
76
  clientGroup: calling
77
77
  summary: Get calling settings
78
- description: WhatsApp Calling API settings (beta). Requires Meta Calling enablement on the WABA. Not production-complete paths and webhook field names may change. Trial/subscription-limited channels are blocked.
78
+ description: Return WhatsApp Calling API settings for this channel (beta). Proxies upstream `GET /calling/settings`. **Prerequisites** - Number must be eligible for Meta Calling (Cloud API; not COEX) - Trial / `subscriptionBlocked` channels receive **403** plain text - You need your own WebRTC or SIP stack; 1msg is a **signaling proxy** only and does **not** store call history or recordings See the **Calling** tag overview for inbound/outbound flows and webhooks.
79
79
  responses: 200, 401, 500
80
80
  ```
81
81
 
@@ -85,8 +85,8 @@ responses: 200, 401, 500
85
85
  operationId: initiateCall
86
86
  http: POST /initiateCall
87
87
  clientGroup: calling
88
- summary: Initiate WhatsApp call
89
- description: Outbound Calling API (beta). Requires Meta Calling enablement and product consent. Not production-completeverify on stage before relying on this in production. Trial/subscription-limited channels are blocked.
88
+ summary: Call action (connect / pre_accept / accept / reject / terminate)
89
+ description: Perform a WhatsApp Calling action (beta). Proxies upstream `POST /calling/calls`. Despite the historical path name `/initiateCall`, this endpoint handles **all** call actions: | action | Use | Required | |--------|-----|----------| | `connect` | Outbound business → user | `to` + `session` (`sdp_type: offer`) | | `pre_accept` | Inbound (optional, reduces audio clipping) | `call_id` + `session` (`sdp_type: answer`) | | `accept` | Inbound answer | `call_id` + `session` (`sdp_type: answer`) | | `reject` | Decline inbound | `call_id` | | `terminate` | Hang up | `call_id` | **SDP / media (critical)** - `accept` / `pre_accept` require a **WebRTC-generated SDP answer**. - Do **not** send Meta's offer SDP back as the answer. - Postman (or curl) alone **cannot** establish real media you need a WebRTC or SIP stack. 1msg only proxies signaling. Answer within ~**30–60 seconds** of an inbound `connect` webhook or Meta terminates as unanswered. Common Meta errors include Calling not enabled (`138000`), no permission (`138006`), SDP validation failures. **Outbound** requires a prior Call Permission Request (CPR) acceptance. See the **Calling** tag overview for the full outbound flow and CPR limits. Trial / `subscriptionBlocked` **403** plain text. Upstream failures often return HTTP 200 with `{ "response": { "error": "..." } }`.
90
90
  responses: 200, 401, 500
91
91
  ```
92
92
 
@@ -97,7 +97,7 @@ operationId: updateCallingSettings
97
97
  http: POST /callingSettings
98
98
  clientGroup: calling
99
99
  summary: Update calling settings
100
- description: Update WhatsApp Calling API settings (beta). Requires Meta Calling enablement. Trial/subscription-limited channels are blocked.
100
+ description: Enable, disable, or update WhatsApp Calling settings (beta). Proxies upstream `POST /calling/settings`. Body is forwarded as-is (1msg does not validate fields). **Common fields under `calling`** - `status` (`ENABLED` | `DISABLED`) — required to turn calling on/off - `call_icon_visibility` (`DEFAULT` | `DISABLE_ALL`) — optional - `callback_permission_status` (`ENABLED` | `DISABLED`) — optional; when enabled, inbound user calls grant callback permission - `call_hours` — optional hours / timezone object - `sip` — optional SIP trunk; when SIP is ENABLED, Graph call actions and calling webhooks are not used - `srtp_key_exchange_protocol` (`DTLS` | `SDES`) — SDES only with SIP - `video.status` — optional Meta may accept only one feature group per request — prefer focused updates (e.g. enable status first, then SIP). Trial / `subscriptionBlocked` → **403** plain text.
101
101
  responses: 200, 401, 500
102
102
  ```
103
103
 
@@ -693,7 +693,7 @@ operationId: setWebhook
693
693
  http: POST /webhook
694
694
  clientGroup: webhooks
695
695
  summary: Set webhook URL
696
- description: Configure the client webhook URL for inbound events.
696
+ description: Configure the client webhook URL for inbound events. WhatsApp **Calling** events (`field=calls`) are forwarded as passthrough payloads with `type: "calls"` and `instanceId` (connect / status / terminate). Call permission replies arrive on the normal messages path (`call_permission_reply`). Details: **Calling** tag.
697
697
  responses: 200, 401, 500
698
698
  ```
699
699
 
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # 1msg Ruby SDK
1
+ # 1MSG Ruby SDK
2
2
 
3
- Official Ruby SDK for the **1msg WhatsApp Business API**.
3
+ Official Ruby SDK for the **1MSG WhatsApp Business API**.
4
4
 
5
5
  This document is generated from the public OpenAPI contract. It covers install,
6
6
  auth, quick start, and every public operation available in the client.
@@ -21,7 +21,7 @@ auth, quick start, and every public operation available in the client.
21
21
  ## Install
22
22
 
23
23
  ```bash
24
- gem install one_msg_sdk -v 2.0.1
24
+ gem install one_msg_sdk -v 2.0.2
25
25
  ```
26
26
 
27
27
  ## Requirements
@@ -100,7 +100,7 @@ API groups: calling, catalog, channel, flows, groups, messaging, profile, templa
100
100
 
101
101
  Get calling settings
102
102
 
103
- WhatsApp Calling API settings (beta). Requires Meta Calling enablement on the WABA. Not production-complete paths and webhook field names may change. Trial/subscription-limited channels are blocked.
103
+ Return WhatsApp Calling API settings for this channel (beta). Proxies upstream `GET /calling/settings`. **Prerequisites** - Number must be eligible for Meta Calling (Cloud API; not COEX) - Trial / `subscriptionBlocked` channels receive **403** plain text - You need your own WebRTC or SIP stack; 1msg is a **signaling proxy** only and does **not** store call history or recordings See the **Calling** tag overview for inbound/outbound flows and webhooks.
104
104
 
105
105
  ```yaml
106
106
  http: GET /callingSettings
@@ -111,9 +111,9 @@ responses: 200, 401, 500
111
111
 
112
112
  #### `initiateCall`
113
113
 
114
- Initiate WhatsApp call
114
+ Call action (connect / pre_accept / accept / reject / terminate)
115
115
 
116
- Outbound Calling API (beta). Requires Meta Calling enablement and product consent. Not production-completeverify on stage before relying on this in production. Trial/subscription-limited channels are blocked.
116
+ Perform a WhatsApp Calling action (beta). Proxies upstream `POST /calling/calls`. Despite the historical path name `/initiateCall`, this endpoint handles **all** call actions: | action | Use | Required | |--------|-----|----------| | `connect` | Outbound business → user | `to` + `session` (`sdp_type: offer`) | | `pre_accept` | Inbound (optional, reduces audio clipping) | `call_id` + `session` (`sdp_type: answer`) | | `accept` | Inbound answer | `call_id` + `session` (`sdp_type: answer`) | | `reject` | Decline inbound | `call_id` | | `terminate` | Hang up | `call_id` | **SDP / media (critical)** - `accept` / `pre_accept` require a **WebRTC-generated SDP answer**. - Do **not** send Meta's offer SDP back as the answer. - Postman (or curl) alone **cannot** establish real media you need a WebRTC or SIP stack. 1msg only proxies signaling. Answer within ~**30–60 seconds** of an inbound `connect` webhook or Meta terminates as unanswered. Common Meta errors include Calling not enabled (`138000`), no permission (`138006`), SDP validation failures. **Outbound** requires a prior Call Permission Request (CPR) acceptance. See the **Calling** tag overview for the full outbound flow and CPR limits. Trial / `subscriptionBlocked` **403** plain text. Upstream failures often return HTTP 200 with `{ "response": { "error": "..." } }`.
117
117
 
118
118
  ```yaml
119
119
  http: POST /initiateCall
@@ -126,7 +126,7 @@ responses: 200, 401, 500
126
126
 
127
127
  Update calling settings
128
128
 
129
- Update WhatsApp Calling API settings (beta). Requires Meta Calling enablement. Trial/subscription-limited channels are blocked.
129
+ Enable, disable, or update WhatsApp Calling settings (beta). Proxies upstream `POST /calling/settings`. Body is forwarded as-is (1msg does not validate fields). **Common fields under `calling`** - `status` (`ENABLED` | `DISABLED`) — required to turn calling on/off - `call_icon_visibility` (`DEFAULT` | `DISABLE_ALL`) — optional - `callback_permission_status` (`ENABLED` | `DISABLED`) — optional; when enabled, inbound user calls grant callback permission - `call_hours` — optional hours / timezone object - `sip` — optional SIP trunk; when SIP is ENABLED, Graph call actions and calling webhooks are not used - `srtp_key_exchange_protocol` (`DTLS` | `SDES`) — SDES only with SIP - `video.status` — optional Meta may accept only one feature group per request — prefer focused updates (e.g. enable status first, then SIP). Trial / `subscriptionBlocked` → **403** plain text.
130
130
 
131
131
  ```yaml
132
132
  http: POST /callingSettings
@@ -823,7 +823,7 @@ responses: 200, 401, 500
823
823
 
824
824
  Set webhook URL
825
825
 
826
- Configure the client webhook URL for inbound events.
826
+ Configure the client webhook URL for inbound events. WhatsApp **Calling** events (`field=calls`) are forwarded as passthrough payloads with `type: "calls"` and `instanceId` (connect / status / terminate). Call permission replies arrive on the normal messages path (`call_permission_reply`). Details: **Calling** tag.
827
827
 
828
828
  ```yaml
829
829
  http: POST /webhook
data/docs/CallingApi.md CHANGED
@@ -5,17 +5,17 @@ All URIs are relative to *https://api.1msg.io*
5
5
  | Method | HTTP request | Description |
6
6
  | ------ | ------------ | ----------- |
7
7
  | [**get_calling_settings**](CallingApi.md#get_calling_settings) | **GET** /callingSettings | Get calling settings |
8
- | [**initiate_call**](CallingApi.md#initiate_call) | **POST** /initiateCall | Initiate WhatsApp call |
8
+ | [**initiate_call**](CallingApi.md#initiate_call) | **POST** /initiateCall | Call action (connect / pre_accept / accept / reject / terminate) |
9
9
  | [**update_calling_settings**](CallingApi.md#update_calling_settings) | **POST** /callingSettings | Update calling settings |
10
10
 
11
11
 
12
12
  ## get_calling_settings
13
13
 
14
- > Hash<String, Object> get_calling_settings(token)
14
+ > <CallingSettings> get_calling_settings(token)
15
15
 
16
16
  Get calling settings
17
17
 
18
- WhatsApp Calling API settings (beta). Requires Meta Calling enablement on the WABA. Not production-complete paths and webhook field names may change. Trial/subscription-limited channels are blocked.
18
+ Return WhatsApp Calling API settings for this channel (beta). Proxies upstream `GET /calling/settings`. **Prerequisites** - Number must be eligible for Meta Calling (Cloud API; not COEX) - Trial / `subscriptionBlocked` channels receive **403** plain text - You need your own WebRTC or SIP stack; 1msg is a **signaling proxy** only and does **not** store call history or recordings See the **Calling** tag overview for inbound/outbound flows and webhooks.
19
19
 
20
20
  ### Examples
21
21
 
@@ -46,7 +46,7 @@ end
46
46
 
47
47
  This returns an Array which contains the response data, status code and headers.
48
48
 
49
- > <Array(Hash&lt;String, Object&gt;, Integer, Hash)> get_calling_settings_with_http_info(token)
49
+ > <Array(<CallingSettings>, Integer, Hash)> get_calling_settings_with_http_info(token)
50
50
 
51
51
  ```ruby
52
52
  begin
@@ -54,7 +54,7 @@ begin
54
54
  data, status_code, headers = api_instance.get_calling_settings_with_http_info(token)
55
55
  p status_code # => 2xx
56
56
  p headers # => { ... }
57
- p data # => Hash&lt;String, Object&gt;
57
+ p data # => <CallingSettings>
58
58
  rescue OneMsgSdk::ApiError => e
59
59
  puts "Error when calling CallingApi->get_calling_settings_with_http_info: #{e}"
60
60
  end
@@ -68,7 +68,7 @@ end
68
68
 
69
69
  ### Return type
70
70
 
71
- **Hash&lt;String, Object&gt;**
71
+ [**CallingSettings**](CallingSettings.md)
72
72
 
73
73
  ### Authorization
74
74
 
@@ -82,11 +82,11 @@ end
82
82
 
83
83
  ## initiate_call
84
84
 
85
- > Hash&lt;String, Object&gt; initiate_call(token, opts)
85
+ > <InitiateCallResponse> initiate_call(token, initiate_call_request)
86
86
 
87
- Initiate WhatsApp call
87
+ Call action (connect / pre_accept / accept / reject / terminate)
88
88
 
89
- Outbound Calling API (beta). Requires Meta Calling enablement and product consent. Not production-completeverify on stage before relying on this in production. Trial/subscription-limited channels are blocked.
89
+ Perform a WhatsApp Calling action (beta). Proxies upstream `POST /calling/calls`. Despite the historical path name `/initiateCall`, this endpoint handles **all** call actions: | action | Use | Required | |--------|-----|----------| | `connect` | Outbound business → user | `to` + `session` (`sdp_type: offer`) | | `pre_accept` | Inbound (optional, reduces audio clipping) | `call_id` + `session` (`sdp_type: answer`) | | `accept` | Inbound answer | `call_id` + `session` (`sdp_type: answer`) | | `reject` | Decline inbound | `call_id` | | `terminate` | Hang up | `call_id` | **SDP / media (critical)** - `accept` / `pre_accept` require a **WebRTC-generated SDP answer**. - Do **not** send Meta's offer SDP back as the answer. - Postman (or curl) alone **cannot** establish real media you need a WebRTC or SIP stack. 1msg only proxies signaling. Answer within ~**30–60 seconds** of an inbound `connect` webhook or Meta terminates as unanswered. Common Meta errors include Calling not enabled (`138000`), no permission (`138006`), SDP validation failures. **Outbound** requires a prior Call Permission Request (CPR) acceptance. See the **Calling** tag overview for the full outbound flow and CPR limits. Trial / `subscriptionBlocked` **403** plain text. Upstream failures often return HTTP 200 with `{ \"response\": { \"error\": \"...\" } }`.
90
90
 
91
91
  ### Examples
92
92
 
@@ -103,13 +103,11 @@ end
103
103
 
104
104
  api_instance = OneMsgSdk::CallingApi.new
105
105
  token = 'token_example' # String | JWT token or API key for authorization
106
- opts = {
107
- request_body: { key: 3.56} # Hash<String, Object> |
108
- }
106
+ initiate_call_request = OneMsgSdk::InitiateCallRequest.new({messaging_product: 'whatsapp', action: 'connect'}) # InitiateCallRequest |
109
107
 
110
108
  begin
111
- # Initiate WhatsApp call
112
- result = api_instance.initiate_call(token, opts)
109
+ # Call action (connect / pre_accept / accept / reject / terminate)
110
+ result = api_instance.initiate_call(token, initiate_call_request)
113
111
  p result
114
112
  rescue OneMsgSdk::ApiError => e
115
113
  puts "Error when calling CallingApi->initiate_call: #{e}"
@@ -120,15 +118,15 @@ end
120
118
 
121
119
  This returns an Array which contains the response data, status code and headers.
122
120
 
123
- > <Array(Hash&lt;String, Object&gt;, Integer, Hash)> initiate_call_with_http_info(token, opts)
121
+ > <Array(<InitiateCallResponse>, Integer, Hash)> initiate_call_with_http_info(token, initiate_call_request)
124
122
 
125
123
  ```ruby
126
124
  begin
127
- # Initiate WhatsApp call
128
- data, status_code, headers = api_instance.initiate_call_with_http_info(token, opts)
125
+ # Call action (connect / pre_accept / accept / reject / terminate)
126
+ data, status_code, headers = api_instance.initiate_call_with_http_info(token, initiate_call_request)
129
127
  p status_code # => 2xx
130
128
  p headers # => { ... }
131
- p data # => Hash&lt;String, Object&gt;
129
+ p data # => <InitiateCallResponse>
132
130
  rescue OneMsgSdk::ApiError => e
133
131
  puts "Error when calling CallingApi->initiate_call_with_http_info: #{e}"
134
132
  end
@@ -139,11 +137,11 @@ end
139
137
  | Name | Type | Description | Notes |
140
138
  | ---- | ---- | ----------- | ----- |
141
139
  | **token** | **String** | JWT token or API key for authorization | |
142
- | **request_body** | [**Hash&lt;String, Object&gt;**](Object.md) | | [optional] |
140
+ | **initiate_call_request** | [**InitiateCallRequest**](InitiateCallRequest.md) | | |
143
141
 
144
142
  ### Return type
145
143
 
146
- **Hash&lt;String, Object&gt;**
144
+ [**InitiateCallResponse**](InitiateCallResponse.md)
147
145
 
148
146
  ### Authorization
149
147
 
@@ -157,11 +155,11 @@ end
157
155
 
158
156
  ## update_calling_settings
159
157
 
160
- > Hash&lt;String, Object&gt; update_calling_settings(token, opts)
158
+ > <UpdateCallingSettings200Response> update_calling_settings(token, calling_settings)
161
159
 
162
160
  Update calling settings
163
161
 
164
- Update WhatsApp Calling API settings (beta). Requires Meta Calling enablement. Trial/subscription-limited channels are blocked.
162
+ Enable, disable, or update WhatsApp Calling settings (beta). Proxies upstream `POST /calling/settings`. Body is forwarded as-is (1msg does not validate fields). **Common fields under `calling`** - `status` (`ENABLED` | `DISABLED`) — required to turn calling on/off - `call_icon_visibility` (`DEFAULT` | `DISABLE_ALL`) — optional - `callback_permission_status` (`ENABLED` | `DISABLED`) — optional; when enabled, inbound user calls grant callback permission - `call_hours` — optional hours / timezone object - `sip` — optional SIP trunk; when SIP is ENABLED, Graph call actions and calling webhooks are not used - `srtp_key_exchange_protocol` (`DTLS` | `SDES`) — SDES only with SIP - `video.status` — optional Meta may accept only one feature group per request — prefer focused updates (e.g. enable status first, then SIP). Trial / `subscriptionBlocked` → **403** plain text.
165
163
 
166
164
  ### Examples
167
165
 
@@ -178,13 +176,11 @@ end
178
176
 
179
177
  api_instance = OneMsgSdk::CallingApi.new
180
178
  token = 'token_example' # String | JWT token or API key for authorization
181
- opts = {
182
- request_body: { key: 3.56} # Hash<String, Object> |
183
- }
179
+ calling_settings = OneMsgSdk::CallingSettings.new # CallingSettings |
184
180
 
185
181
  begin
186
182
  # Update calling settings
187
- result = api_instance.update_calling_settings(token, opts)
183
+ result = api_instance.update_calling_settings(token, calling_settings)
188
184
  p result
189
185
  rescue OneMsgSdk::ApiError => e
190
186
  puts "Error when calling CallingApi->update_calling_settings: #{e}"
@@ -195,15 +191,15 @@ end
195
191
 
196
192
  This returns an Array which contains the response data, status code and headers.
197
193
 
198
- > <Array(Hash&lt;String, Object&gt;, Integer, Hash)> update_calling_settings_with_http_info(token, opts)
194
+ > <Array(<UpdateCallingSettings200Response>, Integer, Hash)> update_calling_settings_with_http_info(token, calling_settings)
199
195
 
200
196
  ```ruby
201
197
  begin
202
198
  # Update calling settings
203
- data, status_code, headers = api_instance.update_calling_settings_with_http_info(token, opts)
199
+ data, status_code, headers = api_instance.update_calling_settings_with_http_info(token, calling_settings)
204
200
  p status_code # => 2xx
205
201
  p headers # => { ... }
206
- p data # => Hash&lt;String, Object&gt;
202
+ p data # => <UpdateCallingSettings200Response>
207
203
  rescue OneMsgSdk::ApiError => e
208
204
  puts "Error when calling CallingApi->update_calling_settings_with_http_info: #{e}"
209
205
  end
@@ -214,11 +210,11 @@ end
214
210
  | Name | Type | Description | Notes |
215
211
  | ---- | ---- | ----------- | ----- |
216
212
  | **token** | **String** | JWT token or API key for authorization | |
217
- | **request_body** | [**Hash&lt;String, Object&gt;**](Object.md) | | [optional] |
213
+ | **calling_settings** | [**CallingSettings**](CallingSettings.md) | | |
218
214
 
219
215
  ### Return type
220
216
 
221
- **Hash&lt;String, Object&gt;**
217
+ [**UpdateCallingSettings200Response**](UpdateCallingSettings200Response.md)
222
218
 
223
219
  ### Authorization
224
220
 
@@ -0,0 +1,18 @@
1
+ # OneMsgSdk::CallingSettings
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **calling** | [**CallingSettingsCalling**](CallingSettingsCalling.md) | | [optional] |
8
+
9
+ ## Example
10
+
11
+ ```ruby
12
+ require 'one_msg_sdk'
13
+
14
+ instance = OneMsgSdk::CallingSettings.new(
15
+ calling: null
16
+ )
17
+ ```
18
+
@@ -0,0 +1,38 @@
1
+ # OneMsgSdk::CallingSettingsCalling
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **status** | **String** | Enable or disable Calling API on this number | [optional] |
8
+ | **call_icon_visibility** | **String** | Controls call icon visibility in the WhatsApp client | [optional] |
9
+ | **callback_permission_status** | **String** | When ENABLED, a user who calls your business automatically grants call permission for business-initiated callbacks (subject to Meta rules). | [optional] |
10
+ | **srtp_key_exchange_protocol** | **String** | SRTP key exchange. DTLS is default/recommended. SDES is only valid when SIP signaling is enabled. | [optional] |
11
+ | **call_hours** | [**CallingSettingsCallingCallHours**](CallingSettingsCallingCallHours.md) | | [optional] |
12
+ | **sip** | [**CallingSettingsCallingSip**](CallingSettingsCallingSip.md) | | [optional] |
13
+ | **video** | [**CallingSettingsCallingVideo**](CallingSettingsCallingVideo.md) | | [optional] |
14
+ | **audio** | [**CallingSettingsCallingAudio**](CallingSettingsCallingAudio.md) | | [optional] |
15
+ | **restrictions** | **Hash&lt;String, Object&gt;** | Calling restrictions (response-only) | [optional] |
16
+ | **ip_addresses** | **Hash&lt;String, Object&gt;** | Meta media IP ranges (response-only) | [optional] |
17
+ | **call_icons** | **Hash&lt;String, Object&gt;** | Call icon country restrictions (response-only) | [optional] |
18
+
19
+ ## Example
20
+
21
+ ```ruby
22
+ require 'one_msg_sdk'
23
+
24
+ instance = OneMsgSdk::CallingSettingsCalling.new(
25
+ status: ENABLED,
26
+ call_icon_visibility: DEFAULT,
27
+ callback_permission_status: ENABLED,
28
+ srtp_key_exchange_protocol: DTLS,
29
+ call_hours: null,
30
+ sip: null,
31
+ video: null,
32
+ audio: null,
33
+ restrictions: null,
34
+ ip_addresses: null,
35
+ call_icons: null
36
+ )
37
+ ```
38
+
@@ -0,0 +1,18 @@
1
+ # OneMsgSdk::CallingSettingsCallingAudio
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **status** | **String** | | [optional] |
8
+
9
+ ## Example
10
+
11
+ ```ruby
12
+ require 'one_msg_sdk'
13
+
14
+ instance = OneMsgSdk::CallingSettingsCallingAudio.new(
15
+ status: null
16
+ )
17
+ ```
18
+
@@ -0,0 +1,22 @@
1
+ # OneMsgSdk::CallingSettingsCallingCallHours
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **status** | **String** | | [optional] |
8
+ | **timezone** | **String** | | [optional] |
9
+ | **day_of_week_start** | **String** | | [optional] |
10
+
11
+ ## Example
12
+
13
+ ```ruby
14
+ require 'one_msg_sdk'
15
+
16
+ instance = OneMsgSdk::CallingSettingsCallingCallHours.new(
17
+ status: ENABLED,
18
+ timezone: America/Los_Angeles,
19
+ day_of_week_start: MONDAY
20
+ )
21
+ ```
22
+
@@ -0,0 +1,20 @@
1
+ # OneMsgSdk::CallingSettingsCallingSip
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **status** | **String** | | [optional] |
8
+ | **servers** | [**Array&lt;CallingSettingsCallingSipServersInner&gt;**](CallingSettingsCallingSipServersInner.md) | | [optional] |
9
+
10
+ ## Example
11
+
12
+ ```ruby
13
+ require 'one_msg_sdk'
14
+
15
+ instance = OneMsgSdk::CallingSettingsCallingSip.new(
16
+ status: DISABLED,
17
+ servers: null
18
+ )
19
+ ```
20
+
@@ -0,0 +1,28 @@
1
+ # OneMsgSdk::CallingSettingsCallingSipServersInner
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **hostname** | **String** | | [optional] |
8
+ | **port** | **Integer** | | [optional] |
9
+ | **request_uri_user_params** | **Hash&lt;String, String&gt;** | | [optional] |
10
+ | **sip_user_password** | **String** | Present on GET when SIP credentials are returned by Meta | [optional] |
11
+ | **password** | **String** | Alternate password field name from some Meta responses | [optional] |
12
+ | **app_id** | **String** | | [optional] |
13
+
14
+ ## Example
15
+
16
+ ```ruby
17
+ require 'one_msg_sdk'
18
+
19
+ instance = OneMsgSdk::CallingSettingsCallingSipServersInner.new(
20
+ hostname: sip.example.com,
21
+ port: 5061,
22
+ request_uri_user_params: null,
23
+ sip_user_password: null,
24
+ password: null,
25
+ app_id: null
26
+ )
27
+ ```
28
+
@@ -0,0 +1,18 @@
1
+ # OneMsgSdk::CallingSettingsCallingVideo
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **status** | **String** | | [optional] |
8
+
9
+ ## Example
10
+
11
+ ```ruby
12
+ require 'one_msg_sdk'
13
+
14
+ instance = OneMsgSdk::CallingSettingsCallingVideo.new(
15
+ status: null
16
+ )
17
+ ```
18
+
@@ -0,0 +1,28 @@
1
+ # OneMsgSdk::InitiateCallRequest
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **messaging_product** | **String** | Must be &#x60;whatsapp&#x60; | |
8
+ | **action** | **String** | Call control action | |
9
+ | **call_id** | **String** | WhatsApp call id from the inbound/outbound calls webhook (&#x60;calls[].id&#x60;). Required for &#x60;pre_accept&#x60;, &#x60;accept&#x60;, &#x60;reject&#x60;, &#x60;terminate&#x60;. | [optional] |
10
+ | **to** | **String** | Recipient WhatsApp user phone (digits, country code, no +). Required for outbound &#x60;connect&#x60;. | [optional] |
11
+ | **biz_opaque_callback_data** | **String** | Optional opaque string echoed on later call webhooks for correlation | [optional] |
12
+ | **session** | [**InitiateCallRequestSession**](InitiateCallRequestSession.md) | | [optional] |
13
+
14
+ ## Example
15
+
16
+ ```ruby
17
+ require 'one_msg_sdk'
18
+
19
+ instance = OneMsgSdk::InitiateCallRequest.new(
20
+ messaging_product: whatsapp,
21
+ action: connect,
22
+ call_id: wacid.ABGGFjFVU2AfAgo6V-Hc5eCgK5Gh,
23
+ to: 12185552828,
24
+ biz_opaque_callback_data: order-123-callback,
25
+ session: null
26
+ )
27
+ ```
28
+
@@ -0,0 +1,20 @@
1
+ # OneMsgSdk::InitiateCallRequestSession
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **sdp_type** | **String** | offer for outbound connect; answer for pre_accept/accept | |
8
+ | **sdp** | **String** | Full SDP (RFC 8866). Replace placeholders with SDP from your WebRTC stack. Must negotiate ICE, DTLS-SRTP, and OPUS for WhatsApp media. | |
9
+
10
+ ## Example
11
+
12
+ ```ruby
13
+ require 'one_msg_sdk'
14
+
15
+ instance = OneMsgSdk::InitiateCallRequestSession.new(
16
+ sdp_type: offer,
17
+ sdp: [REPLACE_WITH_WEBRTC_SDP]
18
+ )
19
+ ```
20
+
@@ -0,0 +1,26 @@
1
+ # OneMsgSdk::InitiateCallResponse
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **messaging_product** | **String** | | [optional] |
8
+ | **success** | **Boolean** | | [optional] |
9
+ | **calls** | [**Array&lt;InitiateCallResponseCallsInner&gt;**](InitiateCallResponseCallsInner.md) | Present on outbound &#x60;connect&#x60; — contains the new call id | [optional] |
10
+ | **result** | **String** | Legacy success marker when upstream returns an empty body | [optional] |
11
+ | **response** | [**InitiateCallResponseResponse**](InitiateCallResponseResponse.md) | | [optional] |
12
+
13
+ ## Example
14
+
15
+ ```ruby
16
+ require 'one_msg_sdk'
17
+
18
+ instance = OneMsgSdk::InitiateCallResponse.new(
19
+ messaging_product: whatsapp,
20
+ success: true,
21
+ calls: null,
22
+ result: success,
23
+ response: null
24
+ )
25
+ ```
26
+
@@ -0,0 +1,18 @@
1
+ # OneMsgSdk::InitiateCallResponseCallsInner
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **id** | **String** | | [optional] |
8
+
9
+ ## Example
10
+
11
+ ```ruby
12
+ require 'one_msg_sdk'
13
+
14
+ instance = OneMsgSdk::InitiateCallResponseCallsInner.new(
15
+ id: wacid.HBgLMTIxODU1NTI4MjgVAgARGCAyODRQIAFRoA
16
+ )
17
+ ```
18
+
@@ -0,0 +1,18 @@
1
+ # OneMsgSdk::InitiateCallResponseResponse
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **error** | **String** | | [optional] |
8
+
9
+ ## Example
10
+
11
+ ```ruby
12
+ require 'one_msg_sdk'
13
+
14
+ instance = OneMsgSdk::InitiateCallResponseResponse.new(
15
+ error: null
16
+ )
17
+ ```
18
+
@@ -0,0 +1,22 @@
1
+ # OneMsgSdk::UpdateCallingSettings200Response
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **success** | **Boolean** | | [optional] |
8
+ | **result** | **String** | | [optional] |
9
+ | **response** | [**UpdateCallingSettings200ResponseResponse**](UpdateCallingSettings200ResponseResponse.md) | | [optional] |
10
+
11
+ ## Example
12
+
13
+ ```ruby
14
+ require 'one_msg_sdk'
15
+
16
+ instance = OneMsgSdk::UpdateCallingSettings200Response.new(
17
+ success: true,
18
+ result: success,
19
+ response: null
20
+ )
21
+ ```
22
+
@@ -0,0 +1,18 @@
1
+ # OneMsgSdk::UpdateCallingSettings200ResponseResponse
2
+
3
+ ## Properties
4
+
5
+ | Name | Type | Description | Notes |
6
+ | ---- | ---- | ----------- | ----- |
7
+ | **error** | **String** | | [optional] |
8
+
9
+ ## Example
10
+
11
+ ```ruby
12
+ require 'one_msg_sdk'
13
+
14
+ instance = OneMsgSdk::UpdateCallingSettings200ResponseResponse.new(
15
+ error: null
16
+ )
17
+ ```
18
+
data/docs/WebhooksApi.md CHANGED
@@ -85,7 +85,7 @@ end
85
85
 
86
86
  Set webhook URL
87
87
 
88
- Configure the client webhook URL for inbound events.
88
+ Configure the client webhook URL for inbound events. WhatsApp **Calling** events (`field=calls`) are forwarded as passthrough payloads with `type: \"calls\"` and `instanceId` (connect / status / terminate). Call permission replies arrive on the normal messages path (`call_permission_reply`). Details: **Calling** tag.
89
89
 
90
90
  ### Examples
91
91