late-sdk 0.0.572 → 0.0.573
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 +10 -0
- data/docs/CreateLeadFormRequest.md +13 -11
- data/docs/CreateLeadFormRequestPlatformSpecificData.md +49 -0
- data/docs/LeadGenApi.md +25 -21
- data/docs/LinkedInLeadFormPlatformData.md +30 -0
- data/docs/LinkedInLeadFormPlatformDataConsentsInner.md +20 -0
- data/docs/LinkedInLeadFormPlatformDataLocale.md +20 -0
- data/docs/LinkedInLeadFormPlatformDataQuestionsInner.md +49 -0
- data/docs/LinkedInLeadFormPlatformDataQuestionsInnerOneOf.md +28 -0
- data/docs/LinkedInLeadFormPlatformDataQuestionsInnerOneOf1.md +28 -0
- data/docs/LinkedInLeadFormPlatformDataQuestionsInnerOneOf1ChoicesInner.md +20 -0
- data/docs/MetaLeadFormPlatformData.md +46 -0
- data/docs/MetaLeadFormPlatformDataContextCard.md +26 -0
- data/lib/zernio-sdk/api/lead_gen_api.rb +30 -24
- data/lib/zernio-sdk/models/create_lead_form_request.rb +25 -13
- data/lib/zernio-sdk/models/create_lead_form_request_platform_specific_data.rb +105 -0
- data/lib/zernio-sdk/models/linked_in_lead_form_platform_data.rb +336 -0
- data/lib/zernio-sdk/models/linked_in_lead_form_platform_data_consents_inner.rb +176 -0
- data/lib/zernio-sdk/models/linked_in_lead_form_platform_data_locale.rb +156 -0
- data/lib/zernio-sdk/models/linked_in_lead_form_platform_data_questions_inner.rb +104 -0
- data/lib/zernio-sdk/models/linked_in_lead_form_platform_data_questions_inner_one_of.rb +268 -0
- data/lib/zernio-sdk/models/linked_in_lead_form_platform_data_questions_inner_one_of1.rb +295 -0
- data/lib/zernio-sdk/models/linked_in_lead_form_platform_data_questions_inner_one_of1_choices_inner.rb +190 -0
- data/lib/zernio-sdk/models/meta_lead_form_platform_data.rb +354 -0
- data/lib/zernio-sdk/models/meta_lead_form_platform_data_context_card.rb +219 -0
- data/lib/zernio-sdk/version.rb +1 -1
- data/lib/zernio-sdk.rb +10 -0
- data/openapi.yaml +142 -32
- data/spec/api/lead_gen_api_spec.rb +14 -12
- data/spec/models/create_lead_form_request_platform_specific_data_spec.rb +32 -0
- data/spec/models/create_lead_form_request_spec.rb +6 -0
- data/spec/models/linked_in_lead_form_platform_data_consents_inner_spec.rb +42 -0
- data/spec/models/linked_in_lead_form_platform_data_locale_spec.rb +42 -0
- data/spec/models/linked_in_lead_form_platform_data_questions_inner_one_of1_choices_inner_spec.rb +42 -0
- data/spec/models/linked_in_lead_form_platform_data_questions_inner_one_of1_spec.rb +70 -0
- data/spec/models/linked_in_lead_form_platform_data_questions_inner_one_of_spec.rb +70 -0
- data/spec/models/linked_in_lead_form_platform_data_questions_inner_spec.rb +32 -0
- data/spec/models/linked_in_lead_form_platform_data_spec.rb +76 -0
- data/spec/models/meta_lead_form_platform_data_context_card_spec.rb +64 -0
- data/spec/models/meta_lead_form_platform_data_spec.rb +124 -0
- data/zernio-sdk-0.0.573.gem +0 -0
- metadata +42 -2
- data/zernio-sdk-0.0.572.gem +0 -0
|
@@ -0,0 +1,219 @@
|
|
|
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 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module Zernio
|
|
17
|
+
class MetaLeadFormPlatformDataContextCard < ApiModelBase
|
|
18
|
+
attr_accessor :title
|
|
19
|
+
|
|
20
|
+
attr_accessor :content
|
|
21
|
+
|
|
22
|
+
attr_accessor :style
|
|
23
|
+
|
|
24
|
+
attr_accessor :button_text
|
|
25
|
+
|
|
26
|
+
attr_accessor :cover_photo
|
|
27
|
+
|
|
28
|
+
class EnumAttributeValidator
|
|
29
|
+
attr_reader :datatype
|
|
30
|
+
attr_reader :allowable_values
|
|
31
|
+
|
|
32
|
+
def initialize(datatype, allowable_values)
|
|
33
|
+
@allowable_values = allowable_values.map do |value|
|
|
34
|
+
case datatype.to_s
|
|
35
|
+
when /Integer/i
|
|
36
|
+
value.to_i
|
|
37
|
+
when /Float/i
|
|
38
|
+
value.to_f
|
|
39
|
+
else
|
|
40
|
+
value
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def valid?(value)
|
|
46
|
+
!value || allowable_values.include?(value)
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
51
|
+
def self.attribute_map
|
|
52
|
+
{
|
|
53
|
+
:'title' => :'title',
|
|
54
|
+
:'content' => :'content',
|
|
55
|
+
:'style' => :'style',
|
|
56
|
+
:'button_text' => :'buttonText',
|
|
57
|
+
:'cover_photo' => :'coverPhoto'
|
|
58
|
+
}
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Returns attribute mapping this model knows about
|
|
62
|
+
def self.acceptable_attribute_map
|
|
63
|
+
attribute_map
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Returns all the JSON keys this model knows about
|
|
67
|
+
def self.acceptable_attributes
|
|
68
|
+
acceptable_attribute_map.values
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Attribute type mapping.
|
|
72
|
+
def self.openapi_types
|
|
73
|
+
{
|
|
74
|
+
:'title' => :'String',
|
|
75
|
+
:'content' => :'Array<String>',
|
|
76
|
+
:'style' => :'String',
|
|
77
|
+
:'button_text' => :'String',
|
|
78
|
+
:'cover_photo' => :'String'
|
|
79
|
+
}
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# List of attributes with nullable: true
|
|
83
|
+
def self.openapi_nullable
|
|
84
|
+
Set.new([
|
|
85
|
+
])
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Initializes the object
|
|
89
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
90
|
+
def initialize(attributes = {})
|
|
91
|
+
if (!attributes.is_a?(Hash))
|
|
92
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Zernio::MetaLeadFormPlatformDataContextCard` initialize method"
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
96
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
97
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
98
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
99
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Zernio::MetaLeadFormPlatformDataContextCard`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
100
|
+
end
|
|
101
|
+
h[k.to_sym] = v
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if attributes.key?(:'title')
|
|
105
|
+
self.title = attributes[:'title']
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
if attributes.key?(:'content')
|
|
109
|
+
if (value = attributes[:'content']).is_a?(Array)
|
|
110
|
+
self.content = value
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
|
|
114
|
+
if attributes.key?(:'style')
|
|
115
|
+
self.style = attributes[:'style']
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
if attributes.key?(:'button_text')
|
|
119
|
+
self.button_text = attributes[:'button_text']
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
if attributes.key?(:'cover_photo')
|
|
123
|
+
self.cover_photo = attributes[:'cover_photo']
|
|
124
|
+
end
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
128
|
+
# @return Array for valid properties with the reasons
|
|
129
|
+
def list_invalid_properties
|
|
130
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
131
|
+
invalid_properties = Array.new
|
|
132
|
+
invalid_properties
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# Check to see if the all the properties in the model are valid
|
|
136
|
+
# @return true if the model is valid
|
|
137
|
+
def valid?
|
|
138
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
139
|
+
style_validator = EnumAttributeValidator.new('String', ["LIST_STYLE", "PARAGRAPH_STYLE"])
|
|
140
|
+
return false unless style_validator.valid?(@style)
|
|
141
|
+
true
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
145
|
+
# @param [Object] style Object to be assigned
|
|
146
|
+
def style=(style)
|
|
147
|
+
validator = EnumAttributeValidator.new('String', ["LIST_STYLE", "PARAGRAPH_STYLE"])
|
|
148
|
+
unless validator.valid?(style)
|
|
149
|
+
fail ArgumentError, "invalid value for \"style\", must be one of #{validator.allowable_values}."
|
|
150
|
+
end
|
|
151
|
+
@style = style
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
# Checks equality by comparing each attribute.
|
|
155
|
+
# @param [Object] Object to be compared
|
|
156
|
+
def ==(o)
|
|
157
|
+
return true if self.equal?(o)
|
|
158
|
+
self.class == o.class &&
|
|
159
|
+
title == o.title &&
|
|
160
|
+
content == o.content &&
|
|
161
|
+
style == o.style &&
|
|
162
|
+
button_text == o.button_text &&
|
|
163
|
+
cover_photo == o.cover_photo
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
# @see the `==` method
|
|
167
|
+
# @param [Object] Object to be compared
|
|
168
|
+
def eql?(o)
|
|
169
|
+
self == o
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
# Calculates hash code according to all attributes.
|
|
173
|
+
# @return [Integer] Hash code
|
|
174
|
+
def hash
|
|
175
|
+
[title, content, style, button_text, cover_photo].hash
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
# Builds the object from hash
|
|
179
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
180
|
+
# @return [Object] Returns the model itself
|
|
181
|
+
def self.build_from_hash(attributes)
|
|
182
|
+
return nil unless attributes.is_a?(Hash)
|
|
183
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
184
|
+
transformed_hash = {}
|
|
185
|
+
openapi_types.each_pair do |key, type|
|
|
186
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
187
|
+
transformed_hash["#{key}"] = nil
|
|
188
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
189
|
+
# check to ensure the input is an array given that the attribute
|
|
190
|
+
# is documented as an array but the input is not
|
|
191
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
192
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
193
|
+
end
|
|
194
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
195
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
196
|
+
end
|
|
197
|
+
end
|
|
198
|
+
new(transformed_hash)
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
# Returns the object in the form of hash
|
|
202
|
+
# @return [Hash] Returns the object in the form of hash
|
|
203
|
+
def to_hash
|
|
204
|
+
hash = {}
|
|
205
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
206
|
+
value = self.send(attr)
|
|
207
|
+
if value.nil?
|
|
208
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
209
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
hash[param] = _to_hash(value)
|
|
213
|
+
end
|
|
214
|
+
hash
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
end
|
data/lib/zernio-sdk/version.rb
CHANGED
data/lib/zernio-sdk.rb
CHANGED
|
@@ -218,6 +218,7 @@ require 'zernio-sdk/models/create_invite_token201_response'
|
|
|
218
218
|
require 'zernio-sdk/models/create_invite_token_request'
|
|
219
219
|
require 'zernio-sdk/models/create_lead_form200_response'
|
|
220
220
|
require 'zernio-sdk/models/create_lead_form_request'
|
|
221
|
+
require 'zernio-sdk/models/create_lead_form_request_platform_specific_data'
|
|
221
222
|
require 'zernio-sdk/models/create_lead_form_request_questions_inner'
|
|
222
223
|
require 'zernio-sdk/models/create_messaging_ad_request'
|
|
223
224
|
require 'zernio-sdk/models/create_phone_number_kyc_link200_response'
|
|
@@ -781,6 +782,13 @@ require 'zernio-sdk/models/linked_in_aggregate_analytics_daily_response_analytic
|
|
|
781
782
|
require 'zernio-sdk/models/linked_in_aggregate_analytics_daily_response_analytics_impressions_inner'
|
|
782
783
|
require 'zernio-sdk/models/linked_in_aggregate_analytics_total_response'
|
|
783
784
|
require 'zernio-sdk/models/linked_in_aggregate_analytics_total_response_analytics'
|
|
785
|
+
require 'zernio-sdk/models/linked_in_lead_form_platform_data'
|
|
786
|
+
require 'zernio-sdk/models/linked_in_lead_form_platform_data_consents_inner'
|
|
787
|
+
require 'zernio-sdk/models/linked_in_lead_form_platform_data_locale'
|
|
788
|
+
require 'zernio-sdk/models/linked_in_lead_form_platform_data_questions_inner'
|
|
789
|
+
require 'zernio-sdk/models/linked_in_lead_form_platform_data_questions_inner_one_of'
|
|
790
|
+
require 'zernio-sdk/models/linked_in_lead_form_platform_data_questions_inner_one_of1'
|
|
791
|
+
require 'zernio-sdk/models/linked_in_lead_form_platform_data_questions_inner_one_of1_choices_inner'
|
|
784
792
|
require 'zernio-sdk/models/linked_in_platform_data'
|
|
785
793
|
require 'zernio-sdk/models/list_account_groups200_response'
|
|
786
794
|
require 'zernio-sdk/models/list_account_groups200_response_groups_inner'
|
|
@@ -940,6 +948,8 @@ require 'zernio-sdk/models/lookup_sms_number200_response'
|
|
|
940
948
|
require 'zernio-sdk/models/mark_conversation_read200_response'
|
|
941
949
|
require 'zernio-sdk/models/media_item'
|
|
942
950
|
require 'zernio-sdk/models/media_upload_response'
|
|
951
|
+
require 'zernio-sdk/models/meta_lead_form_platform_data'
|
|
952
|
+
require 'zernio-sdk/models/meta_lead_form_platform_data_context_card'
|
|
943
953
|
require 'zernio-sdk/models/money'
|
|
944
954
|
require 'zernio-sdk/models/money_amount'
|
|
945
955
|
require 'zernio-sdk/models/move_account_to_profile200_response'
|
data/openapi.yaml
CHANGED
|
@@ -37154,18 +37154,25 @@ paths:
|
|
|
37154
37154
|
get:
|
|
37155
37155
|
operationId: listLeads
|
|
37156
37156
|
tags: ["Lead Gen"]
|
|
37157
|
-
x-platforms: ["meta"]
|
|
37157
|
+
x-platforms: ["meta", "linkedin"]
|
|
37158
37158
|
summary: List submitted leads
|
|
37159
37159
|
description: >
|
|
37160
|
-
Returns
|
|
37161
|
-
keyset pagination on `cursor`.
|
|
37162
|
-
|
|
37160
|
+
Returns submitted Lead Gen leads for your team, newest-first, with
|
|
37161
|
+
keyset pagination on `cursor`. For Meta (default) leads are served from
|
|
37162
|
+
the persisted cache, ingested in real time from the `leadgen` webhook.
|
|
37163
|
+
When `accountId` is a LinkedIn ads account, leads are fetched live from
|
|
37164
|
+
LinkedIn's `leadFormResponses` (LinkedIn has no webhook and enforces
|
|
37165
|
+
90-day retention, so nothing is persisted) and `adAccountId` is required.
|
|
37166
|
+
Reading LinkedIn responses needs the `r_marketing_leadgen_automation`
|
|
37167
|
+
permission; accounts connected before it was added must reconnect.
|
|
37168
|
+
Requires the Ads add-on.
|
|
37163
37169
|
parameters:
|
|
37164
37170
|
- { name: formId, in: query, schema: { type: string }, description: Filter to a single lead form. }
|
|
37165
|
-
- { name: accountId, in: query, schema: { type: string }, description: Filter to a single connected account. }
|
|
37171
|
+
- { name: accountId, in: query, schema: { type: string }, description: Filter to a single connected account. LinkedIn ads accounts switch to the live fetch. }
|
|
37172
|
+
- { name: adAccountId, in: query, schema: { type: string }, description: "LinkedIn only: the LinkedIn ad account id whose responses to read (owner-scoped finder)." }
|
|
37166
37173
|
- { name: limit, in: query, schema: { type: integer, minimum: 1, maximum: 100, default: 25 } }
|
|
37167
|
-
- { name: since, in: query, schema: { type: integer }, description: Unix seconds; only leads created at/after this
|
|
37168
|
-
- { name: cursor, in: query, schema: { type: string }, description: Keyset cursor from a previous response's pagination.cursor. }
|
|
37174
|
+
- { name: since, in: query, schema: { type: integer }, description: Unix seconds; only leads created at/after this timestamp. }
|
|
37175
|
+
- { name: cursor, in: query, schema: { type: string }, description: "Keyset cursor from a previous response's pagination.cursor (Meta: AdLead id; LinkedIn: numeric start offset)." }
|
|
37169
37176
|
responses:
|
|
37170
37177
|
'200':
|
|
37171
37178
|
description: Lead list.
|
|
@@ -37204,11 +37211,16 @@ paths:
|
|
|
37204
37211
|
get:
|
|
37205
37212
|
operationId: listLeadForms
|
|
37206
37213
|
tags: ["Lead Gen"]
|
|
37207
|
-
x-platforms: ["meta"]
|
|
37214
|
+
x-platforms: ["meta", "linkedin"]
|
|
37208
37215
|
summary: List lead forms
|
|
37209
|
-
description:
|
|
37216
|
+
description: >
|
|
37217
|
+
Lists the Lead Gen forms owned by the account. Meta: forms on the
|
|
37218
|
+
connected Facebook Page. LinkedIn: forms owned by the ad account's
|
|
37219
|
+
Company Page — pass `adAccountId` (LinkedIn forms are org-owned).
|
|
37220
|
+
Requires the Ads add-on.
|
|
37210
37221
|
parameters:
|
|
37211
|
-
- { name: accountId, in: query, required: true, schema: { type: string }, description: Connected facebook account id. }
|
|
37222
|
+
- { name: accountId, in: query, required: true, schema: { type: string }, description: Connected facebook or linkedin ads account id. }
|
|
37223
|
+
- { name: adAccountId, in: query, schema: { type: string }, description: "LinkedIn only: the LinkedIn ad account id (used to resolve the owning organization). Required for LinkedIn." }
|
|
37212
37224
|
- { name: limit, in: query, schema: { type: integer, minimum: 1, maximum: 100, default: 25 } }
|
|
37213
37225
|
- { name: cursor, in: query, schema: { type: string } }
|
|
37214
37226
|
responses:
|
|
@@ -37227,26 +37239,36 @@ paths:
|
|
|
37227
37239
|
post:
|
|
37228
37240
|
operationId: createLeadForm
|
|
37229
37241
|
tags: ["Lead Gen"]
|
|
37230
|
-
x-platforms: ["meta"]
|
|
37242
|
+
x-platforms: ["meta", "linkedin"]
|
|
37231
37243
|
summary: Create a lead form
|
|
37232
37244
|
description: >
|
|
37233
|
-
Creates a Lead Gen form
|
|
37234
|
-
|
|
37235
|
-
|
|
37236
|
-
|
|
37245
|
+
Creates a Lead Gen form. The form content goes inside
|
|
37246
|
+
`platformSpecificData` for both platforms (the shape is selected by the
|
|
37247
|
+
accountId's platform). Meta: created on the connected Facebook Page
|
|
37248
|
+
(POST /{page-id}/leadgen_forms); the old top-level Meta fields
|
|
37249
|
+
(questions, thankYou*, contextCard, …) are DEPRECATED but still
|
|
37250
|
+
accepted while platformSpecificData is absent — mixing both shapes is
|
|
37251
|
+
a 400. LinkedIn: created on the ad account's Company Page. NOT
|
|
37252
|
+
idempotent — a retry creates a second form. Meta prefilled question
|
|
37253
|
+
types (EMAIL, PHONE, FULL_NAME, …) must omit label/key; CUSTOM
|
|
37254
|
+
questions require both. LinkedIn exposes only free-text and
|
|
37255
|
+
multiple-choice questions via API (prefilled-from-profile fields are
|
|
37256
|
+
Campaign Manager UI-only). Requires the Ads add-on.
|
|
37237
37257
|
requestBody:
|
|
37238
37258
|
required: true
|
|
37239
37259
|
content:
|
|
37240
37260
|
application/json:
|
|
37241
37261
|
schema:
|
|
37242
37262
|
type: object
|
|
37243
|
-
required: [accountId, name,
|
|
37263
|
+
required: [accountId, name, privacyPolicyUrl]
|
|
37244
37264
|
properties:
|
|
37245
37265
|
accountId: { type: string }
|
|
37246
37266
|
name: { type: string, maxLength: 200 }
|
|
37247
37267
|
questions:
|
|
37248
37268
|
type: array
|
|
37249
37269
|
minItems: 1
|
|
37270
|
+
deprecated: true
|
|
37271
|
+
description: "Deprecated (Meta legacy shape): use platformSpecificData.questions."
|
|
37250
37272
|
items:
|
|
37251
37273
|
type: object
|
|
37252
37274
|
required: [type]
|
|
@@ -37257,15 +37279,103 @@ paths:
|
|
|
37257
37279
|
options: { type: array, items: { type: object, properties: { key: { type: string }, value: { type: string } } } }
|
|
37258
37280
|
inline_context: { type: string }
|
|
37259
37281
|
privacyPolicyUrl: { type: string, format: uri }
|
|
37260
|
-
privacyPolicyLinkText: { type: string, maxLength: 70 }
|
|
37261
|
-
followUpActionUrl: { type: string, format: uri }
|
|
37262
|
-
locale: { type: string, example: EN_US }
|
|
37263
|
-
thankYouTitle: { type: string }
|
|
37264
|
-
thankYouBody: { type: string }
|
|
37265
|
-
thankYouButtonText: { type: string }
|
|
37266
|
-
thankYouButtonType: { type: string, example: VIEW_WEBSITE }
|
|
37267
|
-
thankYouWebsiteUrl: { type: string, format: uri }
|
|
37268
|
-
isOptimizedForQuality: { type: boolean }
|
|
37282
|
+
privacyPolicyLinkText: { type: string, maxLength: 70, deprecated: true, description: "Deprecated: use platformSpecificData.privacyPolicyLinkText." }
|
|
37283
|
+
followUpActionUrl: { type: string, format: uri, deprecated: true, description: "Deprecated: use platformSpecificData.followUpActionUrl." }
|
|
37284
|
+
locale: { type: string, example: EN_US, deprecated: true, description: "Deprecated: use platformSpecificData.locale." }
|
|
37285
|
+
thankYouTitle: { type: string, deprecated: true, description: "Deprecated: use platformSpecificData.thankYouTitle." }
|
|
37286
|
+
thankYouBody: { type: string, deprecated: true, description: "Deprecated: use platformSpecificData.thankYouBody." }
|
|
37287
|
+
thankYouButtonText: { type: string, deprecated: true, description: "Deprecated: use platformSpecificData.thankYouButtonText." }
|
|
37288
|
+
thankYouButtonType: { type: string, example: VIEW_WEBSITE, deprecated: true, description: "Deprecated: use platformSpecificData.thankYouButtonType." }
|
|
37289
|
+
thankYouWebsiteUrl: { type: string, format: uri, deprecated: true, description: "Deprecated: use platformSpecificData.thankYouWebsiteUrl." }
|
|
37290
|
+
isOptimizedForQuality: { type: boolean, deprecated: true, description: "Deprecated: use platformSpecificData.isOptimizedForQuality." }
|
|
37291
|
+
platformSpecificData:
|
|
37292
|
+
description: "Form content; the shape is selected by the accountId's platform. Unknown fields are a 400 (strict-parsed)."
|
|
37293
|
+
oneOf:
|
|
37294
|
+
- type: object
|
|
37295
|
+
title: MetaLeadFormPlatformData
|
|
37296
|
+
required: [questions]
|
|
37297
|
+
properties:
|
|
37298
|
+
questions:
|
|
37299
|
+
type: array
|
|
37300
|
+
minItems: 1
|
|
37301
|
+
items:
|
|
37302
|
+
type: object
|
|
37303
|
+
required: [type]
|
|
37304
|
+
properties:
|
|
37305
|
+
type: { type: string, description: "EMAIL, PHONE, FULL_NAME, FIRST_NAME, LAST_NAME, CUSTOM, …" }
|
|
37306
|
+
key: { type: string, description: "CUSTOM questions only." }
|
|
37307
|
+
label: { type: string, description: "CUSTOM questions only." }
|
|
37308
|
+
options: { type: array, items: { type: object, properties: { key: { type: string }, value: { type: string } } } }
|
|
37309
|
+
inline_context: { type: string }
|
|
37310
|
+
privacyPolicyLinkText: { type: string, maxLength: 70 }
|
|
37311
|
+
followUpActionUrl: { type: string, format: uri }
|
|
37312
|
+
locale: { type: string, example: EN_US }
|
|
37313
|
+
thankYouTitle: { type: string }
|
|
37314
|
+
thankYouBody: { type: string }
|
|
37315
|
+
thankYouButtonText: { type: string }
|
|
37316
|
+
thankYouButtonType: { type: string, example: VIEW_WEBSITE }
|
|
37317
|
+
thankYouWebsiteUrl: { type: string, format: uri }
|
|
37318
|
+
isOptimizedForQuality: { type: boolean }
|
|
37319
|
+
formType: { type: string, enum: [MORE_VOLUME, HIGHER_INTENT, RICH_CREATIVE] }
|
|
37320
|
+
blockDisplayForNonTargetedViewer: { type: boolean }
|
|
37321
|
+
allowOrganicLeadGen: { type: boolean }
|
|
37322
|
+
questionPageCustomHeadline: { type: string }
|
|
37323
|
+
contextCard:
|
|
37324
|
+
type: object
|
|
37325
|
+
properties:
|
|
37326
|
+
title: { type: string }
|
|
37327
|
+
content: { type: array, items: { type: string } }
|
|
37328
|
+
style: { type: string, enum: [LIST_STYLE, PARAGRAPH_STYLE] }
|
|
37329
|
+
buttonText: { type: string }
|
|
37330
|
+
coverPhoto: { type: string }
|
|
37331
|
+
- type: object
|
|
37332
|
+
title: LinkedInLeadFormPlatformData
|
|
37333
|
+
required: [adAccountId, headline, description, questions]
|
|
37334
|
+
properties:
|
|
37335
|
+
adAccountId: { type: string, description: "LinkedIn ad account id (resolves the owning organization)." }
|
|
37336
|
+
headline: { type: string, maxLength: 255 }
|
|
37337
|
+
description: { type: string, maxLength: 1500 }
|
|
37338
|
+
state: { type: string, enum: [DRAFT, PUBLISHED], description: "Defaults to DRAFT." }
|
|
37339
|
+
locale: { type: object, properties: { country: { type: string }, language: { type: string } } }
|
|
37340
|
+
consents:
|
|
37341
|
+
type: array
|
|
37342
|
+
items:
|
|
37343
|
+
type: object
|
|
37344
|
+
required: [description]
|
|
37345
|
+
properties:
|
|
37346
|
+
description: { type: string }
|
|
37347
|
+
required: { type: boolean, description: "Whether the viewer must tick this consent to submit. Defaults to false.", default: false }
|
|
37348
|
+
questions:
|
|
37349
|
+
type: array
|
|
37350
|
+
minItems: 1
|
|
37351
|
+
items:
|
|
37352
|
+
oneOf:
|
|
37353
|
+
- type: object
|
|
37354
|
+
required: [kind, name, question]
|
|
37355
|
+
properties:
|
|
37356
|
+
kind: { type: string, enum: [text] }
|
|
37357
|
+
name: { type: string }
|
|
37358
|
+
question: { type: string }
|
|
37359
|
+
required: { type: boolean }
|
|
37360
|
+
responseEditable: { type: boolean }
|
|
37361
|
+
maxResponseLength: { type: integer, description: "Defaults to 300 on LinkedIn's side." }
|
|
37362
|
+
- type: object
|
|
37363
|
+
required: [kind, name, question, choices]
|
|
37364
|
+
properties:
|
|
37365
|
+
kind: { type: string, enum: [multipleChoice] }
|
|
37366
|
+
name: { type: string }
|
|
37367
|
+
question: { type: string }
|
|
37368
|
+
required: { type: boolean }
|
|
37369
|
+
responseEditable: { type: boolean }
|
|
37370
|
+
choices:
|
|
37371
|
+
type: array
|
|
37372
|
+
minItems: 1
|
|
37373
|
+
items:
|
|
37374
|
+
type: object
|
|
37375
|
+
required: [id, text]
|
|
37376
|
+
properties:
|
|
37377
|
+
id: { type: integer }
|
|
37378
|
+
text: { type: string }
|
|
37269
37379
|
responses:
|
|
37270
37380
|
'200':
|
|
37271
37381
|
description: Created form.
|
|
@@ -37283,11 +37393,11 @@ paths:
|
|
|
37283
37393
|
get:
|
|
37284
37394
|
operationId: getLeadForm
|
|
37285
37395
|
tags: ["Lead Gen"]
|
|
37286
|
-
x-platforms: ["meta"]
|
|
37396
|
+
x-platforms: ["meta", "linkedin"]
|
|
37287
37397
|
summary: Get a lead form
|
|
37288
37398
|
parameters:
|
|
37289
|
-
- { name: formId, in: path, required: true, schema: { type: string } }
|
|
37290
|
-
- { name: accountId, in: query, required: true, schema: { type: string } }
|
|
37399
|
+
- { name: formId, in: path, required: true, schema: { type: string }, description: "Numeric form id (Meta leadgen_form id or LinkedIn leadForm id)." }
|
|
37400
|
+
- { name: accountId, in: query, required: true, schema: { type: string }, description: "Connected facebook or linkedin ads account id (selects the platform)." }
|
|
37291
37401
|
responses:
|
|
37292
37402
|
'200':
|
|
37293
37403
|
description: Form metadata.
|
|
@@ -37298,12 +37408,12 @@ paths:
|
|
|
37298
37408
|
delete:
|
|
37299
37409
|
operationId: archiveLeadForm
|
|
37300
37410
|
tags: ["Lead Gen"]
|
|
37301
|
-
x-platforms: ["meta"]
|
|
37411
|
+
x-platforms: ["meta", "linkedin"]
|
|
37302
37412
|
summary: Archive a lead form
|
|
37303
|
-
description:
|
|
37413
|
+
description: "Neither platform hard-deletes a form; this archives it (Meta status=ARCHIVED; LinkedIn state=ARCHIVED via PARTIAL_UPDATE)."
|
|
37304
37414
|
parameters:
|
|
37305
|
-
- { name: formId, in: path, required: true, schema: { type: string } }
|
|
37306
|
-
- { name: accountId, in: query, required: true, schema: { type: string } }
|
|
37415
|
+
- { name: formId, in: path, required: true, schema: { type: string }, description: "Numeric form id (Meta leadgen_form id or LinkedIn leadForm id)." }
|
|
37416
|
+
- { name: accountId, in: query, required: true, schema: { type: string }, description: "Connected facebook or linkedin ads account id (selects the platform)." }
|
|
37307
37417
|
responses:
|
|
37308
37418
|
'200':
|
|
37309
37419
|
description: Archived.
|
|
@@ -34,9 +34,9 @@ describe 'LeadGenApi' do
|
|
|
34
34
|
|
|
35
35
|
# unit tests for archive_lead_form
|
|
36
36
|
# Archive a lead form
|
|
37
|
-
#
|
|
38
|
-
# @param form_id
|
|
39
|
-
# @param account_id
|
|
37
|
+
# Neither platform hard-deletes a form; this archives it (Meta status=ARCHIVED; LinkedIn state=ARCHIVED via PARTIAL_UPDATE).
|
|
38
|
+
# @param form_id Numeric form id (Meta leadgen_form id or LinkedIn leadForm id).
|
|
39
|
+
# @param account_id Connected facebook or linkedin ads account id (selects the platform).
|
|
40
40
|
# @param [Hash] opts the optional parameters
|
|
41
41
|
# @return [ArchiveLeadForm200Response]
|
|
42
42
|
describe 'archive_lead_form test' do
|
|
@@ -47,7 +47,7 @@ describe 'LeadGenApi' do
|
|
|
47
47
|
|
|
48
48
|
# unit tests for create_lead_form
|
|
49
49
|
# Create a lead form
|
|
50
|
-
# Creates a Lead Gen form on the connected Facebook Page (POST /{page-id}/leadgen_forms). NOT idempotent — a retry creates a second form.
|
|
50
|
+
# Creates a Lead Gen form. The form content goes inside `platformSpecificData` for both platforms (the shape is selected by the accountId's platform). Meta: created on the connected Facebook Page (POST /{page-id}/leadgen_forms); the old top-level Meta fields (questions, thankYou*, contextCard, …) are DEPRECATED but still accepted while platformSpecificData is absent — mixing both shapes is a 400. LinkedIn: created on the ad account's Company Page. NOT idempotent — a retry creates a second form. Meta prefilled question types (EMAIL, PHONE, FULL_NAME, …) must omit label/key; CUSTOM questions require both. LinkedIn exposes only free-text and multiple-choice questions via API (prefilled-from-profile fields are Campaign Manager UI-only). Requires the Ads add-on.
|
|
51
51
|
# @param create_lead_form_request
|
|
52
52
|
# @param [Hash] opts the optional parameters
|
|
53
53
|
# @return [CreateLeadForm200Response]
|
|
@@ -72,8 +72,8 @@ describe 'LeadGenApi' do
|
|
|
72
72
|
|
|
73
73
|
# unit tests for get_lead_form
|
|
74
74
|
# Get a lead form
|
|
75
|
-
# @param form_id
|
|
76
|
-
# @param account_id
|
|
75
|
+
# @param form_id Numeric form id (Meta leadgen_form id or LinkedIn leadForm id).
|
|
76
|
+
# @param account_id Connected facebook or linkedin ads account id (selects the platform).
|
|
77
77
|
# @param [Hash] opts the optional parameters
|
|
78
78
|
# @return [GetLeadForm200Response]
|
|
79
79
|
describe 'get_lead_form test' do
|
|
@@ -100,9 +100,10 @@ describe 'LeadGenApi' do
|
|
|
100
100
|
|
|
101
101
|
# unit tests for list_lead_forms
|
|
102
102
|
# List lead forms
|
|
103
|
-
# Lists the Lead Gen forms owned by the connected Facebook Page. Requires the Ads add-on.
|
|
104
|
-
# @param account_id Connected facebook account id.
|
|
103
|
+
# Lists the Lead Gen forms owned by the account. Meta: forms on the connected Facebook Page. LinkedIn: forms owned by the ad account's Company Page — pass `adAccountId` (LinkedIn forms are org-owned). Requires the Ads add-on.
|
|
104
|
+
# @param account_id Connected facebook or linkedin ads account id.
|
|
105
105
|
# @param [Hash] opts the optional parameters
|
|
106
|
+
# @option opts [String] :ad_account_id LinkedIn only: the LinkedIn ad account id (used to resolve the owning organization). Required for LinkedIn.
|
|
106
107
|
# @option opts [Integer] :limit
|
|
107
108
|
# @option opts [String] :cursor
|
|
108
109
|
# @return [ListLeadForms200Response]
|
|
@@ -114,13 +115,14 @@ describe 'LeadGenApi' do
|
|
|
114
115
|
|
|
115
116
|
# unit tests for list_leads
|
|
116
117
|
# List submitted leads
|
|
117
|
-
# Returns
|
|
118
|
+
# Returns submitted Lead Gen leads for your team, newest-first, with keyset pagination on `cursor`. For Meta (default) leads are served from the persisted cache, ingested in real time from the `leadgen` webhook. When `accountId` is a LinkedIn ads account, leads are fetched live from LinkedIn's `leadFormResponses` (LinkedIn has no webhook and enforces 90-day retention, so nothing is persisted) and `adAccountId` is required. Reading LinkedIn responses needs the `r_marketing_leadgen_automation` permission; accounts connected before it was added must reconnect. Requires the Ads add-on.
|
|
118
119
|
# @param [Hash] opts the optional parameters
|
|
119
120
|
# @option opts [String] :form_id Filter to a single lead form.
|
|
120
|
-
# @option opts [String] :account_id Filter to a single connected account.
|
|
121
|
+
# @option opts [String] :account_id Filter to a single connected account. LinkedIn ads accounts switch to the live fetch.
|
|
122
|
+
# @option opts [String] :ad_account_id LinkedIn only: the LinkedIn ad account id whose responses to read (owner-scoped finder).
|
|
121
123
|
# @option opts [Integer] :limit
|
|
122
|
-
# @option opts [Integer] :since Unix seconds; only leads created at/after this
|
|
123
|
-
# @option opts [String] :cursor Keyset cursor from a previous response's pagination.cursor.
|
|
124
|
+
# @option opts [Integer] :since Unix seconds; only leads created at/after this timestamp.
|
|
125
|
+
# @option opts [String] :cursor Keyset cursor from a previous response's pagination.cursor (Meta: AdLead id; LinkedIn: numeric start offset).
|
|
124
126
|
# @return [ListLeads200Response]
|
|
125
127
|
describe 'list_leads test' do
|
|
126
128
|
it 'should work' do
|
|
@@ -0,0 +1,32 @@
|
|
|
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 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for Zernio::CreateLeadFormRequestPlatformSpecificData
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe Zernio::CreateLeadFormRequestPlatformSpecificData do
|
|
21
|
+
describe '.openapi_one_of' do
|
|
22
|
+
it 'lists the items referenced in the oneOf array' do
|
|
23
|
+
expect(described_class.openapi_one_of).to_not be_empty
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
describe '.build' do
|
|
28
|
+
it 'returns the correct model' do
|
|
29
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -105,4 +105,10 @@ describe Zernio::CreateLeadFormRequest do
|
|
|
105
105
|
end
|
|
106
106
|
end
|
|
107
107
|
|
|
108
|
+
describe 'test attribute "platform_specific_data"' do
|
|
109
|
+
it 'should work' do
|
|
110
|
+
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
|
|
108
114
|
end
|
|
@@ -0,0 +1,42 @@
|
|
|
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 'spec_helper'
|
|
14
|
+
require 'json'
|
|
15
|
+
require 'date'
|
|
16
|
+
|
|
17
|
+
# Unit tests for Zernio::LinkedInLeadFormPlatformDataConsentsInner
|
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
19
|
+
# Please update as you see appropriate
|
|
20
|
+
describe Zernio::LinkedInLeadFormPlatformDataConsentsInner do
|
|
21
|
+
#let(:instance) { Zernio::LinkedInLeadFormPlatformDataConsentsInner.new }
|
|
22
|
+
|
|
23
|
+
describe 'test an instance of LinkedInLeadFormPlatformDataConsentsInner' do
|
|
24
|
+
it 'should create an instance of LinkedInLeadFormPlatformDataConsentsInner' do
|
|
25
|
+
# uncomment below to test the instance creation
|
|
26
|
+
#expect(instance).to be_instance_of(Zernio::LinkedInLeadFormPlatformDataConsentsInner)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
describe 'test attribute "description"' 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 "required"' 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
|
+
end
|