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
data/docs/InboxApi.md
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Zernio::InboxApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://zernio.com/api*
|
|
4
|
+
|
|
5
|
+
| Method | HTTP request | Description |
|
|
6
|
+
| ------ | ------------ | ----------- |
|
|
7
|
+
| [**get_whats_app_media**](InboxApi.md#get_whats_app_media) | **GET** /v1/whatsapp/media/{mediaId} | Download WhatsApp media |
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## get_whats_app_media
|
|
11
|
+
|
|
12
|
+
> File get_whats_app_media(media_id, account_id)
|
|
13
|
+
|
|
14
|
+
Download WhatsApp media
|
|
15
|
+
|
|
16
|
+
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.
|
|
17
|
+
|
|
18
|
+
### Examples
|
|
19
|
+
|
|
20
|
+
```ruby
|
|
21
|
+
require 'time'
|
|
22
|
+
require 'zernio-sdk'
|
|
23
|
+
# setup authorization
|
|
24
|
+
Zernio.configure do |config|
|
|
25
|
+
# Configure Bearer authorization (JWT): bearerAuth
|
|
26
|
+
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
api_instance = Zernio::InboxApi.new
|
|
30
|
+
media_id = 'media_id_example' # String | The media id from `attachments[].payload.id`.
|
|
31
|
+
account_id = 'account_id_example' # String | The WhatsApp account that received the media.
|
|
32
|
+
|
|
33
|
+
begin
|
|
34
|
+
# Download WhatsApp media
|
|
35
|
+
result = api_instance.get_whats_app_media(media_id, account_id)
|
|
36
|
+
p result
|
|
37
|
+
rescue Zernio::ApiError => e
|
|
38
|
+
puts "Error when calling InboxApi->get_whats_app_media: #{e}"
|
|
39
|
+
end
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
#### Using the get_whats_app_media_with_http_info variant
|
|
43
|
+
|
|
44
|
+
This returns an Array which contains the response data, status code and headers.
|
|
45
|
+
|
|
46
|
+
> <Array(File, Integer, Hash)> get_whats_app_media_with_http_info(media_id, account_id)
|
|
47
|
+
|
|
48
|
+
```ruby
|
|
49
|
+
begin
|
|
50
|
+
# Download WhatsApp media
|
|
51
|
+
data, status_code, headers = api_instance.get_whats_app_media_with_http_info(media_id, account_id)
|
|
52
|
+
p status_code # => 2xx
|
|
53
|
+
p headers # => { ... }
|
|
54
|
+
p data # => File
|
|
55
|
+
rescue Zernio::ApiError => e
|
|
56
|
+
puts "Error when calling InboxApi->get_whats_app_media_with_http_info: #{e}"
|
|
57
|
+
end
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Parameters
|
|
61
|
+
|
|
62
|
+
| Name | Type | Description | Notes |
|
|
63
|
+
| ---- | ---- | ----------- | ----- |
|
|
64
|
+
| **media_id** | **String** | The media id from `attachments[].payload.id`. | |
|
|
65
|
+
| **account_id** | **String** | The WhatsApp account that received the media. | |
|
|
66
|
+
|
|
67
|
+
### Return type
|
|
68
|
+
|
|
69
|
+
**File**
|
|
70
|
+
|
|
71
|
+
### Authorization
|
|
72
|
+
|
|
73
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
74
|
+
|
|
75
|
+
### HTTP request headers
|
|
76
|
+
|
|
77
|
+
- **Content-Type**: Not defined
|
|
78
|
+
- **Accept**: application/octet-stream, application/json
|
|
79
|
+
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
7
|
| **type** | **String** | Attachment type (image, video, file, sticker, audio) | |
|
|
8
|
-
| **url** | **String** |
|
|
8
|
+
| **url** | **String** | 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. | |
|
|
9
9
|
| **payload** | **Object** | Additional attachment metadata | [optional] |
|
|
10
10
|
|
|
11
11
|
## Example
|
data/docs/SMSApi.md
CHANGED
|
@@ -5,17 +5,13 @@ All URIs are relative to *https://zernio.com/api*
|
|
|
5
5
|
| Method | HTTP request | Description |
|
|
6
6
|
| ------ | ------------ | ----------- |
|
|
7
7
|
| [**appeal_sms_registration**](SMSApi.md#appeal_sms_registration) | **POST** /v1/sms/registrations/{id}/appeal | Appeal a rejected campaign |
|
|
8
|
-
| [**create_sms_sender_id**](SMSApi.md#create_sms_sender_id) | **POST** /v1/sms/sender-ids | Create an alphanumeric sender ID |
|
|
9
8
|
| [**deactivate_sms_registration**](SMSApi.md#deactivate_sms_registration) | **DELETE** /v1/sms/registrations/{id} | Deactivate a brand/campaign registration |
|
|
10
|
-
| [**delete_sms_sender_id**](SMSApi.md#delete_sms_sender_id) | **DELETE** /v1/sms/sender-ids/{id} | Delete an alphanumeric sender ID |
|
|
11
9
|
| [**disable_sms_on_number**](SMSApi.md#disable_sms_on_number) | **DELETE** /v1/phone-numbers/{id}/sms | Disable SMS on a number |
|
|
12
10
|
| [**enable_sms_on_number**](SMSApi.md#enable_sms_on_number) | **POST** /v1/phone-numbers/{id}/sms | Enable SMS on a number |
|
|
13
11
|
| [**get_sms_registration**](SMSApi.md#get_sms_registration) | **GET** /v1/sms/registrations/{id} | Get a carrier registration |
|
|
14
12
|
| [**list_sms_opt_outs**](SMSApi.md#list_sms_opt_outs) | **GET** /v1/sms/opt-outs | List SMS opt-outs |
|
|
15
13
|
| [**list_sms_registrations**](SMSApi.md#list_sms_registrations) | **GET** /v1/sms/registrations | List carrier registrations |
|
|
16
|
-
| [**list_sms_sender_ids**](SMSApi.md#list_sms_sender_ids) | **GET** /v1/sms/sender-ids | List alphanumeric sender IDs |
|
|
17
14
|
| [**lookup_sms_number**](SMSApi.md#lookup_sms_number) | **GET** /v1/sms/lookup | Look up carrier + line type |
|
|
18
|
-
| [**request_sms_sender_id_limit_increase**](SMSApi.md#request_sms_sender_id_limit_increase) | **POST** /v1/sms/sender-ids/limit-request | Request a higher sender ID daily limit |
|
|
19
15
|
| [**resend_sms_registration_otp**](SMSApi.md#resend_sms_registration_otp) | **POST** /v1/sms/registrations/{id}/resend-otp | Re-send the sole-prop OTP |
|
|
20
16
|
| [**reuse_sms_registration_for_number**](SMSApi.md#reuse_sms_registration_for_number) | **POST** /v1/phone-numbers/{id}/sms/reuse-registration | Add number to SMS registration |
|
|
21
17
|
| [**send_sms**](SMSApi.md#send_sms) | **POST** /v1/sms/messages | Send an SMS/MMS |
|
|
@@ -97,75 +93,6 @@ end
|
|
|
97
93
|
- **Accept**: application/json
|
|
98
94
|
|
|
99
95
|
|
|
100
|
-
## create_sms_sender_id
|
|
101
|
-
|
|
102
|
-
> <CreateSmsSenderId200Response> create_sms_sender_id(create_sms_sender_id_request)
|
|
103
|
-
|
|
104
|
-
Create an alphanumeric sender ID
|
|
105
|
-
|
|
106
|
-
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).
|
|
107
|
-
|
|
108
|
-
### Examples
|
|
109
|
-
|
|
110
|
-
```ruby
|
|
111
|
-
require 'time'
|
|
112
|
-
require 'zernio-sdk'
|
|
113
|
-
# setup authorization
|
|
114
|
-
Zernio.configure do |config|
|
|
115
|
-
# Configure Bearer authorization (JWT): bearerAuth
|
|
116
|
-
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
117
|
-
end
|
|
118
|
-
|
|
119
|
-
api_instance = Zernio::SMSApi.new
|
|
120
|
-
create_sms_sender_id_request = Zernio::CreateSmsSenderIdRequest.new({sender_id: 'sender_id_example'}) # CreateSmsSenderIdRequest |
|
|
121
|
-
|
|
122
|
-
begin
|
|
123
|
-
# Create an alphanumeric sender ID
|
|
124
|
-
result = api_instance.create_sms_sender_id(create_sms_sender_id_request)
|
|
125
|
-
p result
|
|
126
|
-
rescue Zernio::ApiError => e
|
|
127
|
-
puts "Error when calling SMSApi->create_sms_sender_id: #{e}"
|
|
128
|
-
end
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
#### Using the create_sms_sender_id_with_http_info variant
|
|
132
|
-
|
|
133
|
-
This returns an Array which contains the response data, status code and headers.
|
|
134
|
-
|
|
135
|
-
> <Array(<CreateSmsSenderId200Response>, Integer, Hash)> create_sms_sender_id_with_http_info(create_sms_sender_id_request)
|
|
136
|
-
|
|
137
|
-
```ruby
|
|
138
|
-
begin
|
|
139
|
-
# Create an alphanumeric sender ID
|
|
140
|
-
data, status_code, headers = api_instance.create_sms_sender_id_with_http_info(create_sms_sender_id_request)
|
|
141
|
-
p status_code # => 2xx
|
|
142
|
-
p headers # => { ... }
|
|
143
|
-
p data # => <CreateSmsSenderId200Response>
|
|
144
|
-
rescue Zernio::ApiError => e
|
|
145
|
-
puts "Error when calling SMSApi->create_sms_sender_id_with_http_info: #{e}"
|
|
146
|
-
end
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
### Parameters
|
|
150
|
-
|
|
151
|
-
| Name | Type | Description | Notes |
|
|
152
|
-
| ---- | ---- | ----------- | ----- |
|
|
153
|
-
| **create_sms_sender_id_request** | [**CreateSmsSenderIdRequest**](CreateSmsSenderIdRequest.md) | | |
|
|
154
|
-
|
|
155
|
-
### Return type
|
|
156
|
-
|
|
157
|
-
[**CreateSmsSenderId200Response**](CreateSmsSenderId200Response.md)
|
|
158
|
-
|
|
159
|
-
### Authorization
|
|
160
|
-
|
|
161
|
-
[bearerAuth](../README.md#bearerAuth)
|
|
162
|
-
|
|
163
|
-
### HTTP request headers
|
|
164
|
-
|
|
165
|
-
- **Content-Type**: application/json
|
|
166
|
-
- **Accept**: application/json
|
|
167
|
-
|
|
168
|
-
|
|
169
96
|
## deactivate_sms_registration
|
|
170
97
|
|
|
171
98
|
> <DeactivateSmsRegistration200Response> deactivate_sms_registration(id)
|
|
@@ -235,75 +162,6 @@ end
|
|
|
235
162
|
- **Accept**: application/json
|
|
236
163
|
|
|
237
164
|
|
|
238
|
-
## delete_sms_sender_id
|
|
239
|
-
|
|
240
|
-
> <DeleteSmsSenderId200Response> delete_sms_sender_id(id)
|
|
241
|
-
|
|
242
|
-
Delete an alphanumeric sender ID
|
|
243
|
-
|
|
244
|
-
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.
|
|
245
|
-
|
|
246
|
-
### Examples
|
|
247
|
-
|
|
248
|
-
```ruby
|
|
249
|
-
require 'time'
|
|
250
|
-
require 'zernio-sdk'
|
|
251
|
-
# setup authorization
|
|
252
|
-
Zernio.configure do |config|
|
|
253
|
-
# Configure Bearer authorization (JWT): bearerAuth
|
|
254
|
-
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
255
|
-
end
|
|
256
|
-
|
|
257
|
-
api_instance = Zernio::SMSApi.new
|
|
258
|
-
id = 'id_example' # String | Sender ID resource id.
|
|
259
|
-
|
|
260
|
-
begin
|
|
261
|
-
# Delete an alphanumeric sender ID
|
|
262
|
-
result = api_instance.delete_sms_sender_id(id)
|
|
263
|
-
p result
|
|
264
|
-
rescue Zernio::ApiError => e
|
|
265
|
-
puts "Error when calling SMSApi->delete_sms_sender_id: #{e}"
|
|
266
|
-
end
|
|
267
|
-
```
|
|
268
|
-
|
|
269
|
-
#### Using the delete_sms_sender_id_with_http_info variant
|
|
270
|
-
|
|
271
|
-
This returns an Array which contains the response data, status code and headers.
|
|
272
|
-
|
|
273
|
-
> <Array(<DeleteSmsSenderId200Response>, Integer, Hash)> delete_sms_sender_id_with_http_info(id)
|
|
274
|
-
|
|
275
|
-
```ruby
|
|
276
|
-
begin
|
|
277
|
-
# Delete an alphanumeric sender ID
|
|
278
|
-
data, status_code, headers = api_instance.delete_sms_sender_id_with_http_info(id)
|
|
279
|
-
p status_code # => 2xx
|
|
280
|
-
p headers # => { ... }
|
|
281
|
-
p data # => <DeleteSmsSenderId200Response>
|
|
282
|
-
rescue Zernio::ApiError => e
|
|
283
|
-
puts "Error when calling SMSApi->delete_sms_sender_id_with_http_info: #{e}"
|
|
284
|
-
end
|
|
285
|
-
```
|
|
286
|
-
|
|
287
|
-
### Parameters
|
|
288
|
-
|
|
289
|
-
| Name | Type | Description | Notes |
|
|
290
|
-
| ---- | ---- | ----------- | ----- |
|
|
291
|
-
| **id** | **String** | Sender ID resource id. | |
|
|
292
|
-
|
|
293
|
-
### Return type
|
|
294
|
-
|
|
295
|
-
[**DeleteSmsSenderId200Response**](DeleteSmsSenderId200Response.md)
|
|
296
|
-
|
|
297
|
-
### Authorization
|
|
298
|
-
|
|
299
|
-
[bearerAuth](../README.md#bearerAuth)
|
|
300
|
-
|
|
301
|
-
### HTTP request headers
|
|
302
|
-
|
|
303
|
-
- **Content-Type**: Not defined
|
|
304
|
-
- **Accept**: application/json
|
|
305
|
-
|
|
306
|
-
|
|
307
165
|
## disable_sms_on_number
|
|
308
166
|
|
|
309
167
|
> <DisableSmsOnNumber200Response> disable_sms_on_number(id)
|
|
@@ -653,70 +511,6 @@ end
|
|
|
653
511
|
- **Accept**: application/json
|
|
654
512
|
|
|
655
513
|
|
|
656
|
-
## list_sms_sender_ids
|
|
657
|
-
|
|
658
|
-
> <ListSmsSenderIds200Response> list_sms_sender_ids
|
|
659
|
-
|
|
660
|
-
List alphanumeric sender IDs
|
|
661
|
-
|
|
662
|
-
### Examples
|
|
663
|
-
|
|
664
|
-
```ruby
|
|
665
|
-
require 'time'
|
|
666
|
-
require 'zernio-sdk'
|
|
667
|
-
# setup authorization
|
|
668
|
-
Zernio.configure do |config|
|
|
669
|
-
# Configure Bearer authorization (JWT): bearerAuth
|
|
670
|
-
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
671
|
-
end
|
|
672
|
-
|
|
673
|
-
api_instance = Zernio::SMSApi.new
|
|
674
|
-
|
|
675
|
-
begin
|
|
676
|
-
# List alphanumeric sender IDs
|
|
677
|
-
result = api_instance.list_sms_sender_ids
|
|
678
|
-
p result
|
|
679
|
-
rescue Zernio::ApiError => e
|
|
680
|
-
puts "Error when calling SMSApi->list_sms_sender_ids: #{e}"
|
|
681
|
-
end
|
|
682
|
-
```
|
|
683
|
-
|
|
684
|
-
#### Using the list_sms_sender_ids_with_http_info variant
|
|
685
|
-
|
|
686
|
-
This returns an Array which contains the response data, status code and headers.
|
|
687
|
-
|
|
688
|
-
> <Array(<ListSmsSenderIds200Response>, Integer, Hash)> list_sms_sender_ids_with_http_info
|
|
689
|
-
|
|
690
|
-
```ruby
|
|
691
|
-
begin
|
|
692
|
-
# List alphanumeric sender IDs
|
|
693
|
-
data, status_code, headers = api_instance.list_sms_sender_ids_with_http_info
|
|
694
|
-
p status_code # => 2xx
|
|
695
|
-
p headers # => { ... }
|
|
696
|
-
p data # => <ListSmsSenderIds200Response>
|
|
697
|
-
rescue Zernio::ApiError => e
|
|
698
|
-
puts "Error when calling SMSApi->list_sms_sender_ids_with_http_info: #{e}"
|
|
699
|
-
end
|
|
700
|
-
```
|
|
701
|
-
|
|
702
|
-
### Parameters
|
|
703
|
-
|
|
704
|
-
This endpoint does not need any parameter.
|
|
705
|
-
|
|
706
|
-
### Return type
|
|
707
|
-
|
|
708
|
-
[**ListSmsSenderIds200Response**](ListSmsSenderIds200Response.md)
|
|
709
|
-
|
|
710
|
-
### Authorization
|
|
711
|
-
|
|
712
|
-
[bearerAuth](../README.md#bearerAuth)
|
|
713
|
-
|
|
714
|
-
### HTTP request headers
|
|
715
|
-
|
|
716
|
-
- **Content-Type**: Not defined
|
|
717
|
-
- **Accept**: application/json
|
|
718
|
-
|
|
719
|
-
|
|
720
514
|
## lookup_sms_number
|
|
721
515
|
|
|
722
516
|
> <LookupSmsNumber200Response> lookup_sms_number(number)
|
|
@@ -786,75 +580,6 @@ end
|
|
|
786
580
|
- **Accept**: application/json
|
|
787
581
|
|
|
788
582
|
|
|
789
|
-
## request_sms_sender_id_limit_increase
|
|
790
|
-
|
|
791
|
-
> <RequestSmsSenderIdLimitIncrease200Response> request_sms_sender_id_limit_increase(request_sms_sender_id_limit_increase_request)
|
|
792
|
-
|
|
793
|
-
Request a higher sender ID daily limit
|
|
794
|
-
|
|
795
|
-
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.
|
|
796
|
-
|
|
797
|
-
### Examples
|
|
798
|
-
|
|
799
|
-
```ruby
|
|
800
|
-
require 'time'
|
|
801
|
-
require 'zernio-sdk'
|
|
802
|
-
# setup authorization
|
|
803
|
-
Zernio.configure do |config|
|
|
804
|
-
# Configure Bearer authorization (JWT): bearerAuth
|
|
805
|
-
config.access_token = 'YOUR_BEARER_TOKEN'
|
|
806
|
-
end
|
|
807
|
-
|
|
808
|
-
api_instance = Zernio::SMSApi.new
|
|
809
|
-
request_sms_sender_id_limit_increase_request = Zernio::RequestSmsSenderIdLimitIncreaseRequest.new({requested_cap: 37, reason: 'reason_example'}) # RequestSmsSenderIdLimitIncreaseRequest |
|
|
810
|
-
|
|
811
|
-
begin
|
|
812
|
-
# Request a higher sender ID daily limit
|
|
813
|
-
result = api_instance.request_sms_sender_id_limit_increase(request_sms_sender_id_limit_increase_request)
|
|
814
|
-
p result
|
|
815
|
-
rescue Zernio::ApiError => e
|
|
816
|
-
puts "Error when calling SMSApi->request_sms_sender_id_limit_increase: #{e}"
|
|
817
|
-
end
|
|
818
|
-
```
|
|
819
|
-
|
|
820
|
-
#### Using the request_sms_sender_id_limit_increase_with_http_info variant
|
|
821
|
-
|
|
822
|
-
This returns an Array which contains the response data, status code and headers.
|
|
823
|
-
|
|
824
|
-
> <Array(<RequestSmsSenderIdLimitIncrease200Response>, Integer, Hash)> request_sms_sender_id_limit_increase_with_http_info(request_sms_sender_id_limit_increase_request)
|
|
825
|
-
|
|
826
|
-
```ruby
|
|
827
|
-
begin
|
|
828
|
-
# Request a higher sender ID daily limit
|
|
829
|
-
data, status_code, headers = api_instance.request_sms_sender_id_limit_increase_with_http_info(request_sms_sender_id_limit_increase_request)
|
|
830
|
-
p status_code # => 2xx
|
|
831
|
-
p headers # => { ... }
|
|
832
|
-
p data # => <RequestSmsSenderIdLimitIncrease200Response>
|
|
833
|
-
rescue Zernio::ApiError => e
|
|
834
|
-
puts "Error when calling SMSApi->request_sms_sender_id_limit_increase_with_http_info: #{e}"
|
|
835
|
-
end
|
|
836
|
-
```
|
|
837
|
-
|
|
838
|
-
### Parameters
|
|
839
|
-
|
|
840
|
-
| Name | Type | Description | Notes |
|
|
841
|
-
| ---- | ---- | ----------- | ----- |
|
|
842
|
-
| **request_sms_sender_id_limit_increase_request** | [**RequestSmsSenderIdLimitIncreaseRequest**](RequestSmsSenderIdLimitIncreaseRequest.md) | | |
|
|
843
|
-
|
|
844
|
-
### Return type
|
|
845
|
-
|
|
846
|
-
[**RequestSmsSenderIdLimitIncrease200Response**](RequestSmsSenderIdLimitIncrease200Response.md)
|
|
847
|
-
|
|
848
|
-
### Authorization
|
|
849
|
-
|
|
850
|
-
[bearerAuth](../README.md#bearerAuth)
|
|
851
|
-
|
|
852
|
-
### HTTP request headers
|
|
853
|
-
|
|
854
|
-
- **Content-Type**: application/json
|
|
855
|
-
- **Accept**: application/json
|
|
856
|
-
|
|
857
|
-
|
|
858
583
|
## resend_sms_registration_otp
|
|
859
584
|
|
|
860
585
|
> <ResendSmsRegistrationOtp200Response> resend_sms_registration_otp(id)
|
|
@@ -999,7 +724,7 @@ end
|
|
|
999
724
|
|
|
1000
725
|
Send an SMS/MMS
|
|
1001
726
|
|
|
1002
|
-
Sends an SMS (or MMS when `mediaUrls` is set) from one of your SMS-enabled numbers
|
|
727
|
+
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.
|
|
1003
728
|
|
|
1004
729
|
### Examples
|
|
1005
730
|
|
data/docs/SendSmsRequest.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
| Name | Type | Description | Notes |
|
|
6
6
|
| ---- | ---- | ----------- | ----- |
|
|
7
|
-
| **from** | **String** | One of your SMS-enabled numbers (E.164; formatting is normalized)
|
|
7
|
+
| **from** | **String** | One of your SMS-enabled numbers (E.164; formatting is normalized). | |
|
|
8
8
|
| **to** | **String** | Recipient number (E.164). | |
|
|
9
9
|
| **text** | **String** | Message body. Required unless `mediaUrls` is set. Max 10 SMS segments (1530 GSM-7 or 670 unicode characters). | [optional] |
|
|
10
10
|
| **media_urls** | **Array<String>** | Public media URLs to attach (sends as MMS). Max 10. | [optional] |
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
| **platform_message_id** | **String** | Platform's message ID | |
|
|
11
11
|
| **direction** | **String** | | |
|
|
12
12
|
| **text** | **String** | Message text content | |
|
|
13
|
-
| **attachments** | [**Array<
|
|
13
|
+
| **attachments** | [**Array<WebhookPayloadMessageMessageAttachmentsInner>**](WebhookPayloadMessageMessageAttachmentsInner.md) | | |
|
|
14
14
|
| **sender** | [**WebhookPayloadMessageMessageSender**](WebhookPayloadMessageMessageSender.md) | | |
|
|
15
15
|
| **sent_at** | **Time** | | |
|
|
16
16
|
| **is_read** | **Boolean** | | |
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Zernio::WebhookPayloadMessageMessageAttachmentsInner
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **type** | **String** | Attachment type (image, video, file, sticker, audio) | |
|
|
8
|
+
| **url** | **String** | 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. | |
|
|
9
|
+
| **payload** | **Object** | Additional attachment metadata | [optional] |
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```ruby
|
|
14
|
+
require 'zernio-sdk'
|
|
15
|
+
|
|
16
|
+
instance = Zernio::WebhookPayloadMessageMessageAttachmentsInner.new(
|
|
17
|
+
type: null,
|
|
18
|
+
url: null,
|
|
19
|
+
payload: null
|
|
20
|
+
)
|
|
21
|
+
```
|
|
22
|
+
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
| **platform_message_id** | **String** | Platform's message ID | |
|
|
11
11
|
| **direction** | **String** | | |
|
|
12
12
|
| **text** | **String** | Message text content | |
|
|
13
|
-
| **attachments** | [**Array<
|
|
13
|
+
| **attachments** | [**Array<WebhookPayloadMessageSentMessageAttachmentsInner>**](WebhookPayloadMessageSentMessageAttachmentsInner.md) | | |
|
|
14
14
|
| **sender** | [**WebhookPayloadMessageSentMessageSender**](WebhookPayloadMessageSentMessageSender.md) | | |
|
|
15
15
|
| **sent_at** | **Time** | | |
|
|
16
16
|
| **is_read** | **Boolean** | | |
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Zernio::WebhookPayloadMessageSentMessageAttachmentsInner
|
|
2
|
+
|
|
3
|
+
## Properties
|
|
4
|
+
|
|
5
|
+
| Name | Type | Description | Notes |
|
|
6
|
+
| ---- | ---- | ----------- | ----- |
|
|
7
|
+
| **type** | **String** | Attachment type (image, video, file, sticker, audio) | |
|
|
8
|
+
| **url** | **String** | Where to fetch the attachment. For outgoing messages this is the media URL as sent, so for WhatsApp it is the URL you supplied when publishing (WhatsApp sends media by link), not a Zernio endpoint, and it needs no Zernio credentials. Contrast the inbound direction: `message.received` attachment URLs on WhatsApp point at the authenticated `GET /v1/whatsapp/media/{mediaId}`. | |
|
|
9
|
+
| **payload** | **Object** | Additional attachment metadata | [optional] |
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```ruby
|
|
14
|
+
require 'zernio-sdk'
|
|
15
|
+
|
|
16
|
+
instance = Zernio::WebhookPayloadMessageSentMessageAttachmentsInner.new(
|
|
17
|
+
type: null,
|
|
18
|
+
url: null,
|
|
19
|
+
payload: null
|
|
20
|
+
)
|
|
21
|
+
```
|
|
22
|
+
|
|
@@ -372,8 +372,8 @@ module Zernio
|
|
|
372
372
|
return data, status_code, headers
|
|
373
373
|
end
|
|
374
374
|
|
|
375
|
-
# Update
|
|
376
|
-
# Update
|
|
375
|
+
# Update saved targeting audience
|
|
376
|
+
# Update a `saved_targeting` audience's name, description, or spec. Only `saved_targeting` audiences are updatable (they exist only on Zernio); uploaded/derived audiences return 422, delete and recreate those instead. `spec` replaces the stored spec wholesale (no merge). Ads already created from this audience are unaffected, they snapshot the targeting at creation.
|
|
377
377
|
# @param audience_id [String]
|
|
378
378
|
# @param update_ad_audience_request [UpdateAdAudienceRequest]
|
|
379
379
|
# @param [Hash] opts the optional parameters
|
|
@@ -383,8 +383,8 @@ module Zernio
|
|
|
383
383
|
data
|
|
384
384
|
end
|
|
385
385
|
|
|
386
|
-
# Update
|
|
387
|
-
# Update
|
|
386
|
+
# Update saved targeting audience
|
|
387
|
+
# Update a `saved_targeting` audience's name, description, or spec. Only `saved_targeting` audiences are updatable (they exist only on Zernio); uploaded/derived audiences return 422, delete and recreate those instead. `spec` replaces the stored spec wholesale (no merge). Ads already created from this audience are unaffected, they snapshot the targeting at creation.
|
|
388
388
|
# @param audience_id [String]
|
|
389
389
|
# @param update_ad_audience_request [UpdateAdAudienceRequest]
|
|
390
390
|
# @param [Hash] opts the optional parameters
|