klaviyo_sdk 1.0.0.20220329 → 1.0.3.20220329
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/CHANGELOG.md +6 -0
- data/Gemfile +10 -0
- data/README.md +99 -99
- data/Rakefile +10 -0
- data/docs/Campaign.md +38 -0
- data/docs/CampaignsApi.md +707 -0
- data/docs/CheckMembershipRequest.md +22 -0
- data/docs/DataPrivacyApi.md +81 -0
- data/docs/DeleteEmail.md +18 -0
- data/docs/DeletePerson.md +18 -0
- data/docs/DeletePhone.md +18 -0
- data/docs/DeprecatedGetListResponse.md +30 -0
- data/docs/DeprecatedGetListResponseData.md +28 -0
- data/docs/GlobalExclusionResponseData.md +30 -0
- data/docs/IdentifyPayload.md +20 -0
- data/docs/IdentifyPayloadProperties.md +42 -0
- data/docs/InlineObject.md +18 -0
- data/docs/InlineObject3.md +18 -0
- data/docs/InlineObject4.md +18 -0
- data/docs/InlineObject5.md +22 -0
- data/docs/ListsSegmentsApi.md +1198 -0
- data/docs/Metric.md +28 -0
- data/docs/MetricExport.md +32 -0
- data/docs/MetricTimeline.md +24 -0
- data/docs/MetricTimelineData.md +34 -0
- data/docs/MetricsApi.md +329 -0
- data/docs/Person.md +56 -0
- data/docs/PrivacyEmail.md +18 -0
- data/docs/PrivacyId.md +18 -0
- data/docs/PrivacyPhone.md +18 -0
- data/docs/ProfilesApi.md +391 -0
- data/docs/RenderedTemplate.md +24 -0
- data/docs/Template.md +30 -0
- data/docs/TemplatesApi.md +541 -0
- data/docs/TrackIdentifyApi.md +267 -0
- data/docs/TrackPayload.md +24 -0
- data/docs/TrackPayloadCustomerProperties.md +20 -0
- data/docs/TrackPayloadProperties.md +22 -0
- data/git_push.sh +57 -0
- data/klaviyo_sdk-1.0.3.2022.03.29.gem +0 -0
- data/klaviyo_sdk.gemspec +6 -1
- data/lib/klaviyo_sdk/api/campaigns_api.rb +1 -1
- data/lib/klaviyo_sdk/api/data_privacy_api.rb +1 -1
- data/lib/klaviyo_sdk/api/lists_segments_api.rb +1 -1
- data/lib/klaviyo_sdk/api/metrics_api.rb +1 -1
- data/lib/klaviyo_sdk/api/profiles_api.rb +1 -1
- data/lib/klaviyo_sdk/api/templates_api.rb +1 -1
- data/lib/klaviyo_sdk/api/track_identify_api.rb +1 -1
- data/lib/klaviyo_sdk/api_client.rb +2 -2
- data/lib/klaviyo_sdk/api_error.rb +1 -1
- data/lib/klaviyo_sdk/configuration.rb +1 -1
- data/lib/klaviyo_sdk/models/campaign.rb +4 -4
- data/lib/klaviyo_sdk/models/check_membership_request.rb +4 -4
- data/lib/klaviyo_sdk/models/delete_email.rb +4 -4
- data/lib/klaviyo_sdk/models/delete_person.rb +4 -4
- data/lib/klaviyo_sdk/models/delete_phone.rb +4 -4
- data/lib/klaviyo_sdk/models/deprecated_get_list_response.rb +4 -4
- data/lib/klaviyo_sdk/models/deprecated_get_list_response_data.rb +4 -4
- data/lib/klaviyo_sdk/models/global_exclusion_response_data.rb +4 -4
- data/lib/klaviyo_sdk/models/identify_payload.rb +4 -4
- data/lib/klaviyo_sdk/models/identify_payload_properties.rb +4 -4
- data/lib/klaviyo_sdk/models/inline_object.rb +9 -4
- data/lib/klaviyo_sdk/models/inline_object3.rb +4 -4
- data/lib/klaviyo_sdk/models/inline_object4.rb +4 -4
- data/lib/klaviyo_sdk/models/inline_object5.rb +4 -4
- data/lib/klaviyo_sdk/models/metric.rb +4 -4
- data/lib/klaviyo_sdk/models/metric_export.rb +4 -4
- data/lib/klaviyo_sdk/models/metric_timeline.rb +4 -4
- data/lib/klaviyo_sdk/models/metric_timeline_data.rb +4 -4
- data/lib/klaviyo_sdk/models/person.rb +4 -4
- data/lib/klaviyo_sdk/models/person.rb.bak +4 -4
- data/lib/klaviyo_sdk/models/privacy_email.rb +4 -4
- data/lib/klaviyo_sdk/models/privacy_id.rb +4 -4
- data/lib/klaviyo_sdk/models/privacy_phone.rb +4 -4
- data/lib/klaviyo_sdk/models/rendered_template.rb +4 -4
- data/lib/klaviyo_sdk/models/template.rb +4 -4
- data/lib/klaviyo_sdk/models/track_payload.rb +4 -4
- data/lib/klaviyo_sdk/models/track_payload_customer_properties.rb +4 -4
- data/lib/klaviyo_sdk/models/track_payload_properties.rb +4 -4
- data/lib/klaviyo_sdk/version.rb +1 -1
- data/lib/klaviyo_sdk.rb +7 -7
- data/spec/api/campaigns_api_spec.rb +165 -0
- data/spec/api/data_privacy_api_spec.rb +47 -0
- data/spec/api/lists_segments_api_spec.rb +239 -0
- data/spec/api/metrics_api_spec.rb +96 -0
- data/spec/api/profiles_api_spec.rb +103 -0
- data/spec/api/templates_api_spec.rb +130 -0
- data/spec/api/track_identify_api_spec.rb +83 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/campaign_spec.rb +94 -0
- data/spec/models/check_membership_request_spec.rb +46 -0
- data/spec/models/delete_email_spec.rb +34 -0
- data/spec/models/delete_person_spec.rb +34 -0
- data/spec/models/delete_phone_spec.rb +34 -0
- data/spec/models/deprecated_get_list_response_data_spec.rb +64 -0
- data/spec/models/deprecated_get_list_response_spec.rb +70 -0
- data/spec/models/global_exclusion_response_data_spec.rb +70 -0
- data/spec/models/identify_payload_properties_spec.rb +106 -0
- data/spec/models/identify_payload_spec.rb +40 -0
- data/spec/models/inline_object3_spec.rb +34 -0
- data/spec/models/inline_object4_spec.rb +34 -0
- data/spec/models/inline_object5_spec.rb +46 -0
- data/spec/models/inline_object_spec.rb +34 -0
- data/spec/models/metric_export_spec.rb +76 -0
- data/spec/models/metric_spec.rb +64 -0
- data/spec/models/metric_timeline_data_spec.rb +82 -0
- data/spec/models/metric_timeline_spec.rb +52 -0
- data/spec/models/person_spec.rb +148 -0
- data/spec/models/privacy_email_spec.rb +34 -0
- data/spec/models/privacy_id_spec.rb +34 -0
- data/spec/models/privacy_phone_spec.rb +34 -0
- data/spec/models/rendered_template_spec.rb +52 -0
- data/spec/models/template_spec.rb +70 -0
- data/spec/models/track_payload_customer_properties_spec.rb +40 -0
- data/spec/models/track_payload_properties_spec.rb +46 -0
- data/spec/models/track_payload_spec.rb +52 -0
- data/spec/spec_helper.rb +111 -0
- metadata +80 -3
@@ -0,0 +1,239 @@
|
|
1
|
+
=begin
|
2
|
+
#Klaviyo API
|
3
|
+
|
4
|
+
#Empowering creators to own their destiny
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 2022.03.29
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.4.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
|
16
|
+
# Unit tests for Klaviyo::ListsSegmentsApi
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe 'ListsSegmentsApi' do
|
20
|
+
before do
|
21
|
+
# run before each test
|
22
|
+
@api_instance = Klaviyo::ListsSegmentsApi.new
|
23
|
+
end
|
24
|
+
|
25
|
+
after do
|
26
|
+
# run after each test
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test an instance of ListsSegmentsApi' do
|
30
|
+
it 'should create an instance of ListsSegmentsApi' do
|
31
|
+
expect(@api_instance).to be_instance_of(Klaviyo::ListsSegmentsApi)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# unit tests for add_members
|
36
|
+
# Add Members to a List
|
37
|
+
# Adds profiles to a list. This endpoint is functionally equivalent to adding profiles to a list via a CSV upload and will immediately add profiles to the list. If you would like to subscribe profiles to a list and use the double opt-in settings for the list, please use the subscribe endpoint.
|
38
|
+
# @param list_id
|
39
|
+
# @param [Hash] opts the optional parameters
|
40
|
+
# @option opts [InlineObject4] :inline_object4
|
41
|
+
# @return [Array<Hash<String, Object>>]
|
42
|
+
describe 'add_members test' do
|
43
|
+
it 'should work' do
|
44
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
# unit tests for create_list
|
49
|
+
# Create List
|
50
|
+
# Creates a new list.
|
51
|
+
# @param list_name
|
52
|
+
# @param [Hash] opts the optional parameters
|
53
|
+
# @return [Hash<String, Object>]
|
54
|
+
describe 'create_list test' do
|
55
|
+
it 'should work' do
|
56
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
# unit tests for delete_list
|
61
|
+
# Delete List
|
62
|
+
# Deletes a list from an account. This is a destructive operation and cannot be undone. It will also remove flow triggers associated with the list.
|
63
|
+
# @param list_id
|
64
|
+
# @param [Hash] opts the optional parameters
|
65
|
+
# @return [nil]
|
66
|
+
describe 'delete_list test' do
|
67
|
+
it 'should work' do
|
68
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
# unit tests for exclude_globally
|
73
|
+
# Exclude Profile From All Email
|
74
|
+
# Marks a person as excluded from all email. This works the same way as manually excluding someone via the excluded people page. Someone who is excluded will no longer receive any campaigns or flow emails.
|
75
|
+
# @param email
|
76
|
+
# @param [Hash] opts the optional parameters
|
77
|
+
# @return [Hash<String, Object>]
|
78
|
+
describe 'exclude_globally test' do
|
79
|
+
it 'should work' do
|
80
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
# unit tests for get_global_exclusions
|
85
|
+
# Get Global Exclusions & Unsubscribes
|
86
|
+
# Returns global exclusions/unsubscribes. Global exclusions are distinct from list exclusions in that these email addresses will not receive any emails from any list. Typically, when someone unsubscribes from a campaign, they are only unsubscribed from that list and are not globally unsubscribed.
|
87
|
+
# @param [Hash] opts the optional parameters
|
88
|
+
# @option opts [String] :reason Filter results based on the reason for someone being excluded. The possible values are `unsubscribed`, `bounced`, `invalid_email`, `reported_spam` and `manually_excluded`. Only a single value may be specified at a time. Defaults to return all profiles regardless of reason.
|
89
|
+
# @option opts [String] :sort Sort order to apply to results, either ascending or descending. Valid values are `asc` or `desc`. Defaults to `asc`.
|
90
|
+
# @option opts [Integer] :count For pagination, the number of results to return. Default = 500
|
91
|
+
# @option opts [Integer] :page For pagination, which page of results to return. Default = 0
|
92
|
+
# @return [GlobalExclusionResponseData]
|
93
|
+
describe 'get_global_exclusions test' do
|
94
|
+
it 'should work' do
|
95
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
# unit tests for get_list_exclusions
|
100
|
+
# Get All Exclusions for a List
|
101
|
+
# Gets all of the emails and phone numbers that have been excluded from a list along with the exclusion reasons and exclusion time. This endpoint uses batching to return the records, so for a large list multiple calls will need to be made to get all of the records.
|
102
|
+
# @param list_id
|
103
|
+
# @param [Hash] opts the optional parameters
|
104
|
+
# @option opts [Integer] :marker A marker value returned by a previous GET call. Use this to grab the next batch of records.
|
105
|
+
# @return [Hash<String, Object>]
|
106
|
+
describe 'get_list_exclusions test' do
|
107
|
+
it 'should work' do
|
108
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
# unit tests for get_list_info
|
113
|
+
# Get List Info
|
114
|
+
# Returns information about a list.
|
115
|
+
# @param list_id
|
116
|
+
# @param [Hash] opts the optional parameters
|
117
|
+
# @return [Hash<String, Object>]
|
118
|
+
describe 'get_list_info test' do
|
119
|
+
it 'should work' do
|
120
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
# unit tests for get_list_members
|
125
|
+
# Check if Profiles Are in a List
|
126
|
+
# Checks if one or more emails, phone numbers, or push tokens are in a given list. No distinction is made between a person not being in a given list, and not being present in Klaviyo at all. Can check up to a maximum of 100 emails at a time.
|
127
|
+
# @param list_id
|
128
|
+
# @param [Hash] opts the optional parameters
|
129
|
+
# @option opts [CheckMembershipRequest] :check_membership_request
|
130
|
+
# @return [Array<Hash<String, Object>>]
|
131
|
+
describe 'get_list_members test' do
|
132
|
+
it 'should work' do
|
133
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
# unit tests for get_list_subscriptions
|
138
|
+
# Check if Profiles Are in a List and not Suppressed
|
139
|
+
# Checks if one or more emails are in a given list and not suppressed. No distinction is made between a person not being in a given list, and not being present in Klaviyo at all. Can check up to a maximum of 100 emails at a time.
|
140
|
+
# @param list_id
|
141
|
+
# @param [Hash] opts the optional parameters
|
142
|
+
# @option opts [CheckMembershipRequest] :check_membership_request
|
143
|
+
# @return [Array<Hash<String, Object>>]
|
144
|
+
describe 'get_list_subscriptions test' do
|
145
|
+
it 'should work' do
|
146
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
150
|
+
# unit tests for get_lists
|
151
|
+
# Get Lists
|
152
|
+
# Returns a listing of all of the lists in an account.
|
153
|
+
# @param [Hash] opts the optional parameters
|
154
|
+
# @return [Array<Hash<String, Object>>]
|
155
|
+
describe 'get_lists test' do
|
156
|
+
it 'should work' do
|
157
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
158
|
+
end
|
159
|
+
end
|
160
|
+
|
161
|
+
# unit tests for get_members
|
162
|
+
# Get List and Segment Members
|
163
|
+
# Gets all of the emails, phone numbers, and push tokens for profiles in a given list or segment
|
164
|
+
# @param list_or_segment_id
|
165
|
+
# @param [Hash] opts the optional parameters
|
166
|
+
# @option opts [Integer] :marker A marker value returned by a previous GET call. Use this to grab the next batch of records.
|
167
|
+
# @return [Hash<String, Object>]
|
168
|
+
describe 'get_members test' do
|
169
|
+
it 'should work' do
|
170
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
171
|
+
end
|
172
|
+
end
|
173
|
+
|
174
|
+
# unit tests for get_segment_members
|
175
|
+
# Check if Profiles Are in a Segment
|
176
|
+
# Checks if one or more emails, phone numbers, or push tokens are in a given segment. No distinction is made between a person not being in a given segment, and not being present in Klaviyo at all. Can check up to a maximum of 100 emails at a time.
|
177
|
+
# @param segment_id
|
178
|
+
# @param [Hash] opts the optional parameters
|
179
|
+
# @option opts [CheckMembershipRequest] :check_membership_request
|
180
|
+
# @return [Array<Hash<String, Object>>]
|
181
|
+
describe 'get_segment_members test' do
|
182
|
+
it 'should work' do
|
183
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
184
|
+
end
|
185
|
+
end
|
186
|
+
|
187
|
+
# unit tests for remove_members
|
188
|
+
# Remove Profiles From List
|
189
|
+
# Removes profiles from a list.
|
190
|
+
# @param list_id
|
191
|
+
# @param [Hash] opts the optional parameters
|
192
|
+
# @option opts [InlineObject5] :inline_object5
|
193
|
+
# @return [nil]
|
194
|
+
describe 'remove_members test' do
|
195
|
+
it 'should work' do
|
196
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
197
|
+
end
|
198
|
+
end
|
199
|
+
|
200
|
+
# unit tests for subscribe
|
201
|
+
# Subscribe Profiles to List
|
202
|
+
# Subscribes profiles to a list. Profiles will be single or double opted into the specified list in accordance with that list’s settings. **Note:** If you have double opt-in enabled (default behavior), users will not be added to list until they opt-in, and so API will respond with an empty list: `[]`
|
203
|
+
# @param list_id
|
204
|
+
# @param [Hash] opts the optional parameters
|
205
|
+
# @option opts [InlineObject3] :inline_object3
|
206
|
+
# @return [Array<Object>]
|
207
|
+
describe 'subscribe test' do
|
208
|
+
it 'should work' do
|
209
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
210
|
+
end
|
211
|
+
end
|
212
|
+
|
213
|
+
# unit tests for unsubscribe
|
214
|
+
# Unsubscribe Profiles From List
|
215
|
+
# Unsubscribes and removes profiles from a list.
|
216
|
+
# @param list_id
|
217
|
+
# @param [Hash] opts the optional parameters
|
218
|
+
# @option opts [Hash<String, Object>] :request_body Unsubscribe and remove profiles from a list.
|
219
|
+
# @return [nil]
|
220
|
+
describe 'unsubscribe test' do
|
221
|
+
it 'should work' do
|
222
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
223
|
+
end
|
224
|
+
end
|
225
|
+
|
226
|
+
# unit tests for update_list_name
|
227
|
+
# Update List Name
|
228
|
+
# Updates a list's name.
|
229
|
+
# @param list_id
|
230
|
+
# @param list_name
|
231
|
+
# @param [Hash] opts the optional parameters
|
232
|
+
# @return [nil]
|
233
|
+
describe 'update_list_name test' do
|
234
|
+
it 'should work' do
|
235
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
236
|
+
end
|
237
|
+
end
|
238
|
+
|
239
|
+
end
|
@@ -0,0 +1,96 @@
|
|
1
|
+
=begin
|
2
|
+
#Klaviyo API
|
3
|
+
|
4
|
+
#Empowering creators to own their destiny
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 2022.03.29
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.4.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
|
16
|
+
# Unit tests for Klaviyo::MetricsApi
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe 'MetricsApi' do
|
20
|
+
before do
|
21
|
+
# run before each test
|
22
|
+
@api_instance = Klaviyo::MetricsApi.new
|
23
|
+
end
|
24
|
+
|
25
|
+
after do
|
26
|
+
# run after each test
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test an instance of MetricsApi' do
|
30
|
+
it 'should create an instance of MetricsApi' do
|
31
|
+
expect(@api_instance).to be_instance_of(Klaviyo::MetricsApi)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# unit tests for get_metrics
|
36
|
+
# Get Metrics Info
|
37
|
+
# Returns a list of all the metrics in your account.
|
38
|
+
# @param [Hash] opts the optional parameters
|
39
|
+
# @option opts [Integer] :page For pagination, which page of results to return. Default = 0
|
40
|
+
# @option opts [Integer] :count For pagination, the number of results to return. Default = 50 ; Max = 100
|
41
|
+
# @return [Hash<String, Object>]
|
42
|
+
describe 'get_metrics test' do
|
43
|
+
it 'should work' do
|
44
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
# unit tests for metric_export
|
49
|
+
# Query Event Data
|
50
|
+
# Exports event data from Klaviyo, optionally filtering and segmenting on available event properties. Note that the only comparison operator currently supported is `=`. To ensure a correct response, enter parameters in the curl request as they are ordered below:
|
51
|
+
# @param metric_id
|
52
|
+
# @param [Hash] opts the optional parameters
|
53
|
+
# @option opts [String] :start_date Beginning of timeframe to pull event data for. The default value is 1 month ago. Can also accept a 10-digit UNIX timestamp. When sending a `start_date`, you must also send an `end_date` Ex: `1610524800` OR `2021-01-13`
|
54
|
+
# @option opts [String] :end_date End of timeframe to pull event data for. The default is the current day, or 1 month from start_date, whichever is sooner. Can also accept a 10-digit UNIX timestamp. When sending an `end_date`, you must also send a `start_date`. Must be *at most* 31 days after `start_date` Ex: `1612080000` OR `2021-01-31`
|
55
|
+
# @option opts [String] :unit Granularity to bucket data points into - one of `day`, `week`, or `month`. Defaults to `day`.
|
56
|
+
# @option opts [String] :measurement Type of metric to fetch - one of `unique`, `count`, `value`, or `sum`. Defaults to `count`. For `sum` a property name to operate on must be supplied as a JSON-encoded list like `[\"sum\",\"ItemCount\"]`
|
57
|
+
# @option opts [String] :where Optional, JSON-encoded list. Conditions to use to filter the set of events. A max of 1 condition can be given. `where` and `by` parameters cannot be specified at the same time. ex: `[[\"$attributed_flow\",\"=\",\"FLOW_ID\"]]`
|
58
|
+
# @option opts [String] :by The name of a property to segment the event data on. `where` and `by` parameters cannot be specified at the same time. Cannot be used alongside `where` parameter.
|
59
|
+
# @option opts [Integer] :count Maximum number of segments to return. Default = 25, **MAX = 1000**
|
60
|
+
# @return [MetricExport]
|
61
|
+
describe 'metric_export test' do
|
62
|
+
it 'should work' do
|
63
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
# unit tests for metric_timeline
|
68
|
+
# Get Events for a Specific Metric
|
69
|
+
# Returns a batched timeline for one specific metric.
|
70
|
+
# @param metric_id
|
71
|
+
# @param [Hash] opts the optional parameters
|
72
|
+
# @option opts [String] :since Either a 10-digit Unix timestamp (UTC) to use as starting datetime, OR a pagination token obtained from the `next` attribute of a prior API call. For backwards compatibility, UUIDs will continue to be supported for a limited time. Defaults to current time.
|
73
|
+
# @option opts [Integer] :count Number of events to return in a batch. Max = 100
|
74
|
+
# @option opts [String] :sort Sort order to apply to timeline, either descending or ascending. Valid values are `desc` or `asc`. Defaults to `desc`. Always descending when `since` is not sent, as `since` defaults to current time.
|
75
|
+
# @return [MetricTimeline]
|
76
|
+
describe 'metric_timeline test' do
|
77
|
+
it 'should work' do
|
78
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
# unit tests for metrics_timeline
|
83
|
+
# Get Events for All Metrics
|
84
|
+
# Returns a batched timeline of all events in your account.
|
85
|
+
# @param [Hash] opts the optional parameters
|
86
|
+
# @option opts [String] :since Either a 10-digit Unix timestamp (UTC) to use as starting datetime, OR a pagination token obtained from the next attribute of a prior API call. For backwards compatibility, UUIDs will continue to be supported for a limited time. Defaults to current time.
|
87
|
+
# @option opts [Integer] :count Number of events to return in a batch. Default = 50, Max = 100
|
88
|
+
# @option opts [String] :sort Sort order to apply to timeline, either descending or ascending. Valid values are `desc` or `asc`. Defaults to `desc`. Always descending when `since` is not sent, as `since` defaults to current time.
|
89
|
+
# @return [MetricTimeline]
|
90
|
+
describe 'metrics_timeline test' do
|
91
|
+
it 'should work' do
|
92
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
end
|
@@ -0,0 +1,103 @@
|
|
1
|
+
=begin
|
2
|
+
#Klaviyo API
|
3
|
+
|
4
|
+
#Empowering creators to own their destiny
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 2022.03.29
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.4.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
|
16
|
+
# Unit tests for Klaviyo::ProfilesApi
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe 'ProfilesApi' do
|
20
|
+
before do
|
21
|
+
# run before each test
|
22
|
+
@api_instance = Klaviyo::ProfilesApi.new
|
23
|
+
end
|
24
|
+
|
25
|
+
after do
|
26
|
+
# run after each test
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test an instance of ProfilesApi' do
|
30
|
+
it 'should create an instance of ProfilesApi' do
|
31
|
+
expect(@api_instance).to be_instance_of(Klaviyo::ProfilesApi)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# unit tests for exchange
|
36
|
+
# Exchange ID for Profile ID
|
37
|
+
# Klaviyo's web tracking uses an encrypted identifier. However, there are many use cases that require developers to have access to a given profile's email or phone number. In such cases, developers can use this operation to exchange an encrypted identifier for a profile ID, which they can then use to retrieve the full profile data (by making a subsequent request to the `get-profiles` operation). The `exchange_id` takes the following form: `<IDENTIFIER>.<COMPANY_ID>` The `exchange_id` appears in the url as follows: `?_kx=<IDENTIFIER>.<COMPANY_ID>`
|
38
|
+
# @param [Hash] opts the optional parameters
|
39
|
+
# @option opts [InlineObject] :inline_object
|
40
|
+
# @return [Hash<String, Object>]
|
41
|
+
describe 'exchange test' do
|
42
|
+
it 'should work' do
|
43
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
# unit tests for get_profile
|
48
|
+
# Get Profile
|
49
|
+
# Retrieves all the data attributes for a person, based on the Klaviyo Person ID.
|
50
|
+
# @param person_id
|
51
|
+
# @param [Hash] opts the optional parameters
|
52
|
+
# @return [Person]
|
53
|
+
describe 'get_profile test' do
|
54
|
+
it 'should work' do
|
55
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
# unit tests for profile_metric_timeline
|
60
|
+
# Get Profile's Events for a Specific Metric
|
61
|
+
# Returns a person's batched timeline for one specific event type.
|
62
|
+
# @param person_id
|
63
|
+
# @param metric_id
|
64
|
+
# @param [Hash] opts the optional parameters
|
65
|
+
# @option opts [String] :since Either a 10-digit Unix timestamp (UTC) to use as starting datetime, OR a pagination token obtained from the next attribute of a prior API call. For backwards compatibility, UUIDs will continue to be supported for a limited time. Defaults to current time.
|
66
|
+
# @option opts [Integer] :count Number of events to return in a batch.
|
67
|
+
# @option opts [String] :sort Sort order to apply to timeline, either descending or ascending. Valid values are `desc` or `asc`. Defaults to `desc`.
|
68
|
+
# @return [MetricTimeline]
|
69
|
+
describe 'profile_metric_timeline test' do
|
70
|
+
it 'should work' do
|
71
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
# unit tests for profile_metrics_timeline
|
76
|
+
# Get Profile's Events for all Metrics
|
77
|
+
# Returns a batched timeline of all events for a person.
|
78
|
+
# @param person_id
|
79
|
+
# @param [Hash] opts the optional parameters
|
80
|
+
# @option opts [String] :since Either a 10-digit Unix timestamp (UTC) to use as starting datetime, OR a pagination token obtained from the next attribute of a prior API call. For backwards compatibility, UUIDs will continue to be supported for a limited time. Defaults to current time.
|
81
|
+
# @option opts [Integer] :count Number of events to return in a batch. Default = 50, Max = 100
|
82
|
+
# @option opts [String] :sort Sort order to apply to timeline, either descending or ascending. Valid values are `desc` or `asc`. Defaults to `desc`. Always descending when `since` is not sent, as `since` defaults to current time.
|
83
|
+
# @return [MetricTimeline]
|
84
|
+
describe 'profile_metrics_timeline test' do
|
85
|
+
it 'should work' do
|
86
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
# unit tests for update_profile
|
91
|
+
# Update Profile
|
92
|
+
# NOTE: If you are interested in creating or updating profiles in Klaviyo, you should be using the Identify API instead. The best use-case for this route is changing a profiles's email address or other primary identifier after a profile already exists in Klaviyo. Add or update one more more attributes for a Person, based on the Klaviyo Person ID. If a property already exists, it will be updated. If a property is not set for that record, it will be created. You can update any attribute, by sending one or more attributes along their new values, as query parameters. Recommended attributes for this endpoint: `$email`, `$phone_number`, `$id`
|
93
|
+
# @param person_id
|
94
|
+
# @param [Hash] opts the optional parameters
|
95
|
+
# @option opts [Hash<String, Object>] :params
|
96
|
+
# @return [Person]
|
97
|
+
describe 'update_profile test' do
|
98
|
+
it 'should work' do
|
99
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
end
|
@@ -0,0 +1,130 @@
|
|
1
|
+
=begin
|
2
|
+
#Klaviyo API
|
3
|
+
|
4
|
+
#Empowering creators to own their destiny
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 2022.03.29
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.4.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
|
16
|
+
# Unit tests for Klaviyo::TemplatesApi
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe 'TemplatesApi' do
|
20
|
+
before do
|
21
|
+
# run before each test
|
22
|
+
@api_instance = Klaviyo::TemplatesApi.new
|
23
|
+
end
|
24
|
+
|
25
|
+
after do
|
26
|
+
# run after each test
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test an instance of TemplatesApi' do
|
30
|
+
it 'should create an instance of TemplatesApi' do
|
31
|
+
expect(@api_instance).to be_instance_of(Klaviyo::TemplatesApi)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# unit tests for clone_template
|
36
|
+
# Clone Template
|
37
|
+
# Creates a copy of a given template with a new name.
|
38
|
+
# @param template_id
|
39
|
+
# @param name The new name of the email template.
|
40
|
+
# @param [Hash] opts the optional parameters
|
41
|
+
# @return [Template]
|
42
|
+
describe 'clone_template test' do
|
43
|
+
it 'should work' do
|
44
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
# unit tests for create_template
|
49
|
+
# Create New Template
|
50
|
+
# Creates a new email template.
|
51
|
+
# @param name The name of the email template.
|
52
|
+
# @param html
|
53
|
+
# @param [Hash] opts the optional parameters
|
54
|
+
# @return [Template]
|
55
|
+
describe 'create_template test' do
|
56
|
+
it 'should work' do
|
57
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
# unit tests for delete_template
|
62
|
+
# Delete Template
|
63
|
+
# Deletes a given template.
|
64
|
+
# @param template_id
|
65
|
+
# @param [Hash] opts the optional parameters
|
66
|
+
# @return [Hash<String, Object>]
|
67
|
+
describe 'delete_template test' do
|
68
|
+
it 'should work' do
|
69
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
# unit tests for get_templates
|
74
|
+
# Get All Templates
|
75
|
+
# Returns a list of all the email templates you've created. The templates are returned in sorted order by `name`.
|
76
|
+
# @param [Hash] opts the optional parameters
|
77
|
+
# @option opts [Integer] :page For pagination, which page of results to return. Default = 0
|
78
|
+
# @option opts [Integer] :count For pagination, the number of results to return. Max = 100
|
79
|
+
# @return [Hash<String, Object>]
|
80
|
+
describe 'get_templates test' do
|
81
|
+
it 'should work' do
|
82
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
# unit tests for render_template
|
87
|
+
# Render Template
|
88
|
+
# Renders the specified template with the provided data and return HTML and text versions of the email.
|
89
|
+
# @param template_id
|
90
|
+
# @param [Hash] opts the optional parameters
|
91
|
+
# @option opts [String] :context This is the context your email template will be rendered with. Email templates are rendered with contexts in a similar manner to how Django templates are rendered. This means that nested template variables can be referenced via dot notation and template variables without corresponding context values are treated as falsy and output nothing.
|
92
|
+
# @return [RenderedTemplate]
|
93
|
+
describe 'render_template test' do
|
94
|
+
it 'should work' do
|
95
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
99
|
+
# unit tests for send_template
|
100
|
+
# Render and Send Template
|
101
|
+
# Renders the specified template with the provided data and send the contents in an email via the service specified. This API is intended to test templates only, and is rate limited to the following thresholds: 100/hour, 1,000/day.
|
102
|
+
# @param template_id
|
103
|
+
# @param from_email
|
104
|
+
# @param from_name
|
105
|
+
# @param subject
|
106
|
+
# @param to **Mixed**. string, or JSON encoded array of objects with \\\"email\\\" and \\\"name\\\" keys. `abraham.lincoln@klaviyo.com` OR `[{\\\"name\\\":\\\"Abraham Lincoln\\\",\\\"email\\\":\\\"abraham.lincoln@klaviyo.com\\\"}]`
|
107
|
+
# @param [Hash] opts the optional parameters
|
108
|
+
# @option opts [String] :context Optional, JSON object. This is the context your email template will be rendered with. Email templates are rendered with contexts in a similar manner to how Django templates are rendered. This means that nested template variables can be referenced via dot notation and template variables without corresponding context values are treated as falsy and output nothing. ex: `{ \\\"name\\\" : \\\"George Washington\\\", \\\"state\\\" : \\\"VA\\\" }`
|
109
|
+
# @return [RenderedTemplate]
|
110
|
+
describe 'send_template test' do
|
111
|
+
it 'should work' do
|
112
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
# unit tests for update_template
|
117
|
+
# Update Template
|
118
|
+
# Updates the name and/or HTML content of a template. Only updates imported HTML templates; does not currently update drag & drop templates.
|
119
|
+
# @param template_id
|
120
|
+
# @param [Hash] opts the optional parameters
|
121
|
+
# @option opts [String] :name The new name of the email template.
|
122
|
+
# @option opts [String] :html The new HTML content for this template.
|
123
|
+
# @return [Template]
|
124
|
+
describe 'update_template test' do
|
125
|
+
it 'should work' do
|
126
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
end
|
@@ -0,0 +1,83 @@
|
|
1
|
+
=begin
|
2
|
+
#Klaviyo API
|
3
|
+
|
4
|
+
#Empowering creators to own their destiny
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 2022.03.29
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.4.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
|
16
|
+
# Unit tests for Klaviyo::TrackIdentifyApi
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe 'TrackIdentifyApi' do
|
20
|
+
before do
|
21
|
+
# run before each test
|
22
|
+
@api_instance = Klaviyo::TrackIdentifyApi.new
|
23
|
+
end
|
24
|
+
|
25
|
+
after do
|
26
|
+
# run after each test
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test an instance of TrackIdentifyApi' do
|
30
|
+
it 'should create an instance of TrackIdentifyApi' do
|
31
|
+
expect(@api_instance).to be_instance_of(Klaviyo::TrackIdentifyApi)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# unit tests for identify_get
|
36
|
+
# Identify Profile (Legacy)
|
37
|
+
# This endpoint is also used to identify a profile and update its properties without an associated event. It takes as input the same payload as the above POST request, but as a base64-encoded string passed as a query parameter. NOTE: This is offered for backwards compatibility; we recommend all new implementations use the POST approach above. **EXAMPLE:** ``` { \"token\": \"PUBLIC_KEY\", \"properties\": { \"$email\": \"abraham.lincoln@klaviyo.com\", \"$first_name\": \"Abraham\", \"$last_name\": \"Lincoln\", \"$city\": \"Springfield\", \"$region\": \"Illinois\" } } ``` Gets encoded into the following string, which is passed into the `data` parameter: `eyJ0b2tlbiI6ICJQVUJMSUNfS0VZIiwicHJvcGVydGllcyI6IHsiJGVtYWlsIjogImFicmFoYW0ubGluY29sbkBrbGF2aXlvLmNvbSIsIiRmaXJzdF9uYW1lIjogIkFicmFoYW0iLCIkbGFzdF9uYW1lIjogIkxpbmNvbG4iLCIkY2l0eSI6ICJTcHJpbmdmaWVsZCIsIiRyZWdpb24iOiAiSWxsaW5vaXMifX0K`
|
38
|
+
# @param data String representation of base64 encoded JSON object
|
39
|
+
# @param [Hash] opts the optional parameters
|
40
|
+
# @return [String]
|
41
|
+
describe 'identify_get test' do
|
42
|
+
it 'should work' do
|
43
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
# unit tests for identify_post
|
48
|
+
# Identify Profile
|
49
|
+
# This endpoint is used to track and update properties about an individual without tracking an associated event. The following data is stored in a JSON object. **JSON OBJECT STRUCTURE:** __token: *string*__ This is your public API key. __properties: *JSON Object or null*__ Properties of the profile to track/update. You must identify the person by their email using a $email key (or by their phone number using a `$phone_number` key if you have SMS-only contacts). Other than that, you can include any data you want and it can then be used to create segments of people. For example, if you wanted to create a list of people on trial plans, include a person's plan type in this JSON object so you can use that information later. **SPECIAL FIELDS:** The Klaviyo CRM has the following special fields you can set for customer **properties** with the **Identify** endpoint, to unlock additional functionality: **$email:** _string_ **$first_name:** _string_ **$last_name:** _string_ **$phone_number:** _string; eg: \"+13239169023\"_ **$city:** _string_ **$region:** _string; state, or other region_ **$country:** _string_ **$zip:** _string_ **$image:** _string; url to a photo of a person_ **$consent:** _list of strings; eg: ['sms', 'email', 'web', 'directmail', 'mobile']_ **EXAMPLE:** ``` { \"token\": \"PUBLIC_KEY\", \"properties\": { \"$email\": \"abraham.lincoln@klaviyo.com\", \"$first_name\": \"Abraham\", \"$last_name\": \"Lincoln\", \"$city\": \"Springfield\", \"$region\": \"Illinois\" } }
|
50
|
+
# @param data
|
51
|
+
# @param [Hash] opts the optional parameters
|
52
|
+
# @return [String]
|
53
|
+
describe 'identify_post test' do
|
54
|
+
it 'should work' do
|
55
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
# unit tests for track_get
|
60
|
+
# Track Profile Activity (Legacy)
|
61
|
+
# This endpoint is also used to track a profile's activity. It takes as input the same payload as the above POST request, but as a base64-encoded string passed as a query parameter. NOTE: This is offered for backwards compatibility; we recommend all new implementations use the POST approach above. **EXAMPLE:** ``` { \"token\": \"PUBLIC_KEY\", \"event\": \"Ordered Product\", \"customer_properties\": { \"$email\": \"abraham.lincoln@klaviyo.com\" }, \"properties\": { \"item_name\": \"Boots\", \"$value\": 100 } } ``` Gets encoded into the following string, which is passed into the `data` parameter: `eyJ0b2tlbiI6ICJQVUJMSUNfS0VZIiwiZXZlbnQiOiAiT3JkZXJlZEl0ZW0iLCJjdXN0b21lcl9wcm9wZXJ0aWVzIjogeyIkZW1haWwiOiAiYWJyYWhhbS5saW5jb2xuQGtsYXZpeW8uY29tIn0sInByb3BlcnRpZXMiOiB7Iml0ZW1fbmFtZSI6ICJCb290cyIsIiR2YWx1ZSI6IDEwMH19`
|
62
|
+
# @param data String representation of base64 encoded JSON object
|
63
|
+
# @param [Hash] opts the optional parameters
|
64
|
+
# @return [String]
|
65
|
+
describe 'track_get test' do
|
66
|
+
it 'should work' do
|
67
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
# unit tests for track_post
|
72
|
+
# Track Profile Activity
|
73
|
+
# This endpoint is used to track a profile's activity. The following data is encoded in a JSON object. NOTE: an account can have up to 200 unique metrics (event types). This endpoint can accept payloads up to approximately 1MB. **JSON OBJECT STRUCTURE:** __token: *string*__ This is your public API key. __event: *string*__ Name of the event you want to track. __customer_properties: *JSON Object or null*__ Properties of the profile that triggered this event. You must identify the person by their email using a $email key (or by their phone number using a `$phone_number` key if you have SMS-only contacts). Other than that, you can include any data you want and it can then be used to create segments of people. For example, if you wanted to create a list of people on trial plans, include a person's plan type in this JSON object so you can use that information later. __properties: *optional; JSON Object or null*__ Properties of this event. Any properties included here can be used for creating segments later For example, if you track an event called \"Ordered Product\" you could include a property for item type (e.g. image, article, etc.), size, etc. __time: *optional; 10-digit UNIX timestamp or null*__ When this event occurred. By default, Klaviyo assumes events happen when a request is made. If you'd like to track an event that happened in past, use this property. **SPECIAL FIELDS:** The Klaviyo CRM has the following special fields you can set for **customer_properties** with the **Track** endpoint, to unlock additional functionality: **$email:** _string_ **$first_name:** _string_ **$last_name:** _string_ **$phone_number:** _string; eg: \"+13239169023\"_ **$city:** _string_ **$region:** _string; state, or other region_ **$country:** _string_ **$zip:** _string_ **$image:** _string; url to a photo of a person_ **$consent:** _list of strings; eg: ['sms', 'email', 'web', 'directmail', 'mobile']_ You can also set the following special fields in event **properties** with the **Track** endpoint: **$event_id:** _a unique identifier for an event_ **$value:** _a numeric value to associate with this event (e.g. the dollar value of a purchase)_ **EXAMPLE:** ``` { \"token\": \"PUBLIC_KEY\", \"event\": \"Ordered Product\", \"customer_properties\": { \"$email\": \"abraham.lincoln@klaviyo.com\" }, \"properties\": { \"item_name\": \"Boots\", \"$value\": 100 } }
|
74
|
+
# @param data
|
75
|
+
# @param [Hash] opts the optional parameters
|
76
|
+
# @return [String]
|
77
|
+
describe 'track_post test' do
|
78
|
+
it 'should work' do
|
79
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
end
|