late-sdk 0.0.877 → 0.0.879
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 +5 -0
- data/docs/ConnectApi.md +94 -9
- data/docs/ConnectWhatsAppEmbeddedSignup200Response.md +22 -0
- data/docs/ConnectWhatsAppEmbeddedSignup200ResponseAccount.md +28 -0
- data/docs/ConnectWhatsAppEmbeddedSignupRequest.md +5 -1
- data/docs/GetWhatsAppSdkConfig200Response.md +22 -0
- data/docs/GetWhatsAppSdkConfig200ResponseBranding.md +22 -0
- data/lib/zernio-sdk/api/connect_api.rb +103 -7
- data/lib/zernio-sdk/models/connect_whats_app_embedded_signup200_response.rb +166 -0
- data/lib/zernio-sdk/models/connect_whats_app_embedded_signup200_response_account.rb +226 -0
- data/lib/zernio-sdk/models/connect_whats_app_embedded_signup_request.rb +24 -4
- data/lib/zernio-sdk/models/get_whats_app_sdk_config200_response.rb +218 -0
- data/lib/zernio-sdk/models/get_whats_app_sdk_config200_response_branding.rb +204 -0
- data/lib/zernio-sdk/version.rb +1 -1
- data/lib/zernio-sdk.rb +4 -0
- data/openapi.yaml +116 -3
- data/spec/api/connect_api_spec.rb +19 -2
- data/spec/models/connect_whats_app_embedded_signup200_response_account_spec.rb +70 -0
- data/spec/models/connect_whats_app_embedded_signup200_response_spec.rb +48 -0
- data/spec/models/connect_whats_app_embedded_signup_request_spec.rb +12 -0
- data/spec/models/get_whats_app_sdk_config200_response_branding_spec.rb +52 -0
- data/spec/models/get_whats_app_sdk_config200_response_spec.rb +48 -0
- data/zernio-sdk-0.0.879.gem +0 -0
- metadata +19 -3
- data/zernio-sdk-0.0.877.gem +0 -0
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
|
|
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 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Zernio
|
|
17
|
+
# Skin chosen when the hosted signup session was issued (`brandName`, `primaryColor`, `language` on `GET /v1/connect/whatsapp?signup=hosted`). Null for API-key callers and for sessions issued without one.
|
|
18
|
+
class GetWhatsAppSdkConfig200ResponseBranding < ApiModelBase
|
|
19
|
+
attr_accessor :brand_name
|
|
20
|
+
|
|
21
|
+
# Hex colour, #RRGGBB
|
|
22
|
+
attr_accessor :primary_color
|
|
23
|
+
|
|
24
|
+
attr_accessor :language
|
|
25
|
+
|
|
26
|
+
class EnumAttributeValidator
|
|
27
|
+
attr_reader :datatype
|
|
28
|
+
attr_reader :allowable_values
|
|
29
|
+
|
|
30
|
+
def initialize(datatype, allowable_values)
|
|
31
|
+
@allowable_values = allowable_values.map do |value|
|
|
32
|
+
case datatype.to_s
|
|
33
|
+
when /Integer/i
|
|
34
|
+
value.to_i
|
|
35
|
+
when /Float/i
|
|
36
|
+
value.to_f
|
|
37
|
+
else
|
|
38
|
+
value
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def valid?(value)
|
|
44
|
+
!value || allowable_values.include?(value)
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
49
|
+
def self.attribute_map
|
|
50
|
+
{
|
|
51
|
+
:'brand_name' => :'brandName',
|
|
52
|
+
:'primary_color' => :'primaryColor',
|
|
53
|
+
:'language' => :'language'
|
|
54
|
+
}
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Returns attribute mapping this model knows about
|
|
58
|
+
def self.acceptable_attribute_map
|
|
59
|
+
attribute_map
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Returns all the JSON keys this model knows about
|
|
63
|
+
def self.acceptable_attributes
|
|
64
|
+
acceptable_attribute_map.values
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
# Attribute type mapping.
|
|
68
|
+
def self.openapi_types
|
|
69
|
+
{
|
|
70
|
+
:'brand_name' => :'String',
|
|
71
|
+
:'primary_color' => :'String',
|
|
72
|
+
:'language' => :'String'
|
|
73
|
+
}
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
# List of attributes with nullable: true
|
|
77
|
+
def self.openapi_nullable
|
|
78
|
+
Set.new([
|
|
79
|
+
:'brand_name',
|
|
80
|
+
:'primary_color',
|
|
81
|
+
:'language'
|
|
82
|
+
])
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Initializes the object
|
|
86
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
87
|
+
def initialize(attributes = {})
|
|
88
|
+
if (!attributes.is_a?(Hash))
|
|
89
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::GetWhatsAppSdkConfig200ResponseBranding` initialize method"
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
93
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
94
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
95
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
96
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::GetWhatsAppSdkConfig200ResponseBranding`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
97
|
+
end
|
|
98
|
+
h[k.to_sym] = v
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if attributes.key?(:'brand_name')
|
|
102
|
+
self.brand_name = attributes[:'brand_name']
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
if attributes.key?(:'primary_color')
|
|
106
|
+
self.primary_color = attributes[:'primary_color']
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
if attributes.key?(:'language')
|
|
110
|
+
self.language = attributes[:'language']
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
115
|
+
# @return Array for valid properties with the reasons
|
|
116
|
+
def list_invalid_properties
|
|
117
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
118
|
+
invalid_properties = Array.new
|
|
119
|
+
invalid_properties
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# Check to see if the all the properties in the model are valid
|
|
123
|
+
# @return true if the model is valid
|
|
124
|
+
def valid?
|
|
125
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
126
|
+
language_validator = EnumAttributeValidator.new('String', ["en", "es"])
|
|
127
|
+
return false unless language_validator.valid?(@language)
|
|
128
|
+
true
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
132
|
+
# @param [Object] language Object to be assigned
|
|
133
|
+
def language=(language)
|
|
134
|
+
validator = EnumAttributeValidator.new('String', ["en", "es"])
|
|
135
|
+
unless validator.valid?(language)
|
|
136
|
+
fail ArgumentError, "invalid value for \"language\", must be one of #{validator.allowable_values}."
|
|
137
|
+
end
|
|
138
|
+
@language = language
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Checks equality by comparing each attribute.
|
|
142
|
+
# @param [Object] Object to be compared
|
|
143
|
+
def ==(o)
|
|
144
|
+
return true if self.equal?(o)
|
|
145
|
+
self.class == o.class &&
|
|
146
|
+
brand_name == o.brand_name &&
|
|
147
|
+
primary_color == o.primary_color &&
|
|
148
|
+
language == o.language
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
# @see the `==` method
|
|
152
|
+
# @param [Object] Object to be compared
|
|
153
|
+
def eql?(o)
|
|
154
|
+
self == o
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
# Calculates hash code according to all attributes.
|
|
158
|
+
# @return [Integer] Hash code
|
|
159
|
+
def hash
|
|
160
|
+
[brand_name, primary_color, language].hash
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# Builds the object from hash
|
|
164
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
165
|
+
# @return [Object] Returns the model itself
|
|
166
|
+
def self.build_from_hash(attributes)
|
|
167
|
+
return nil unless attributes.is_a?(Hash)
|
|
168
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
169
|
+
transformed_hash = {}
|
|
170
|
+
openapi_types.each_pair do |key, type|
|
|
171
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
172
|
+
transformed_hash["#{key}"] = nil
|
|
173
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
174
|
+
# check to ensure the input is an array given that the attribute
|
|
175
|
+
# is documented as an array but the input is not
|
|
176
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
177
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
178
|
+
end
|
|
179
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
180
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
181
|
+
end
|
|
182
|
+
end
|
|
183
|
+
new(transformed_hash)
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
# Returns the object in the form of hash
|
|
187
|
+
# @return [Hash] Returns the object in the form of hash
|
|
188
|
+
def to_hash
|
|
189
|
+
hash = {}
|
|
190
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
191
|
+
value = self.send(attr)
|
|
192
|
+
if value.nil?
|
|
193
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
194
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
hash[param] = _to_hash(value)
|
|
198
|
+
end
|
|
199
|
+
hash
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
end
|
data/lib/zernio-sdk/version.rb
CHANGED
data/lib/zernio-sdk.rb
CHANGED
|
@@ -232,6 +232,8 @@ require 'zernio-sdk/models/connect_slack_channel_request'
|
|
|
232
232
|
require 'zernio-sdk/models/connect_whats_app_credentials200_response'
|
|
233
233
|
require 'zernio-sdk/models/connect_whats_app_credentials200_response_account'
|
|
234
234
|
require 'zernio-sdk/models/connect_whats_app_credentials_request'
|
|
235
|
+
require 'zernio-sdk/models/connect_whats_app_embedded_signup200_response'
|
|
236
|
+
require 'zernio-sdk/models/connect_whats_app_embedded_signup200_response_account'
|
|
235
237
|
require 'zernio-sdk/models/connect_whats_app_embedded_signup_request'
|
|
236
238
|
require 'zernio-sdk/models/connected'
|
|
237
239
|
require 'zernio-sdk/models/connected_account'
|
|
@@ -869,6 +871,8 @@ require 'zernio-sdk/models/get_whats_app_number_info200_response_waba'
|
|
|
869
871
|
require 'zernio-sdk/models/get_whats_app_number_kyc_form200_response'
|
|
870
872
|
require 'zernio-sdk/models/get_whats_app_number_kyc_form200_response_fields_inner'
|
|
871
873
|
require 'zernio-sdk/models/get_whats_app_number_remediation200_response'
|
|
874
|
+
require 'zernio-sdk/models/get_whats_app_sdk_config200_response'
|
|
875
|
+
require 'zernio-sdk/models/get_whats_app_sdk_config200_response_branding'
|
|
872
876
|
require 'zernio-sdk/models/get_whats_app_template200_response'
|
|
873
877
|
require 'zernio-sdk/models/get_whats_app_template200_response_template'
|
|
874
878
|
require 'zernio-sdk/models/get_whats_app_template409_response'
|
data/openapi.yaml
CHANGED
|
@@ -18702,6 +18702,47 @@ paths:
|
|
|
18702
18702
|
`api`: standard Embedded Signup, showing Meta's WABA/number picker. Use this to connect a phone number already on Cloud API elsewhere.
|
|
18703
18703
|
|
|
18704
18704
|
`business_app`: coexistence, i.e. 'Connect existing WhatsApp Business app' (a number shared between Cloud API and the consumer WhatsApp Business app).
|
|
18705
|
+
- name: signup
|
|
18706
|
+
in: query
|
|
18707
|
+
schema: { type: string, enum: [hosted] }
|
|
18708
|
+
description: |
|
|
18709
|
+
WhatsApp only. Rejected with 400 `INVALID_FIELD_VALUE` on any other platform.
|
|
18710
|
+
|
|
18711
|
+
`hosted`: `authUrl` points at a Zernio-hosted page on zernio.com instead of Meta's OAuth dialog, and
|
|
18712
|
+
the response carries `authUrl` only (no `state`). That page opens Meta's Embedded Signup popup itself,
|
|
18713
|
+
so it learns which WhatsApp Business Account and number the user picked inside the popup and connects
|
|
18714
|
+
exactly that one. Use it when your users' Facebook logins manage several WhatsApp accounts: on the
|
|
18715
|
+
default redirect flow Meta only returns an authorization code, so when that login can see more than
|
|
18716
|
+
one number the user lands on Zernio's number picker and has to choose again. Nothing to embed on your
|
|
18717
|
+
side and no domain setup: send the user to `authUrl`, and they come back to `redirect_url` with the
|
|
18718
|
+
same params as the redirect flow. Success: `connected=whatsapp`, `profileId`, `accountId`, `username`
|
|
18719
|
+
(plus `connect_token` for API-key callers). Failure: `error` and `platform=whatsapp`, with the same
|
|
18720
|
+
values and extras as the redirect flow (`one_whatsapp_per_profile`, `whatsapp_number_already_connected`
|
|
18721
|
+
and `whatsapp_number_pinned_to_profile` with `is_user_fixable=true`; `payment_required` with `reason`
|
|
18722
|
+
and `dashboard_url`; `whatsapp_error` with `error_message` when Meta reported one), plus two of its own:
|
|
18723
|
+
`connection_cancelled` when the popup was closed before finishing (`error_message` carries Meta's last
|
|
18724
|
+
reported step or error when there is one) and `session_expired` when the user took longer than the
|
|
18725
|
+
60 minute window the hosted page is valid for; restart the flow with a new call in that case.
|
|
18726
|
+
`onboarding` is carried through and a pre-verified Zernio-provisioned number is attached like on the
|
|
18727
|
+
redirect flow. `headless` has no effect here because there is no selection step left to hand you.
|
|
18728
|
+
When a previously disconnected account for this profile can simply be re-enabled, this endpoint
|
|
18729
|
+
re-enables it and returns the account directly instead of a URL, exactly like the redirect flow.
|
|
18730
|
+
The page shows the same guidance as the Zernio dashboard: a pre-verified Zernio-provisioned number is
|
|
18731
|
+
called out by name ("choose it in Meta's list, no code will be asked"), coexistence and standard signups
|
|
18732
|
+
get their explainer video, and a step-by-step follow-along checklist stays visible while Meta's popup is
|
|
18733
|
+
open. Skin it with `brandName`, `primaryColor` and `language` below.
|
|
18734
|
+
- name: brandName
|
|
18735
|
+
in: query
|
|
18736
|
+
schema: { type: string, minLength: 1, maxLength: 60 }
|
|
18737
|
+
description: 'Hosted signup page only (`signup=hosted`, WhatsApp): name shown in the page title ("Connect your WhatsApp number to <brandName>") instead of Zernio. The Zernio logo stays: the page is co-branded, not white-label. Trimmed; 1 to 60 characters. Rejected with 400 `INVALID_FIELD_VALUE` without `signup=hosted`. Stored on the signup session at issue time, so the page URL cannot change it.'
|
|
18738
|
+
- name: primaryColor
|
|
18739
|
+
in: query
|
|
18740
|
+
schema: { type: string, pattern: '^#[0-9a-fA-F]{6}$' }
|
|
18741
|
+
description: 'Hosted signup page only (`signup=hosted`, WhatsApp): hex colour (`#RRGGBB`) for the primary button and step accents. Validated server-side; anything else is a 400 `INVALID_FIELD_VALUE`. Rejected without `signup=hosted`.'
|
|
18742
|
+
- name: language
|
|
18743
|
+
in: query
|
|
18744
|
+
schema: { type: string, enum: [en, es] }
|
|
18745
|
+
description: 'Hosted signup page only (`signup=hosted`, WhatsApp): language of the page and its follow-along guide. Explainer videos stay in English. Default `en`. Rejected without `signup=hosted`.'
|
|
18705
18746
|
security:
|
|
18706
18747
|
- bearerAuth: []
|
|
18707
18748
|
responses:
|
|
@@ -22738,7 +22779,19 @@ paths:
|
|
|
22738
22779
|
operationId: connectWhatsAppEmbeddedSignup
|
|
22739
22780
|
tags: [Connect]
|
|
22740
22781
|
summary: Connect WhatsApp from Embedded Signup
|
|
22741
|
-
description:
|
|
22782
|
+
description: |
|
|
22783
|
+
Exchange the authorization code Meta's Embedded Signup popup returned. This is the call the Zernio-hosted
|
|
22784
|
+
signup page makes after the popup closes (`GET /v1/connect/whatsapp?signup=hosted`), sending the `wabaId`
|
|
22785
|
+
and `phoneNumberId` Meta reported so exactly the chosen number is connected; when both are omitted the
|
|
22786
|
+
first number the token can see is used. The code never passes through a `redirect_uri`, so
|
|
22787
|
+
`POST /v1/connect/{platform}` cannot accept it. Authenticates with an API key, or with the connect token
|
|
22788
|
+
the hosted flow issues (`X-Connect-Token` header).
|
|
22789
|
+
parameters:
|
|
22790
|
+
- name: X-Connect-Token
|
|
22791
|
+
in: header
|
|
22792
|
+
required: false
|
|
22793
|
+
schema: { type: string }
|
|
22794
|
+
description: Connect token issued by the hosted signup flow, accepted instead of an API key.
|
|
22742
22795
|
requestBody:
|
|
22743
22796
|
required: true
|
|
22744
22797
|
content:
|
|
@@ -22753,13 +22806,73 @@ paths:
|
|
|
22753
22806
|
phoneNumberId: { type: string }
|
|
22754
22807
|
isCoexistence: { type: boolean, description: 'Number is also live in the WhatsApp Business app' }
|
|
22755
22808
|
expectedPhoneNumber: { type: string, description: 'Rejects the connect when Meta returns a different number' }
|
|
22809
|
+
redirectUrl:
|
|
22810
|
+
type: string
|
|
22811
|
+
description: 'Hosted signup page only. When present, the response also carries `redirectUrl`, the URL the user should land on, with the outcome mapped exactly like the redirect flow (success params, or `error` and `platform` with the same values). Must be an absolute http(s) URL or a custom app scheme.'
|
|
22812
|
+
echoConnectToken: { type: boolean, description: 'Hosted signup page only. Append the connect token to the success redirect, as the redirect flow does for API-key callers.' }
|
|
22756
22813
|
responses:
|
|
22757
|
-
'200':
|
|
22814
|
+
'200':
|
|
22815
|
+
description: Number connected
|
|
22816
|
+
content:
|
|
22817
|
+
application/json:
|
|
22818
|
+
schema:
|
|
22819
|
+
type: object
|
|
22820
|
+
properties:
|
|
22821
|
+
message: { type: string }
|
|
22822
|
+
account:
|
|
22823
|
+
type: object
|
|
22824
|
+
properties:
|
|
22825
|
+
accountId: { type: string }
|
|
22826
|
+
platform: { type: string, enum: [whatsapp] }
|
|
22827
|
+
username: { type: string }
|
|
22828
|
+
displayName: { type: string }
|
|
22829
|
+
isActive: { type: boolean }
|
|
22830
|
+
selectedPhoneNumber: { type: string }
|
|
22831
|
+
redirectUrl: { type: string, description: 'Present only when `redirectUrl` was sent; also present on error responses.' }
|
|
22758
22832
|
'400': { $ref: '#/components/responses/BadRequest' }
|
|
22759
22833
|
'401': { $ref: '#/components/responses/Unauthorized' }
|
|
22760
22834
|
'402': { $ref: '#/components/responses/PaymentRequired' }
|
|
22761
22835
|
'409': { description: 'The number is already connected on another profile or team' }
|
|
22762
22836
|
|
|
22837
|
+
/v1/connect/whatsapp/sdk-config:
|
|
22838
|
+
get:
|
|
22839
|
+
x-resource-group: "accounts"
|
|
22840
|
+
operationId: getWhatsAppSdkConfig
|
|
22841
|
+
tags: [Connect]
|
|
22842
|
+
summary: Get Embedded Signup SDK config
|
|
22843
|
+
description: |
|
|
22844
|
+
The Meta app id and Embedded Signup configuration id the Zernio-hosted signup page uses to open Meta's
|
|
22845
|
+
popup. Integrators do not need this endpoint: start the hosted flow with
|
|
22846
|
+
`GET /v1/connect/whatsapp?signup=hosted` and send the user to the returned `authUrl`. Authenticates with
|
|
22847
|
+
an API key or with the connect token the hosted flow issues (`X-Connect-Token` header).
|
|
22848
|
+
parameters:
|
|
22849
|
+
- name: X-Connect-Token
|
|
22850
|
+
in: header
|
|
22851
|
+
required: false
|
|
22852
|
+
schema: { type: string }
|
|
22853
|
+
description: Connect token issued by the hosted signup flow, accepted instead of an API key.
|
|
22854
|
+
security:
|
|
22855
|
+
- bearerAuth: []
|
|
22856
|
+
responses:
|
|
22857
|
+
'200':
|
|
22858
|
+
description: Meta app configuration for Embedded Signup
|
|
22859
|
+
content:
|
|
22860
|
+
application/json:
|
|
22861
|
+
schema:
|
|
22862
|
+
type: object
|
|
22863
|
+
required: [appId, configId, branding]
|
|
22864
|
+
properties:
|
|
22865
|
+
appId: { type: string, description: Meta app id }
|
|
22866
|
+
configId: { type: string, description: Embedded Signup configuration id }
|
|
22867
|
+
branding:
|
|
22868
|
+
type: [object, "null"]
|
|
22869
|
+
description: 'Skin chosen when the hosted signup session was issued (`brandName`, `primaryColor`, `language` on `GET /v1/connect/whatsapp?signup=hosted`). Null for API-key callers and for sessions issued without one.'
|
|
22870
|
+
properties:
|
|
22871
|
+
brandName: { type: [string, "null"] }
|
|
22872
|
+
primaryColor: { type: [string, "null"], description: 'Hex colour, #RRGGBB' }
|
|
22873
|
+
language: { type: [string, "null"], enum: [en, es, null] }
|
|
22874
|
+
'401': { $ref: '#/components/responses/Unauthorized' }
|
|
22875
|
+
|
|
22763
22876
|
/v1/connect/discord:
|
|
22764
22877
|
post:
|
|
22765
22878
|
x-resource-group: "accounts"
|
|
@@ -48479,7 +48592,7 @@ paths:
|
|
|
48479
48592
|
'400': { $ref: '#/components/responses/BadRequest' }
|
|
48480
48593
|
'401': { $ref: '#/components/responses/Unauthorized' }
|
|
48481
48594
|
'403':
|
|
48482
|
-
description: Ads access required
|
|
48595
|
+
description: "Ads access required (legacy plans need the Ads add-on; included on usage-based plans), or `payment_required`: the billing owner has no payment method on file and no legacy paid plan. Searches are free; the card keeps the shared archive quota for real accounts."
|
|
48483
48596
|
'404': { description: Account not found }
|
|
48484
48597
|
'501': { description: Only supported on Meta and LinkedIn accounts }
|
|
48485
48598
|
'503': { description: "Meta's Ad Library is unavailable on Zernio's side (`PLATFORM_DISABLED`); LinkedIn searches are unaffected." }
|
|
@@ -175,10 +175,11 @@ describe 'ConnectApi' do
|
|
|
175
175
|
|
|
176
176
|
# unit tests for connect_whats_app_embedded_signup
|
|
177
177
|
# Connect WhatsApp from Embedded Signup
|
|
178
|
-
# Exchange the authorization code Meta Embedded Signup
|
|
178
|
+
# Exchange the authorization code Meta's Embedded Signup popup returned. This is the call the Zernio-hosted signup page makes after the popup closes (`GET /v1/connect/whatsapp?signup=hosted`), sending the `wabaId` and `phoneNumberId` Meta reported so exactly the chosen number is connected; when both are omitted the first number the token can see is used. The code never passes through a `redirect_uri`, so `POST /v1/connect/{platform}` cannot accept it. Authenticates with an API key, or with the connect token the hosted flow issues (`X-Connect-Token` header).
|
|
179
179
|
# @param connect_whats_app_embedded_signup_request
|
|
180
180
|
# @param [Hash] opts the optional parameters
|
|
181
|
-
# @
|
|
181
|
+
# @option opts [String] :x_connect_token Connect token issued by the hosted signup flow, accepted instead of an API key.
|
|
182
|
+
# @return [ConnectWhatsAppEmbeddedSignup200Response]
|
|
182
183
|
describe 'connect_whats_app_embedded_signup test' do
|
|
183
184
|
it 'should work' do
|
|
184
185
|
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
@@ -208,6 +209,10 @@ describe 'ConnectApi' do
|
|
|
208
209
|
# @option opts [Boolean] :headless When true, the user is redirected to your redirect_url with raw OAuth data (code, state) instead of Zernio's default account selection UI. Use this to build a custom connect experience.
|
|
209
210
|
# @option opts [String] :login_method Instagram only. Which of the two Instagram connection methods to use. Ignored for every other platform. `instagram_login` (the default, and what you get if you omit this): the Instagram Login dialog. The user authorizes their Instagram professional account directly, no Facebook Page required. `facebook_login`: the Facebook Login dialog, i.e. \"Instagram API with Facebook Login\". The user authorizes a Facebook Page that has a linked Instagram professional account, and every API call for that account then runs through the Page. Use this when the customer manages Instagram through a Page and expects the Facebook consent screen. Because the user has to pick which Page to connect, the callback continues at the account-selection step, `/v1/connect/instagram/select-account`. `facebook_login` supports `headless=true` like the other selection platforms: the callback redirects to your `redirect_url` with `profileId`, `tempToken`, `platform=instagram`, `step=select_account` and `connect_token`, which you pass into the select-account endpoints to finish. The default `instagram_login` has no selection step, so it connects the account directly.
|
|
210
211
|
# @option opts [String] :onboarding WhatsApp only. Ignored for every other platform. Controls which screen Meta's Embedded Signup popup shows. If omitted, the connection defaults to coexistence (same as `business_app` below), preserving existing behavior for numbers already on the WhatsApp Business app. `api`: standard Embedded Signup, showing Meta's WABA/number picker. Use this to connect a phone number already on Cloud API elsewhere. `business_app`: coexistence, i.e. 'Connect existing WhatsApp Business app' (a number shared between Cloud API and the consumer WhatsApp Business app).
|
|
212
|
+
# @option opts [String] :signup WhatsApp only. Rejected with 400 `INVALID_FIELD_VALUE` on any other platform. `hosted`: `authUrl` points at a Zernio-hosted page on zernio.com instead of Meta's OAuth dialog, and the response carries `authUrl` only (no `state`). That page opens Meta's Embedded Signup popup itself, so it learns which WhatsApp Business Account and number the user picked inside the popup and connects exactly that one. Use it when your users' Facebook logins manage several WhatsApp accounts: on the default redirect flow Meta only returns an authorization code, so when that login can see more than one number the user lands on Zernio's number picker and has to choose again. Nothing to embed on your side and no domain setup: send the user to `authUrl`, and they come back to `redirect_url` with the same params as the redirect flow. Success: `connected=whatsapp`, `profileId`, `accountId`, `username` (plus `connect_token` for API-key callers). Failure: `error` and `platform=whatsapp`, with the same values and extras as the redirect flow (`one_whatsapp_per_profile`, `whatsapp_number_already_connected` and `whatsapp_number_pinned_to_profile` with `is_user_fixable=true`; `payment_required` with `reason` and `dashboard_url`; `whatsapp_error` with `error_message` when Meta reported one), plus two of its own: `connection_cancelled` when the popup was closed before finishing (`error_message` carries Meta's last reported step or error when there is one) and `session_expired` when the user took longer than the 60 minute window the hosted page is valid for; restart the flow with a new call in that case. `onboarding` is carried through and a pre-verified Zernio-provisioned number is attached like on the redirect flow. `headless` has no effect here because there is no selection step left to hand you. When a previously disconnected account for this profile can simply be re-enabled, this endpoint re-enables it and returns the account directly instead of a URL, exactly like the redirect flow. The page shows the same guidance as the Zernio dashboard: a pre-verified Zernio-provisioned number is called out by name (\"choose it in Meta's list, no code will be asked\"), coexistence and standard signups get their explainer video, and a step-by-step follow-along checklist stays visible while Meta's popup is open. Skin it with `brandName`, `primaryColor` and `language` below.
|
|
213
|
+
# @option opts [String] :brand_name Hosted signup page only (`signup=hosted`, WhatsApp): name shown in the page title (\"Connect your WhatsApp number to <brandName>\") instead of Zernio. The Zernio logo stays: the page is co-branded, not white-label. Trimmed; 1 to 60 characters. Rejected with 400 `INVALID_FIELD_VALUE` without `signup=hosted`. Stored on the signup session at issue time, so the page URL cannot change it.
|
|
214
|
+
# @option opts [String] :primary_color Hosted signup page only (`signup=hosted`, WhatsApp): hex colour (`#RRGGBB`) for the primary button and step accents. Validated server-side; anything else is a 400 `INVALID_FIELD_VALUE`. Rejected without `signup=hosted`.
|
|
215
|
+
# @option opts [String] :language Hosted signup page only (`signup=hosted`, WhatsApp): language of the page and its follow-along guide. Explainer videos stay in English. Default `en`. Rejected without `signup=hosted`.
|
|
211
216
|
# @return [GetConnectUrl200Response]
|
|
212
217
|
describe 'get_connect_url test' do
|
|
213
218
|
it 'should work' do
|
|
@@ -343,6 +348,18 @@ describe 'ConnectApi' do
|
|
|
343
348
|
end
|
|
344
349
|
end
|
|
345
350
|
|
|
351
|
+
# unit tests for get_whats_app_sdk_config
|
|
352
|
+
# Get Embedded Signup SDK config
|
|
353
|
+
# The Meta app id and Embedded Signup configuration id the Zernio-hosted signup page uses to open Meta's popup. Integrators do not need this endpoint: start the hosted flow with `GET /v1/connect/whatsapp?signup=hosted` and send the user to the returned `authUrl`. Authenticates with an API key or with the connect token the hosted flow issues (`X-Connect-Token` header).
|
|
354
|
+
# @param [Hash] opts the optional parameters
|
|
355
|
+
# @option opts [String] :x_connect_token Connect token issued by the hosted signup flow, accepted instead of an API key.
|
|
356
|
+
# @return [GetWhatsAppSdkConfig200Response]
|
|
357
|
+
describe 'get_whats_app_sdk_config test' do
|
|
358
|
+
it 'should work' do
|
|
359
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
360
|
+
end
|
|
361
|
+
end
|
|
362
|
+
|
|
346
363
|
# unit tests for get_youtube_captions
|
|
347
364
|
# Get a YouTube video transcript
|
|
348
365
|
# Returns the caption track YouTube already holds for one of the connected channel's own videos, as plain text plus timed cues. Use it instead of downloading and transcribing the video yourself. Auto-generated (ASR) tracks are included: YouTube serves them to the channel owner, which is what the connected account is. Uploaded tracks win over auto-generated ones when both exist for a language. Caching: we store the transcript on first read and serve it from there afterwards, so you do not need to cache it yourself. A cached read costs no YouTube quota and does not call YouTube at all. `source` tells you which happened (`youtube` on the first read, `cache` after). Pass `refresh=true` only when the captions actually changed on YouTube, since that re-downloads. Notes: - Only videos owned by this connected channel. Anything else returns 404. - `contentDetails.caption` in YouTube's own API reads `false` on videos that DO have a serving auto-generated track, so it is not a usable availability signal. Call this endpoint and handle the 404. - YouTube generates auto-captions only for videos with recognisable speech, and can take a few hours after upload to publish them.
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
|
|
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 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for Zernio::ConnectWhatsAppEmbeddedSignup200ResponseAccount
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe Zernio::ConnectWhatsAppEmbeddedSignup200ResponseAccount do
|
|
21
|
+
#let(:instance) { Zernio::ConnectWhatsAppEmbeddedSignup200ResponseAccount.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of ConnectWhatsAppEmbeddedSignup200ResponseAccount' do
|
|
24
|
+
it 'should create an instance of ConnectWhatsAppEmbeddedSignup200ResponseAccount' do
|
|
25
|
+
# uncomment below to test the instance creation
|
|
26
|
+
#expect(instance).to be_instance_of(Zernio::ConnectWhatsAppEmbeddedSignup200ResponseAccount)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test attribute "account_id"' do
|
|
31
|
+
it 'should work' do
|
|
32
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
describe 'test attribute "platform"' do
|
|
37
|
+
it 'should work' do
|
|
38
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
39
|
+
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["whatsapp"])
|
|
40
|
+
# validator.allowable_values.each do |value|
|
|
41
|
+
# expect { instance.platform = value }.not_to raise_error
|
|
42
|
+
# end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
describe 'test attribute "username"' do
|
|
47
|
+
it 'should work' do
|
|
48
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
describe 'test attribute "display_name"' do
|
|
53
|
+
it 'should work' do
|
|
54
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
describe 'test attribute "is_active"' do
|
|
59
|
+
it 'should work' do
|
|
60
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
describe 'test attribute "selected_phone_number"' do
|
|
65
|
+
it 'should work' do
|
|
66
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
|
|
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 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for Zernio::ConnectWhatsAppEmbeddedSignup200Response
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe Zernio::ConnectWhatsAppEmbeddedSignup200Response do
|
|
21
|
+
#let(:instance) { Zernio::ConnectWhatsAppEmbeddedSignup200Response.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of ConnectWhatsAppEmbeddedSignup200Response' do
|
|
24
|
+
it 'should create an instance of ConnectWhatsAppEmbeddedSignup200Response' do
|
|
25
|
+
# uncomment below to test the instance creation
|
|
26
|
+
#expect(instance).to be_instance_of(Zernio::ConnectWhatsAppEmbeddedSignup200Response)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test attribute "message"' do
|
|
31
|
+
it 'should work' do
|
|
32
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
describe 'test attribute "account"' do
|
|
37
|
+
it 'should work' do
|
|
38
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
describe 'test attribute "redirect_url"' do
|
|
43
|
+
it 'should work' do
|
|
44
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
end
|
|
@@ -63,4 +63,16 @@ describe Zernio::ConnectWhatsAppEmbeddedSignupRequest do
|
|
|
63
63
|
end
|
|
64
64
|
end
|
|
65
65
|
|
|
66
|
+
describe 'test attribute "redirect_url"' do
|
|
67
|
+
it 'should work' do
|
|
68
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
describe 'test attribute "echo_connect_token"' do
|
|
73
|
+
it 'should work' do
|
|
74
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
|
|
66
78
|
end
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Zernio API
|
|
3
|
+
|
|
4
|
+
#API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).
|
|
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 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for Zernio::GetWhatsAppSdkConfig200ResponseBranding
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe Zernio::GetWhatsAppSdkConfig200ResponseBranding do
|
|
21
|
+
#let(:instance) { Zernio::GetWhatsAppSdkConfig200ResponseBranding.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of GetWhatsAppSdkConfig200ResponseBranding' do
|
|
24
|
+
it 'should create an instance of GetWhatsAppSdkConfig200ResponseBranding' do
|
|
25
|
+
# uncomment below to test the instance creation
|
|
26
|
+
#expect(instance).to be_instance_of(Zernio::GetWhatsAppSdkConfig200ResponseBranding)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test attribute "brand_name"' do
|
|
31
|
+
it 'should work' do
|
|
32
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
describe 'test attribute "primary_color"' do
|
|
37
|
+
it 'should work' do
|
|
38
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
describe 'test attribute "language"' do
|
|
43
|
+
it 'should work' do
|
|
44
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
45
|
+
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["en", "es"])
|
|
46
|
+
# validator.allowable_values.each do |value|
|
|
47
|
+
# expect { instance.language = value }.not_to raise_error
|
|
48
|
+
# end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
end
|