zernio-sdk 0.0.539 → 0.0.541
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/README.md +4 -42
- data/docs/AdAudiencesApi.md +5 -5
- data/docs/AdCampaignsApi.md +0 -142
- data/docs/AdsApi.md +18 -700
- data/docs/InboxApi.md +79 -0
- data/docs/InboxWebhookMessageAttachmentsInner.md +1 -1
- data/docs/SMSApi.md +1 -276
- data/docs/SendSmsRequest.md +1 -1
- data/docs/WebhookPayloadMessageMessage.md +1 -1
- data/docs/WebhookPayloadMessageMessageAttachmentsInner.md +22 -0
- data/docs/WebhookPayloadMessageSentMessage.md +1 -1
- data/docs/WebhookPayloadMessageSentMessageAttachmentsInner.md +22 -0
- data/lib/zernio-sdk/api/ad_audiences_api.rb +4 -4
- data/lib/zernio-sdk/api/ad_campaigns_api.rb +0 -142
- data/lib/zernio-sdk/api/ads_api.rb +39 -739
- data/lib/zernio-sdk/api/inbox_api.rb +92 -0
- data/lib/zernio-sdk/api/sms_api.rb +2 -256
- data/lib/zernio-sdk/models/inbox_webhook_message_attachments_inner.rb +1 -1
- data/lib/zernio-sdk/models/send_sms_request.rb +1 -1
- data/lib/zernio-sdk/models/webhook_payload_message_message.rb +1 -1
- data/lib/zernio-sdk/models/{create_sms_sender_id_request.rb → webhook_payload_message_message_attachments_inner.rb} +52 -33
- data/lib/zernio-sdk/models/webhook_payload_message_sent_message.rb +1 -1
- data/lib/zernio-sdk/models/{update_ad_creative_request.rb → webhook_payload_message_sent_message_attachments_inner.rb} +46 -44
- data/lib/zernio-sdk/version.rb +1 -1
- data/lib/zernio-sdk.rb +3 -26
- data/openapi.yaml +87 -624
- data/spec/api/ad_audiences_api_spec.rb +2 -2
- data/spec/api/ad_campaigns_api_spec.rb +0 -25
- data/spec/api/ads_api_spec.rb +0 -128
- data/spec/api/inbox_api_spec.rb +48 -0
- data/spec/api/sms_api_spec.rb +1 -47
- data/spec/models/{list_ad_images200_response_spec.rb → webhook_payload_message_message_attachments_inner_spec.rb} +9 -9
- data/spec/models/{list_ad_creatives200_response_spec.rb → webhook_payload_message_sent_message_attachments_inner_spec.rb} +9 -9
- metadata +13 -105
- data/docs/CreateAdCampaign201Response.md +0 -24
- data/docs/CreateAdCampaignRequest.md +0 -32
- data/docs/CreateAdCreative201Response.md +0 -20
- data/docs/CreateAdCreativeRequest.md +0 -38
- data/docs/CreateAdCreativeRequestCarouselCardsInner.md +0 -26
- data/docs/CreateSmsSenderId200Response.md +0 -22
- data/docs/CreateSmsSenderIdRequest.md +0 -18
- data/docs/DeleteAdCreative200Response.md +0 -20
- data/docs/DeleteSmsSenderId200Response.md +0 -18
- data/docs/DuplicateAd200Response.md +0 -22
- data/docs/DuplicateAdRequest.md +0 -28
- data/docs/DuplicateAdSet200Response.md +0 -22
- data/docs/DuplicateAdSetRequest.md +0 -36
- data/docs/GetAdCreative200Response.md +0 -18
- data/docs/ListAdCreatives200Response.md +0 -22
- data/docs/ListAdImages200Response.md +0 -22
- data/docs/ListAdLabels200Response.md +0 -22
- data/docs/ListHighDemandPeriods200Response.md +0 -22
- data/docs/ListSmsSenderIds200Response.md +0 -20
- data/docs/ListSmsSenderIds200ResponseBudget.md +0 -24
- data/docs/ListSmsSenderIds200ResponseBudgetPendingRequest.md +0 -22
- data/docs/ListSmsSenderIds200ResponseSenderIdsInner.md +0 -24
- data/docs/RequestSmsSenderIdLimitIncrease200Response.md +0 -20
- data/docs/RequestSmsSenderIdLimitIncreaseRequest.md +0 -20
- data/docs/UpdateAdCreative200Response.md +0 -22
- data/docs/UpdateAdCreativeRequest.md +0 -20
- data/lib/zernio-sdk/models/create_ad_campaign201_response.rb +0 -210
- data/lib/zernio-sdk/models/create_ad_campaign_request.rb +0 -343
- data/lib/zernio-sdk/models/create_ad_creative201_response.rb +0 -157
- data/lib/zernio-sdk/models/create_ad_creative_request.rb +0 -390
- data/lib/zernio-sdk/models/create_ad_creative_request_carousel_cards_inner.rb +0 -255
- data/lib/zernio-sdk/models/create_sms_sender_id200_response.rb +0 -166
- data/lib/zernio-sdk/models/delete_ad_creative200_response.rb +0 -156
- data/lib/zernio-sdk/models/delete_sms_sender_id200_response.rb +0 -147
- data/lib/zernio-sdk/models/duplicate_ad200_response.rb +0 -200
- data/lib/zernio-sdk/models/duplicate_ad_request.rb +0 -243
- data/lib/zernio-sdk/models/duplicate_ad_set200_response.rb +0 -201
- data/lib/zernio-sdk/models/duplicate_ad_set_request.rb +0 -302
- data/lib/zernio-sdk/models/get_ad_creative200_response.rb +0 -148
- data/lib/zernio-sdk/models/list_ad_creatives200_response.rb +0 -167
- data/lib/zernio-sdk/models/list_ad_images200_response.rb +0 -167
- data/lib/zernio-sdk/models/list_ad_labels200_response.rb +0 -167
- data/lib/zernio-sdk/models/list_high_demand_periods200_response.rb +0 -168
- data/lib/zernio-sdk/models/list_sms_sender_ids200_response.rb +0 -158
- data/lib/zernio-sdk/models/list_sms_sender_ids200_response_budget.rb +0 -178
- data/lib/zernio-sdk/models/list_sms_sender_ids200_response_budget_pending_request.rb +0 -167
- data/lib/zernio-sdk/models/list_sms_sender_ids200_response_sender_ids_inner.rb +0 -175
- data/lib/zernio-sdk/models/request_sms_sender_id_limit_increase200_response.rb +0 -156
- data/lib/zernio-sdk/models/request_sms_sender_id_limit_increase_request.rb +0 -210
- data/lib/zernio-sdk/models/update_ad_creative200_response.rb +0 -165
- data/spec/models/create_ad_campaign201_response_spec.rb +0 -58
- data/spec/models/create_ad_campaign_request_spec.rb +0 -94
- data/spec/models/create_ad_creative201_response_spec.rb +0 -42
- data/spec/models/create_ad_creative_request_carousel_cards_inner_spec.rb +0 -60
- data/spec/models/create_ad_creative_request_spec.rb +0 -96
- data/spec/models/create_sms_sender_id200_response_spec.rb +0 -48
- data/spec/models/create_sms_sender_id_request_spec.rb +0 -36
- data/spec/models/delete_ad_creative200_response_spec.rb +0 -42
- data/spec/models/delete_sms_sender_id200_response_spec.rb +0 -36
- data/spec/models/duplicate_ad200_response_spec.rb +0 -52
- data/spec/models/duplicate_ad_request_spec.rb +0 -74
- data/spec/models/duplicate_ad_set200_response_spec.rb +0 -52
- data/spec/models/duplicate_ad_set_request_spec.rb +0 -102
- data/spec/models/get_ad_creative200_response_spec.rb +0 -36
- data/spec/models/list_ad_labels200_response_spec.rb +0 -48
- data/spec/models/list_high_demand_periods200_response_spec.rb +0 -48
- data/spec/models/list_sms_sender_ids200_response_budget_pending_request_spec.rb +0 -48
- data/spec/models/list_sms_sender_ids200_response_budget_spec.rb +0 -54
- data/spec/models/list_sms_sender_ids200_response_sender_ids_inner_spec.rb +0 -54
- data/spec/models/list_sms_sender_ids200_response_spec.rb +0 -42
- data/spec/models/request_sms_sender_id_limit_increase200_response_spec.rb +0 -42
- data/spec/models/request_sms_sender_id_limit_increase_request_spec.rb +0 -42
- data/spec/models/update_ad_creative200_response_spec.rb +0 -48
- data/spec/models/update_ad_creative_request_spec.rb +0 -42
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 1.0.4
|
|
7
|
+
Contact: support@zernio.com
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.19.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module Zernio
|
|
16
|
+
class InboxApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Download WhatsApp media
|
|
23
|
+
# Streams the binary for a WhatsApp attachment. This is the endpoint the `url` on a WhatsApp `attachments[]` entry points at, in both the `message.received` webhook and the List messages response. **This is an authenticated endpoint, not a public link.** Send `Authorization: Bearer <your API key>` exactly as you would for any other call. Passing the URL straight to a browser, an LLM vision API, or a no-code \"download file\" step without the header returns `401`. This is the most common integration mistake on this endpoint, and it differs from Instagram, Facebook and Telegram, whose `attachments[].url` is a direct CDN link that needs no header. **Fetch on receipt, not lazily.** WhatsApp media lives in Meta's media store, not ours, and it is removed after a limited retention window (currently 7 days, and Meta has been dropping some inbound media sooner). Once Meta drops it the media is unrecoverable and this endpoint answers `400` permanently, so retrying will never succeed. Download and store the bytes when the webhook arrives.
|
|
24
|
+
# @param media_id [String] The media id from `attachments[].payload.id`.
|
|
25
|
+
# @param account_id [String] The WhatsApp account that received the media.
|
|
26
|
+
# @param [Hash] opts the optional parameters
|
|
27
|
+
# @return [File]
|
|
28
|
+
def get_whats_app_media(media_id, account_id, opts = {})
|
|
29
|
+
data, _status_code, _headers = get_whats_app_media_with_http_info(media_id, account_id, opts)
|
|
30
|
+
data
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Download WhatsApp media
|
|
34
|
+
# Streams the binary for a WhatsApp attachment. This is the endpoint the `url` on a WhatsApp `attachments[]` entry points at, in both the `message.received` webhook and the List messages response. **This is an authenticated endpoint, not a public link.** Send `Authorization: Bearer <your API key>` exactly as you would for any other call. Passing the URL straight to a browser, an LLM vision API, or a no-code \"download file\" step without the header returns `401`. This is the most common integration mistake on this endpoint, and it differs from Instagram, Facebook and Telegram, whose `attachments[].url` is a direct CDN link that needs no header. **Fetch on receipt, not lazily.** WhatsApp media lives in Meta's media store, not ours, and it is removed after a limited retention window (currently 7 days, and Meta has been dropping some inbound media sooner). Once Meta drops it the media is unrecoverable and this endpoint answers `400` permanently, so retrying will never succeed. Download and store the bytes when the webhook arrives.
|
|
35
|
+
# @param media_id [String] The media id from `attachments[].payload.id`.
|
|
36
|
+
# @param account_id [String] The WhatsApp account that received the media.
|
|
37
|
+
# @param [Hash] opts the optional parameters
|
|
38
|
+
# @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
|
|
39
|
+
def get_whats_app_media_with_http_info(media_id, account_id, opts = {})
|
|
40
|
+
if @api_client.config.debugging
|
|
41
|
+
@api_client.config.logger.debug 'Calling API: InboxApi.get_whats_app_media ...'
|
|
42
|
+
end
|
|
43
|
+
# verify the required parameter 'media_id' is set
|
|
44
|
+
if @api_client.config.client_side_validation && media_id.nil?
|
|
45
|
+
fail ArgumentError, "Missing the required parameter 'media_id' when calling InboxApi.get_whats_app_media"
|
|
46
|
+
end
|
|
47
|
+
# verify the required parameter 'account_id' is set
|
|
48
|
+
if @api_client.config.client_side_validation && account_id.nil?
|
|
49
|
+
fail ArgumentError, "Missing the required parameter 'account_id' when calling InboxApi.get_whats_app_media"
|
|
50
|
+
end
|
|
51
|
+
# resource path
|
|
52
|
+
local_var_path = '/v1/whatsapp/media/{mediaId}'.sub('{' + 'mediaId' + '}', CGI.escape(media_id.to_s))
|
|
53
|
+
|
|
54
|
+
# query parameters
|
|
55
|
+
query_params = opts[:query_params] || {}
|
|
56
|
+
query_params[:'accountId'] = account_id
|
|
57
|
+
|
|
58
|
+
# header parameters
|
|
59
|
+
header_params = opts[:header_params] || {}
|
|
60
|
+
# HTTP header 'Accept' (if needed)
|
|
61
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/octet-stream', 'application/json']) unless header_params['Accept']
|
|
62
|
+
|
|
63
|
+
# form parameters
|
|
64
|
+
form_params = opts[:form_params] || {}
|
|
65
|
+
|
|
66
|
+
# http body (model)
|
|
67
|
+
post_body = opts[:debug_body]
|
|
68
|
+
|
|
69
|
+
# return_type
|
|
70
|
+
return_type = opts[:debug_return_type] || 'File'
|
|
71
|
+
|
|
72
|
+
# auth_names
|
|
73
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
74
|
+
|
|
75
|
+
new_options = opts.merge(
|
|
76
|
+
:operation => :"InboxApi.get_whats_app_media",
|
|
77
|
+
:header_params => header_params,
|
|
78
|
+
:query_params => query_params,
|
|
79
|
+
:form_params => form_params,
|
|
80
|
+
:body => post_body,
|
|
81
|
+
:auth_names => auth_names,
|
|
82
|
+
:return_type => return_type
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
86
|
+
if @api_client.config.debugging
|
|
87
|
+
@api_client.config.logger.debug "API called: InboxApi#get_whats_app_media\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
88
|
+
end
|
|
89
|
+
return data, status_code, headers
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
end
|
|
@@ -93,74 +93,6 @@ module Zernio
|
|
|
93
93
|
return data, status_code, headers
|
|
94
94
|
end
|
|
95
95
|
|
|
96
|
-
# Create an alphanumeric sender ID
|
|
97
|
-
# Registers an alphanumeric sender ID (e.g. `ZERNIO`) — a branded `from` for one-way international SMS. No phone number purchase or carrier registration is needed; once created, pass it as `from` on `POST /v1/sms/messages`. Constraints: 3-11 characters (letters, digits, spaces; at least one letter). Sends cannot reach the US, Canada, or Puerto Rico, are text-only, and recipients cannot reply. Sender IDs that impersonate well-known brands or institutions are rejected, and an ID already registered by another workspace returns 409 (active sender IDs are globally unique, first-come-first-served). Creating the same sender ID again is a no-op (re-activates it after a delete).
|
|
98
|
-
# @param create_sms_sender_id_request [CreateSmsSenderIdRequest]
|
|
99
|
-
# @param [Hash] opts the optional parameters
|
|
100
|
-
# @return [CreateSmsSenderId200Response]
|
|
101
|
-
def create_sms_sender_id(create_sms_sender_id_request, opts = {})
|
|
102
|
-
data, _status_code, _headers = create_sms_sender_id_with_http_info(create_sms_sender_id_request, opts)
|
|
103
|
-
data
|
|
104
|
-
end
|
|
105
|
-
|
|
106
|
-
# Create an alphanumeric sender ID
|
|
107
|
-
# Registers an alphanumeric sender ID (e.g. `ZERNIO`) — a branded `from` for one-way international SMS. No phone number purchase or carrier registration is needed; once created, pass it as `from` on `POST /v1/sms/messages`. Constraints: 3-11 characters (letters, digits, spaces; at least one letter). Sends cannot reach the US, Canada, or Puerto Rico, are text-only, and recipients cannot reply. Sender IDs that impersonate well-known brands or institutions are rejected, and an ID already registered by another workspace returns 409 (active sender IDs are globally unique, first-come-first-served). Creating the same sender ID again is a no-op (re-activates it after a delete).
|
|
108
|
-
# @param create_sms_sender_id_request [CreateSmsSenderIdRequest]
|
|
109
|
-
# @param [Hash] opts the optional parameters
|
|
110
|
-
# @return [Array<(CreateSmsSenderId200Response, Integer, Hash)>] CreateSmsSenderId200Response data, response status code and response headers
|
|
111
|
-
def create_sms_sender_id_with_http_info(create_sms_sender_id_request, opts = {})
|
|
112
|
-
if @api_client.config.debugging
|
|
113
|
-
@api_client.config.logger.debug 'Calling API: SMSApi.create_sms_sender_id ...'
|
|
114
|
-
end
|
|
115
|
-
# verify the required parameter 'create_sms_sender_id_request' is set
|
|
116
|
-
if @api_client.config.client_side_validation && create_sms_sender_id_request.nil?
|
|
117
|
-
fail ArgumentError, "Missing the required parameter 'create_sms_sender_id_request' when calling SMSApi.create_sms_sender_id"
|
|
118
|
-
end
|
|
119
|
-
# resource path
|
|
120
|
-
local_var_path = '/v1/sms/sender-ids'
|
|
121
|
-
|
|
122
|
-
# query parameters
|
|
123
|
-
query_params = opts[:query_params] || {}
|
|
124
|
-
|
|
125
|
-
# header parameters
|
|
126
|
-
header_params = opts[:header_params] || {}
|
|
127
|
-
# HTTP header 'Accept' (if needed)
|
|
128
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
129
|
-
# HTTP header 'Content-Type'
|
|
130
|
-
content_type = @api_client.select_header_content_type(['application/json'])
|
|
131
|
-
if !content_type.nil?
|
|
132
|
-
header_params['Content-Type'] = content_type
|
|
133
|
-
end
|
|
134
|
-
|
|
135
|
-
# form parameters
|
|
136
|
-
form_params = opts[:form_params] || {}
|
|
137
|
-
|
|
138
|
-
# http body (model)
|
|
139
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_sms_sender_id_request)
|
|
140
|
-
|
|
141
|
-
# return_type
|
|
142
|
-
return_type = opts[:debug_return_type] || 'CreateSmsSenderId200Response'
|
|
143
|
-
|
|
144
|
-
# auth_names
|
|
145
|
-
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
146
|
-
|
|
147
|
-
new_options = opts.merge(
|
|
148
|
-
:operation => :"SMSApi.create_sms_sender_id",
|
|
149
|
-
:header_params => header_params,
|
|
150
|
-
:query_params => query_params,
|
|
151
|
-
:form_params => form_params,
|
|
152
|
-
:body => post_body,
|
|
153
|
-
:auth_names => auth_names,
|
|
154
|
-
:return_type => return_type
|
|
155
|
-
)
|
|
156
|
-
|
|
157
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
158
|
-
if @api_client.config.debugging
|
|
159
|
-
@api_client.config.logger.debug "API called: SMSApi#create_sms_sender_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
160
|
-
end
|
|
161
|
-
return data, status_code, headers
|
|
162
|
-
end
|
|
163
|
-
|
|
164
96
|
# Deactivate a brand/campaign registration
|
|
165
97
|
# Terminates the campaign with the carrier registry so the recurring monthly campaign fee stops (carriers bill the first 3 months of a campaign regardless). Numbers covered by it can no longer SEND texts — receiving is unaffected — until they're registered under a new brand. Irreversible: a deactivated campaign cannot be restored; texting again later requires a new registration (new one-time and review fees). Idempotent.
|
|
166
98
|
# @param id [String]
|
|
@@ -224,69 +156,6 @@ module Zernio
|
|
|
224
156
|
return data, status_code, headers
|
|
225
157
|
end
|
|
226
158
|
|
|
227
|
-
# Delete an alphanumeric sender ID
|
|
228
|
-
# Deactivates the sender ID so it can no longer send. Re-creating the same sender ID via `POST /v1/sms/sender-ids` re-activates it.
|
|
229
|
-
# @param id [String] Sender ID resource id.
|
|
230
|
-
# @param [Hash] opts the optional parameters
|
|
231
|
-
# @return [DeleteSmsSenderId200Response]
|
|
232
|
-
def delete_sms_sender_id(id, opts = {})
|
|
233
|
-
data, _status_code, _headers = delete_sms_sender_id_with_http_info(id, opts)
|
|
234
|
-
data
|
|
235
|
-
end
|
|
236
|
-
|
|
237
|
-
# Delete an alphanumeric sender ID
|
|
238
|
-
# Deactivates the sender ID so it can no longer send. Re-creating the same sender ID via `POST /v1/sms/sender-ids` re-activates it.
|
|
239
|
-
# @param id [String] Sender ID resource id.
|
|
240
|
-
# @param [Hash] opts the optional parameters
|
|
241
|
-
# @return [Array<(DeleteSmsSenderId200Response, Integer, Hash)>] DeleteSmsSenderId200Response data, response status code and response headers
|
|
242
|
-
def delete_sms_sender_id_with_http_info(id, opts = {})
|
|
243
|
-
if @api_client.config.debugging
|
|
244
|
-
@api_client.config.logger.debug 'Calling API: SMSApi.delete_sms_sender_id ...'
|
|
245
|
-
end
|
|
246
|
-
# verify the required parameter 'id' is set
|
|
247
|
-
if @api_client.config.client_side_validation && id.nil?
|
|
248
|
-
fail ArgumentError, "Missing the required parameter 'id' when calling SMSApi.delete_sms_sender_id"
|
|
249
|
-
end
|
|
250
|
-
# resource path
|
|
251
|
-
local_var_path = '/v1/sms/sender-ids/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
|
252
|
-
|
|
253
|
-
# query parameters
|
|
254
|
-
query_params = opts[:query_params] || {}
|
|
255
|
-
|
|
256
|
-
# header parameters
|
|
257
|
-
header_params = opts[:header_params] || {}
|
|
258
|
-
# HTTP header 'Accept' (if needed)
|
|
259
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
260
|
-
|
|
261
|
-
# form parameters
|
|
262
|
-
form_params = opts[:form_params] || {}
|
|
263
|
-
|
|
264
|
-
# http body (model)
|
|
265
|
-
post_body = opts[:debug_body]
|
|
266
|
-
|
|
267
|
-
# return_type
|
|
268
|
-
return_type = opts[:debug_return_type] || 'DeleteSmsSenderId200Response'
|
|
269
|
-
|
|
270
|
-
# auth_names
|
|
271
|
-
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
272
|
-
|
|
273
|
-
new_options = opts.merge(
|
|
274
|
-
:operation => :"SMSApi.delete_sms_sender_id",
|
|
275
|
-
:header_params => header_params,
|
|
276
|
-
:query_params => query_params,
|
|
277
|
-
:form_params => form_params,
|
|
278
|
-
:body => post_body,
|
|
279
|
-
:auth_names => auth_names,
|
|
280
|
-
:return_type => return_type
|
|
281
|
-
)
|
|
282
|
-
|
|
283
|
-
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
|
284
|
-
if @api_client.config.debugging
|
|
285
|
-
@api_client.config.logger.debug "API called: SMSApi#delete_sms_sender_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
286
|
-
end
|
|
287
|
-
return data, status_code, headers
|
|
288
|
-
end
|
|
289
|
-
|
|
290
159
|
# Disable SMS on a number
|
|
291
160
|
# Turns off SMS for the number (deactivates its SMS account). The carrier registration is untouched, so re-enabling later just reactivates it, with no re-registration.
|
|
292
161
|
# @param id [String]
|
|
@@ -609,61 +478,6 @@ module Zernio
|
|
|
609
478
|
return data, status_code, headers
|
|
610
479
|
end
|
|
611
480
|
|
|
612
|
-
# List alphanumeric sender IDs
|
|
613
|
-
# @param [Hash] opts the optional parameters
|
|
614
|
-
# @return [ListSmsSenderIds200Response]
|
|
615
|
-
def list_sms_sender_ids(opts = {})
|
|
616
|
-
data, _status_code, _headers = list_sms_sender_ids_with_http_info(opts)
|
|
617
|
-
data
|
|
618
|
-
end
|
|
619
|
-
|
|
620
|
-
# List alphanumeric sender IDs
|
|
621
|
-
# @param [Hash] opts the optional parameters
|
|
622
|
-
# @return [Array<(ListSmsSenderIds200Response, Integer, Hash)>] ListSmsSenderIds200Response data, response status code and response headers
|
|
623
|
-
def list_sms_sender_ids_with_http_info(opts = {})
|
|
624
|
-
if @api_client.config.debugging
|
|
625
|
-
@api_client.config.logger.debug 'Calling API: SMSApi.list_sms_sender_ids ...'
|
|
626
|
-
end
|
|
627
|
-
# resource path
|
|
628
|
-
local_var_path = '/v1/sms/sender-ids'
|
|
629
|
-
|
|
630
|
-
# query parameters
|
|
631
|
-
query_params = opts[:query_params] || {}
|
|
632
|
-
|
|
633
|
-
# header parameters
|
|
634
|
-
header_params = opts[:header_params] || {}
|
|
635
|
-
# HTTP header 'Accept' (if needed)
|
|
636
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
637
|
-
|
|
638
|
-
# form parameters
|
|
639
|
-
form_params = opts[:form_params] || {}
|
|
640
|
-
|
|
641
|
-
# http body (model)
|
|
642
|
-
post_body = opts[:debug_body]
|
|
643
|
-
|
|
644
|
-
# return_type
|
|
645
|
-
return_type = opts[:debug_return_type] || 'ListSmsSenderIds200Response'
|
|
646
|
-
|
|
647
|
-
# auth_names
|
|
648
|
-
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
649
|
-
|
|
650
|
-
new_options = opts.merge(
|
|
651
|
-
:operation => :"SMSApi.list_sms_sender_ids",
|
|
652
|
-
:header_params => header_params,
|
|
653
|
-
:query_params => query_params,
|
|
654
|
-
:form_params => form_params,
|
|
655
|
-
:body => post_body,
|
|
656
|
-
:auth_names => auth_names,
|
|
657
|
-
:return_type => return_type
|
|
658
|
-
)
|
|
659
|
-
|
|
660
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
661
|
-
if @api_client.config.debugging
|
|
662
|
-
@api_client.config.logger.debug "API called: SMSApi#list_sms_sender_ids\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
663
|
-
end
|
|
664
|
-
return data, status_code, headers
|
|
665
|
-
end
|
|
666
|
-
|
|
667
481
|
# Look up carrier + line type
|
|
668
482
|
# Carrier name and line type (mobile / landline / voip / toll-free) for a number, plus `smsReachable` (landlines can't receive SMS). Use it to validate recipients before sending. Each lookup is billed by the carrier-data provider, so call it explicitly (e.g. pre-validating an opt-in list), not on every send.
|
|
669
483
|
# @param number [String] Number to look up (E.164; formatting is normalized).
|
|
@@ -732,74 +546,6 @@ module Zernio
|
|
|
732
546
|
return data, status_code, headers
|
|
733
547
|
end
|
|
734
548
|
|
|
735
|
-
# Request a higher sender ID daily limit
|
|
736
|
-
# Asks support to raise the workspace's daily sender-ID message cap. There is no self-serve raise: the request (desired cap + use case) is reviewed manually, usually within a business day.
|
|
737
|
-
# @param request_sms_sender_id_limit_increase_request [RequestSmsSenderIdLimitIncreaseRequest]
|
|
738
|
-
# @param [Hash] opts the optional parameters
|
|
739
|
-
# @return [RequestSmsSenderIdLimitIncrease200Response]
|
|
740
|
-
def request_sms_sender_id_limit_increase(request_sms_sender_id_limit_increase_request, opts = {})
|
|
741
|
-
data, _status_code, _headers = request_sms_sender_id_limit_increase_with_http_info(request_sms_sender_id_limit_increase_request, opts)
|
|
742
|
-
data
|
|
743
|
-
end
|
|
744
|
-
|
|
745
|
-
# Request a higher sender ID daily limit
|
|
746
|
-
# Asks support to raise the workspace's daily sender-ID message cap. There is no self-serve raise: the request (desired cap + use case) is reviewed manually, usually within a business day.
|
|
747
|
-
# @param request_sms_sender_id_limit_increase_request [RequestSmsSenderIdLimitIncreaseRequest]
|
|
748
|
-
# @param [Hash] opts the optional parameters
|
|
749
|
-
# @return [Array<(RequestSmsSenderIdLimitIncrease200Response, Integer, Hash)>] RequestSmsSenderIdLimitIncrease200Response data, response status code and response headers
|
|
750
|
-
def request_sms_sender_id_limit_increase_with_http_info(request_sms_sender_id_limit_increase_request, opts = {})
|
|
751
|
-
if @api_client.config.debugging
|
|
752
|
-
@api_client.config.logger.debug 'Calling API: SMSApi.request_sms_sender_id_limit_increase ...'
|
|
753
|
-
end
|
|
754
|
-
# verify the required parameter 'request_sms_sender_id_limit_increase_request' is set
|
|
755
|
-
if @api_client.config.client_side_validation && request_sms_sender_id_limit_increase_request.nil?
|
|
756
|
-
fail ArgumentError, "Missing the required parameter 'request_sms_sender_id_limit_increase_request' when calling SMSApi.request_sms_sender_id_limit_increase"
|
|
757
|
-
end
|
|
758
|
-
# resource path
|
|
759
|
-
local_var_path = '/v1/sms/sender-ids/limit-request'
|
|
760
|
-
|
|
761
|
-
# query parameters
|
|
762
|
-
query_params = opts[:query_params] || {}
|
|
763
|
-
|
|
764
|
-
# header parameters
|
|
765
|
-
header_params = opts[:header_params] || {}
|
|
766
|
-
# HTTP header 'Accept' (if needed)
|
|
767
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
768
|
-
# HTTP header 'Content-Type'
|
|
769
|
-
content_type = @api_client.select_header_content_type(['application/json'])
|
|
770
|
-
if !content_type.nil?
|
|
771
|
-
header_params['Content-Type'] = content_type
|
|
772
|
-
end
|
|
773
|
-
|
|
774
|
-
# form parameters
|
|
775
|
-
form_params = opts[:form_params] || {}
|
|
776
|
-
|
|
777
|
-
# http body (model)
|
|
778
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(request_sms_sender_id_limit_increase_request)
|
|
779
|
-
|
|
780
|
-
# return_type
|
|
781
|
-
return_type = opts[:debug_return_type] || 'RequestSmsSenderIdLimitIncrease200Response'
|
|
782
|
-
|
|
783
|
-
# auth_names
|
|
784
|
-
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
|
785
|
-
|
|
786
|
-
new_options = opts.merge(
|
|
787
|
-
:operation => :"SMSApi.request_sms_sender_id_limit_increase",
|
|
788
|
-
:header_params => header_params,
|
|
789
|
-
:query_params => query_params,
|
|
790
|
-
:form_params => form_params,
|
|
791
|
-
:body => post_body,
|
|
792
|
-
:auth_names => auth_names,
|
|
793
|
-
:return_type => return_type
|
|
794
|
-
)
|
|
795
|
-
|
|
796
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
797
|
-
if @api_client.config.debugging
|
|
798
|
-
@api_client.config.logger.debug "API called: SMSApi#request_sms_sender_id_limit_increase\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
799
|
-
end
|
|
800
|
-
return data, status_code, headers
|
|
801
|
-
end
|
|
802
|
-
|
|
803
549
|
# Re-send the sole-prop OTP
|
|
804
550
|
# Re-sends the sole-proprietor verification PIN to the brand's mobile number — use it when the original code expired or never arrived. Only valid while the registration is pending and awaiting its OTP; rate limited to one send per minute.
|
|
805
551
|
# @param id [String]
|
|
@@ -927,7 +673,7 @@ module Zernio
|
|
|
927
673
|
end
|
|
928
674
|
|
|
929
675
|
# Send an SMS/MMS
|
|
930
|
-
# Sends an SMS (or MMS when `mediaUrls` is set) from one of your SMS-enabled numbers
|
|
676
|
+
# Sends an SMS (or MMS when `mediaUrls` is set) from one of your SMS-enabled numbers. At least one of `text` / `mediaUrls` is required. Both numbers are normalized to E.164, so `from` matches regardless of formatting and replies thread into the same inbox conversation. US numbers must have an approved carrier registration (`/v1/sms/registrations`) before messages deliver. **Idempotency:** send an `Idempotency-Key` header to make retries safe: same key + same body replays the original response instead of sending a second message; same key + different body returns 422; a key still in flight returns 409.
|
|
931
677
|
# @param send_sms_request [SendSmsRequest]
|
|
932
678
|
# @param [Hash] opts the optional parameters
|
|
933
679
|
# @option opts [String] :idempotency_key Optional client-generated unique key (e.g. a UUID) that makes send retries safe. Same key + same body replays the original response; same key + different body → 422; key still processing → 409.
|
|
@@ -938,7 +684,7 @@ module Zernio
|
|
|
938
684
|
end
|
|
939
685
|
|
|
940
686
|
# Send an SMS/MMS
|
|
941
|
-
# Sends an SMS (or MMS when `mediaUrls` is set) from one of your SMS-enabled numbers
|
|
687
|
+
# Sends an SMS (or MMS when `mediaUrls` is set) from one of your SMS-enabled numbers. At least one of `text` / `mediaUrls` is required. Both numbers are normalized to E.164, so `from` matches regardless of formatting and replies thread into the same inbox conversation. US numbers must have an approved carrier registration (`/v1/sms/registrations`) before messages deliver. **Idempotency:** send an `Idempotency-Key` header to make retries safe: same key + same body replays the original response instead of sending a second message; same key + different body returns 422; a key still in flight returns 409.
|
|
942
688
|
# @param send_sms_request [SendSmsRequest]
|
|
943
689
|
# @param [Hash] opts the optional parameters
|
|
944
690
|
# @option opts [String] :idempotency_key Optional client-generated unique key (e.g. a UUID) that makes send retries safe. Same key + same body replays the original response; same key + different body → 422; key still processing → 409.
|
|
@@ -18,7 +18,7 @@ module Zernio
|
|
|
18
18
|
# Attachment type (image, video, file, sticker, audio)
|
|
19
19
|
attr_accessor :type
|
|
20
20
|
|
|
21
|
-
#
|
|
21
|
+
# Where to fetch the attachment. The contract depends on direction and platform: inbound WhatsApp media points at the authenticated `GET /v1/whatsapp/media/{mediaId}` and requires `Authorization: Bearer <your API key>`, while outgoing media carries the URL originally supplied and Instagram / Facebook / Telegram carry direct platform CDN links that need no authentication.
|
|
22
22
|
attr_accessor :url
|
|
23
23
|
|
|
24
24
|
# Additional attachment metadata
|
|
@@ -15,7 +15,7 @@ require 'time'
|
|
|
15
15
|
|
|
16
16
|
module Zernio
|
|
17
17
|
class SendSmsRequest < ApiModelBase
|
|
18
|
-
# One of your SMS-enabled numbers (E.164; formatting is normalized)
|
|
18
|
+
# One of your SMS-enabled numbers (E.164; formatting is normalized).
|
|
19
19
|
attr_accessor :from
|
|
20
20
|
|
|
21
21
|
# Recipient number (E.164).
|
|
@@ -96,7 +96,7 @@ module Zernio
|
|
|
96
96
|
:'platform_message_id' => :'String',
|
|
97
97
|
:'direction' => :'String',
|
|
98
98
|
:'text' => :'String',
|
|
99
|
-
:'attachments' => :'Array<
|
|
99
|
+
:'attachments' => :'Array<WebhookPayloadMessageMessageAttachmentsInner>',
|
|
100
100
|
:'sender' => :'WebhookPayloadMessageMessageSender',
|
|
101
101
|
:'sent_at' => :'Time',
|
|
102
102
|
:'is_read' => :'Boolean'
|
|
@@ -14,14 +14,22 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module Zernio
|
|
17
|
-
class
|
|
18
|
-
#
|
|
19
|
-
attr_accessor :
|
|
17
|
+
class WebhookPayloadMessageMessageAttachmentsInner < ApiModelBase
|
|
18
|
+
# Attachment type (image, video, file, sticker, audio)
|
|
19
|
+
attr_accessor :type
|
|
20
|
+
|
|
21
|
+
# Where to fetch the attachment. **The contract differs by platform.** - **WhatsApp**: points at `GET /v1/whatsapp/media/{mediaId}`, an authenticated Zernio endpoint. You MUST send `Authorization: Bearer <your API key>`; fetching it without that header returns `401`. Download and store the bytes when this webhook arrives: Meta drops inbound media after a limited retention window, after which the endpoint answers `400` permanently and the media is unrecoverable. - **Instagram / Facebook / Telegram**: a direct platform CDN link that needs no authentication and expires on the platform's own schedule.
|
|
22
|
+
attr_accessor :url
|
|
23
|
+
|
|
24
|
+
# Additional attachment metadata
|
|
25
|
+
attr_accessor :payload
|
|
20
26
|
|
|
21
27
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
22
28
|
def self.attribute_map
|
|
23
29
|
{
|
|
24
|
-
:'
|
|
30
|
+
:'type' => :'type',
|
|
31
|
+
:'url' => :'url',
|
|
32
|
+
:'payload' => :'payload'
|
|
25
33
|
}
|
|
26
34
|
end
|
|
27
35
|
|
|
@@ -38,7 +46,9 @@ module Zernio
|
|
|
38
46
|
# Attribute type mapping.
|
|
39
47
|
def self.openapi_types
|
|
40
48
|
{
|
|
41
|
-
:'
|
|
49
|
+
:'type' => :'String',
|
|
50
|
+
:'url' => :'String',
|
|
51
|
+
:'payload' => :'Object'
|
|
42
52
|
}
|
|
43
53
|
end
|
|
44
54
|
|
|
@@ -52,22 +62,32 @@ module Zernio
|
|
|
52
62
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
53
63
|
def initialize(attributes = {})
|
|
54
64
|
if (!attributes.is_a?(Hash))
|
|
55
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::
|
|
65
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::WebhookPayloadMessageMessageAttachmentsInner` initialize method"
|
|
56
66
|
end
|
|
57
67
|
|
|
58
68
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
59
69
|
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
60
70
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
61
71
|
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
62
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::
|
|
72
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::WebhookPayloadMessageMessageAttachmentsInner`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
63
73
|
end
|
|
64
74
|
h[k.to_sym] = v
|
|
65
75
|
}
|
|
66
76
|
|
|
67
|
-
if attributes.key?(:'
|
|
68
|
-
self.
|
|
77
|
+
if attributes.key?(:'type')
|
|
78
|
+
self.type = attributes[:'type']
|
|
79
|
+
else
|
|
80
|
+
self.type = nil
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
if attributes.key?(:'url')
|
|
84
|
+
self.url = attributes[:'url']
|
|
69
85
|
else
|
|
70
|
-
self.
|
|
86
|
+
self.url = nil
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
if attributes.key?(:'payload')
|
|
90
|
+
self.payload = attributes[:'payload']
|
|
71
91
|
end
|
|
72
92
|
end
|
|
73
93
|
|
|
@@ -76,16 +96,12 @@ module Zernio
|
|
|
76
96
|
def list_invalid_properties
|
|
77
97
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
78
98
|
invalid_properties = Array.new
|
|
79
|
-
if @
|
|
80
|
-
invalid_properties.push('invalid value for "
|
|
81
|
-
end
|
|
82
|
-
|
|
83
|
-
if @sender_id.to_s.length > 11
|
|
84
|
-
invalid_properties.push('invalid value for "sender_id", the character length must be smaller than or equal to 11.')
|
|
99
|
+
if @type.nil?
|
|
100
|
+
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
|
85
101
|
end
|
|
86
102
|
|
|
87
|
-
if @
|
|
88
|
-
invalid_properties.push('invalid value for "
|
|
103
|
+
if @url.nil?
|
|
104
|
+
invalid_properties.push('invalid value for "url", url cannot be nil.')
|
|
89
105
|
end
|
|
90
106
|
|
|
91
107
|
invalid_properties
|
|
@@ -95,28 +111,29 @@ module Zernio
|
|
|
95
111
|
# @return true if the model is valid
|
|
96
112
|
def valid?
|
|
97
113
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
98
|
-
return false if @
|
|
99
|
-
return false if @
|
|
100
|
-
return false if @sender_id.to_s.length < 3
|
|
114
|
+
return false if @type.nil?
|
|
115
|
+
return false if @url.nil?
|
|
101
116
|
true
|
|
102
117
|
end
|
|
103
118
|
|
|
104
119
|
# Custom attribute writer method with validation
|
|
105
|
-
# @param [Object]
|
|
106
|
-
def
|
|
107
|
-
if
|
|
108
|
-
fail ArgumentError, '
|
|
120
|
+
# @param [Object] type Value to be assigned
|
|
121
|
+
def type=(type)
|
|
122
|
+
if type.nil?
|
|
123
|
+
fail ArgumentError, 'type cannot be nil'
|
|
109
124
|
end
|
|
110
125
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
end
|
|
126
|
+
@type = type
|
|
127
|
+
end
|
|
114
128
|
|
|
115
|
-
|
|
116
|
-
|
|
129
|
+
# Custom attribute writer method with validation
|
|
130
|
+
# @param [Object] url Value to be assigned
|
|
131
|
+
def url=(url)
|
|
132
|
+
if url.nil?
|
|
133
|
+
fail ArgumentError, 'url cannot be nil'
|
|
117
134
|
end
|
|
118
135
|
|
|
119
|
-
@
|
|
136
|
+
@url = url
|
|
120
137
|
end
|
|
121
138
|
|
|
122
139
|
# Checks equality by comparing each attribute.
|
|
@@ -124,7 +141,9 @@ module Zernio
|
|
|
124
141
|
def ==(o)
|
|
125
142
|
return true if self.equal?(o)
|
|
126
143
|
self.class == o.class &&
|
|
127
|
-
|
|
144
|
+
type == o.type &&
|
|
145
|
+
url == o.url &&
|
|
146
|
+
payload == o.payload
|
|
128
147
|
end
|
|
129
148
|
|
|
130
149
|
# @see the `==` method
|
|
@@ -136,7 +155,7 @@ module Zernio
|
|
|
136
155
|
# Calculates hash code according to all attributes.
|
|
137
156
|
# @return [Integer] Hash code
|
|
138
157
|
def hash
|
|
139
|
-
[
|
|
158
|
+
[type, url, payload].hash
|
|
140
159
|
end
|
|
141
160
|
|
|
142
161
|
# Builds the object from hash
|
|
@@ -96,7 +96,7 @@ module Zernio
|
|
|
96
96
|
:'platform_message_id' => :'String',
|
|
97
97
|
:'direction' => :'String',
|
|
98
98
|
:'text' => :'String',
|
|
99
|
-
:'attachments' => :'Array<
|
|
99
|
+
:'attachments' => :'Array<WebhookPayloadMessageSentMessageAttachmentsInner>',
|
|
100
100
|
:'sender' => :'WebhookPayloadMessageSentMessageSender',
|
|
101
101
|
:'sent_at' => :'Time',
|
|
102
102
|
:'is_read' => :'Boolean'
|