klaviyo-api-sdk 10.0.0 → 11.1.0
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 +11 -0
- data/README.md +382 -136
- data/klaviyo-api-sdk.gemspec +1 -1
- data/lib/klaviyo-api-sdk/api/accounts_api.rb +2 -2
- data/lib/klaviyo-api-sdk/api/campaigns_api.rb +41 -23
- data/lib/klaviyo-api-sdk/api/catalogs_api.rb +82 -76
- data/lib/klaviyo-api-sdk/api/coupons_api.rb +111 -93
- data/lib/klaviyo-api-sdk/api/data_privacy_api.rb +1 -1
- data/lib/klaviyo-api-sdk/api/events_api.rb +128 -116
- data/lib/klaviyo-api-sdk/api/flows_api.rb +199 -169
- data/lib/klaviyo-api-sdk/api/forms_api.rb +19 -7
- data/lib/klaviyo-api-sdk/api/images_api.rb +5 -5
- data/lib/klaviyo-api-sdk/api/lists_api.rb +391 -337
- data/lib/klaviyo-api-sdk/api/metrics_api.rb +151 -115
- data/lib/klaviyo-api-sdk/api/profiles_api.rb +170 -119
- data/lib/klaviyo-api-sdk/api/reporting_api.rb +49 -7
- data/lib/klaviyo-api-sdk/api/reviews_api.rb +2 -2
- data/lib/klaviyo-api-sdk/api/segments_api.rb +170 -146
- data/lib/klaviyo-api-sdk/api/tags_api.rb +108 -42
- data/lib/klaviyo-api-sdk/api/templates_api.rb +12 -12
- data/lib/klaviyo-api-sdk/api/tracking_settings_api.rb +3 -3
- data/lib/klaviyo-api-sdk/api/webhooks_api.rb +7 -7
- data/lib/klaviyo-api-sdk/api_client.rb +1 -1
- data/lib/klaviyo-api-sdk/configuration.rb +18 -9
- data/lib/klaviyo-api-sdk/models/campaign_send_job_partial_update_query_resource_object_attributes.rb +34 -0
- data/lib/klaviyo-api-sdk/models/device_metadata.rb +2 -2
- data/lib/klaviyo-api-sdk/models/email_unsubscription_parameters.rb +224 -0
- data/lib/klaviyo-api-sdk/models/html_block_data.rb +4 -14
- data/lib/klaviyo-api-sdk/models/profile_subscription_delete_query_resource_object_attributes.rb +14 -5
- data/lib/klaviyo-api-sdk/models/sms_subscription_parameters.rb +13 -4
- data/lib/klaviyo-api-sdk/models/sms_unsubscription_parameters.rb +228 -0
- data/lib/klaviyo-api-sdk/models/template_create_query_resource_object_attributes.rb +1 -1
- data/lib/klaviyo-api-sdk/models/unsubscription_channels.rb +228 -0
- data/lib/klaviyo-api-sdk/models/unsubscription_parameters.rb +259 -0
- data/lib/klaviyo-api-sdk.rb +36 -19
- metadata +6 -2
@@ -19,55 +19,47 @@ module KlaviyoAPI
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
|
-
# Get Metric
|
23
|
-
# Get
|
24
|
-
# @param id [String]
|
22
|
+
# Get Flows Triggered by Metric
|
23
|
+
# Get all flows where the given metric is being used as the trigger.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `flows:read` `metrics:read`
|
24
|
+
# @param id [String]
|
25
25
|
# @param [Hash] opts the optional parameters
|
26
26
|
# @option opts [Array<String>] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets
|
27
|
-
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets
|
28
|
-
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships
|
29
27
|
# @return [Hash<String, Object>]
|
30
|
-
def
|
31
|
-
data, _status_code, _headers =
|
28
|
+
def get_flows_triggered_by_metric(id, opts = {})
|
29
|
+
data, _status_code, _headers = get_flows_triggered_by_metric_with_http_info(id, opts)
|
32
30
|
data
|
33
31
|
end
|
34
32
|
|
35
|
-
#
|
36
|
-
|
37
|
-
|
33
|
+
# alias of `get_flows_triggered_by_metric`
|
34
|
+
alias get_flow_triggers_for_metric get_flows_triggered_by_metric
|
35
|
+
|
36
|
+
# alias of `get_flows_triggered_by_metric`
|
37
|
+
alias get_metric_flow_triggers get_flows_triggered_by_metric
|
38
|
+
|
39
|
+
# Get Flows Triggered by Metric
|
40
|
+
# Get all flows where the given metric is being used as the trigger.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `flows:read` `metrics:read`
|
41
|
+
# @param id [String]
|
38
42
|
# @param [Hash] opts the optional parameters
|
39
43
|
# @option opts [Array<String>] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets
|
40
|
-
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets
|
41
|
-
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships
|
42
44
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
43
|
-
def
|
45
|
+
def get_flows_triggered_by_metric_with_http_info(id, opts = {})
|
44
46
|
if @api_client.config.debugging
|
45
|
-
@api_client.config.logger.debug 'Calling API: MetricsApi.
|
47
|
+
@api_client.config.logger.debug 'Calling API: MetricsApi.get_flows_triggered_by_metric ...'
|
46
48
|
end
|
47
49
|
# verify the required parameter 'id' is set
|
48
50
|
if @api_client.config.client_side_validation && id.nil?
|
49
|
-
fail ArgumentError, "Missing the required parameter 'id' when calling MetricsApi.
|
51
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling MetricsApi.get_flows_triggered_by_metric"
|
50
52
|
end
|
51
53
|
allowable_values = ["name", "status", "archived", "created", "updated", "trigger_type"]
|
52
54
|
if @api_client.config.client_side_validation && opts[:'fields_flow'] && !opts[:'fields_flow'].all? { |item| allowable_values.include?(item) }
|
53
55
|
fail ArgumentError, "invalid value for \"fields_flow\", must include one of #{allowable_values}"
|
54
56
|
end
|
55
|
-
allowable_values = ["name", "created", "updated", "integration"]
|
56
|
-
if @api_client.config.client_side_validation && opts[:'fields_metric'] && !opts[:'fields_metric'].all? { |item| allowable_values.include?(item) }
|
57
|
-
fail ArgumentError, "invalid value for \"fields_metric\", must include one of #{allowable_values}"
|
58
|
-
end
|
59
|
-
allowable_values = ["flow-triggers"]
|
60
|
-
if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) }
|
61
|
-
fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}"
|
62
|
-
end
|
63
57
|
# resource path
|
64
|
-
local_var_path = '/api/metrics/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
58
|
+
local_var_path = '/api/metrics/{id}/flow-triggers'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
65
59
|
|
66
60
|
# query parameters
|
67
61
|
query_params = opts[:query_params] || {}
|
68
62
|
query_params[:'fields[flow]'] = @api_client.build_collection_param(opts[:'fields_flow'], :csv) if !opts[:'fields_flow'].nil?
|
69
|
-
query_params[:'fields[metric]'] = @api_client.build_collection_param(opts[:'fields_metric'], :csv) if !opts[:'fields_metric'].nil?
|
70
|
-
query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil?
|
71
63
|
|
72
64
|
# header parameters
|
73
65
|
header_params = opts[:header_params] || {}
|
@@ -86,10 +78,10 @@ module KlaviyoAPI
|
|
86
78
|
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
87
79
|
|
88
80
|
# auth_names
|
89
|
-
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
81
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
90
82
|
|
91
83
|
new_options = opts.merge(
|
92
|
-
:operation => :"MetricsApi.
|
84
|
+
:operation => :"MetricsApi.get_flows_triggered_by_metric",
|
93
85
|
:header_params => header_params,
|
94
86
|
:query_params => query_params,
|
95
87
|
:form_params => form_params,
|
@@ -100,46 +92,143 @@ module KlaviyoAPI
|
|
100
92
|
|
101
93
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
102
94
|
if @api_client.config.debugging
|
103
|
-
@api_client.config.logger.debug "API called: MetricsApi#
|
95
|
+
@api_client.config.logger.debug "API called: MetricsApi#get_flows_triggered_by_metric\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
104
96
|
end
|
105
97
|
return data, status_code, headers
|
106
98
|
end
|
107
99
|
|
108
|
-
#
|
109
|
-
|
100
|
+
# alias of `get_flows_triggered_by_metric_with_http_info`
|
101
|
+
alias get_flow_triggers_for_metric_with_http_info get_flows_triggered_by_metric_with_http_info
|
102
|
+
|
103
|
+
# alias of `get_flows_triggered_by_metric_with_http_info`
|
104
|
+
alias get_metric_flow_triggers_with_http_info get_flows_triggered_by_metric_with_http_info
|
105
|
+
|
106
|
+
# Get IDs for Flows Triggered by Metric
|
107
|
+
# Get the IDs of all flows where the given metric is being used as the trigger.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `flows:read` `metrics:read`
|
110
108
|
# @param id [String]
|
111
109
|
# @param [Hash] opts the optional parameters
|
112
|
-
# @option opts [Array<String>] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets
|
113
110
|
# @return [Hash<String, Object>]
|
114
|
-
def
|
115
|
-
data, _status_code, _headers =
|
111
|
+
def get_ids_for_flows_triggered_by_metric(id, opts = {})
|
112
|
+
data, _status_code, _headers = get_ids_for_flows_triggered_by_metric_with_http_info(id, opts)
|
116
113
|
data
|
117
114
|
end
|
118
115
|
|
119
|
-
#
|
120
|
-
|
116
|
+
# alias of `get_ids_for_flows_triggered_by_metric`
|
117
|
+
alias get_flow_trigger_ids_for_metric get_ids_for_flows_triggered_by_metric
|
118
|
+
|
119
|
+
# alias of `get_ids_for_flows_triggered_by_metric`
|
120
|
+
alias get_metric_relationships_flow_triggers get_ids_for_flows_triggered_by_metric
|
121
|
+
|
122
|
+
# Get IDs for Flows Triggered by Metric
|
123
|
+
# Get the IDs of all flows where the given metric is being used as the trigger.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `flows:read` `metrics:read`
|
121
124
|
# @param id [String]
|
122
125
|
# @param [Hash] opts the optional parameters
|
126
|
+
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
127
|
+
def get_ids_for_flows_triggered_by_metric_with_http_info(id, opts = {})
|
128
|
+
if @api_client.config.debugging
|
129
|
+
@api_client.config.logger.debug 'Calling API: MetricsApi.get_ids_for_flows_triggered_by_metric ...'
|
130
|
+
end
|
131
|
+
# verify the required parameter 'id' is set
|
132
|
+
if @api_client.config.client_side_validation && id.nil?
|
133
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling MetricsApi.get_ids_for_flows_triggered_by_metric"
|
134
|
+
end
|
135
|
+
# resource path
|
136
|
+
local_var_path = '/api/metrics/{id}/relationships/flow-triggers'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
137
|
+
|
138
|
+
# query parameters
|
139
|
+
query_params = opts[:query_params] || {}
|
140
|
+
|
141
|
+
# header parameters
|
142
|
+
header_params = opts[:header_params] || {}
|
143
|
+
# klaviyo api revision
|
144
|
+
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15"
|
145
|
+
# HTTP header 'Accept' (if needed)
|
146
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
147
|
+
|
148
|
+
# form parameters
|
149
|
+
form_params = opts[:form_params] || {}
|
150
|
+
|
151
|
+
# http body (model)
|
152
|
+
post_body = opts[:debug_body]
|
153
|
+
|
154
|
+
# return_type
|
155
|
+
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
156
|
+
|
157
|
+
# auth_names
|
158
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
159
|
+
|
160
|
+
new_options = opts.merge(
|
161
|
+
:operation => :"MetricsApi.get_ids_for_flows_triggered_by_metric",
|
162
|
+
:header_params => header_params,
|
163
|
+
:query_params => query_params,
|
164
|
+
:form_params => form_params,
|
165
|
+
:body => post_body,
|
166
|
+
:auth_names => auth_names,
|
167
|
+
:return_type => return_type
|
168
|
+
)
|
169
|
+
|
170
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
171
|
+
if @api_client.config.debugging
|
172
|
+
@api_client.config.logger.debug "API called: MetricsApi#get_ids_for_flows_triggered_by_metric\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
173
|
+
end
|
174
|
+
return data, status_code, headers
|
175
|
+
end
|
176
|
+
|
177
|
+
# alias of `get_ids_for_flows_triggered_by_metric_with_http_info`
|
178
|
+
alias get_flow_trigger_ids_for_metric_with_http_info get_ids_for_flows_triggered_by_metric_with_http_info
|
179
|
+
|
180
|
+
# alias of `get_ids_for_flows_triggered_by_metric_with_http_info`
|
181
|
+
alias get_metric_relationships_flow_triggers_with_http_info get_ids_for_flows_triggered_by_metric_with_http_info
|
182
|
+
|
183
|
+
# Get Metric
|
184
|
+
# Get a metric with the given metric ID.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `metrics:read`
|
185
|
+
# @param id [String] Metric ID
|
186
|
+
# @param [Hash] opts the optional parameters
|
187
|
+
# @option opts [Array<String>] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets
|
188
|
+
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets
|
189
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships
|
190
|
+
# @return [Hash<String, Object>]
|
191
|
+
def get_metric(id, opts = {})
|
192
|
+
data, _status_code, _headers = get_metric_with_http_info(id, opts)
|
193
|
+
data
|
194
|
+
end
|
195
|
+
|
196
|
+
# Get Metric
|
197
|
+
# Get a metric with the given metric ID.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `metrics:read`
|
198
|
+
# @param id [String] Metric ID
|
199
|
+
# @param [Hash] opts the optional parameters
|
123
200
|
# @option opts [Array<String>] :fields_flow For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets
|
201
|
+
# @option opts [Array<String>] :fields_metric For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#sparse-fieldsets
|
202
|
+
# @option opts [Array<String>] :include For more information please visit https://developers.klaviyo.com/en/v2024-10-15/reference/api-overview#relationships
|
124
203
|
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
125
|
-
def
|
204
|
+
def get_metric_with_http_info(id, opts = {})
|
126
205
|
if @api_client.config.debugging
|
127
|
-
@api_client.config.logger.debug 'Calling API: MetricsApi.
|
206
|
+
@api_client.config.logger.debug 'Calling API: MetricsApi.get_metric ...'
|
128
207
|
end
|
129
208
|
# verify the required parameter 'id' is set
|
130
209
|
if @api_client.config.client_side_validation && id.nil?
|
131
|
-
fail ArgumentError, "Missing the required parameter 'id' when calling MetricsApi.
|
210
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling MetricsApi.get_metric"
|
132
211
|
end
|
133
212
|
allowable_values = ["name", "status", "archived", "created", "updated", "trigger_type"]
|
134
213
|
if @api_client.config.client_side_validation && opts[:'fields_flow'] && !opts[:'fields_flow'].all? { |item| allowable_values.include?(item) }
|
135
214
|
fail ArgumentError, "invalid value for \"fields_flow\", must include one of #{allowable_values}"
|
136
215
|
end
|
216
|
+
allowable_values = ["name", "created", "updated", "integration"]
|
217
|
+
if @api_client.config.client_side_validation && opts[:'fields_metric'] && !opts[:'fields_metric'].all? { |item| allowable_values.include?(item) }
|
218
|
+
fail ArgumentError, "invalid value for \"fields_metric\", must include one of #{allowable_values}"
|
219
|
+
end
|
220
|
+
allowable_values = ["flow-triggers"]
|
221
|
+
if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) }
|
222
|
+
fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}"
|
223
|
+
end
|
137
224
|
# resource path
|
138
|
-
local_var_path = '/api/metrics/{id}
|
225
|
+
local_var_path = '/api/metrics/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
139
226
|
|
140
227
|
# query parameters
|
141
228
|
query_params = opts[:query_params] || {}
|
142
229
|
query_params[:'fields[flow]'] = @api_client.build_collection_param(opts[:'fields_flow'], :csv) if !opts[:'fields_flow'].nil?
|
230
|
+
query_params[:'fields[metric]'] = @api_client.build_collection_param(opts[:'fields_metric'], :csv) if !opts[:'fields_metric'].nil?
|
231
|
+
query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil?
|
143
232
|
|
144
233
|
# header parameters
|
145
234
|
header_params = opts[:header_params] || {}
|
@@ -158,10 +247,10 @@ module KlaviyoAPI
|
|
158
247
|
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
159
248
|
|
160
249
|
# auth_names
|
161
|
-
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
250
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
162
251
|
|
163
252
|
new_options = opts.merge(
|
164
|
-
:operation => :"MetricsApi.
|
253
|
+
:operation => :"MetricsApi.get_metric",
|
165
254
|
:header_params => header_params,
|
166
255
|
:query_params => query_params,
|
167
256
|
:form_params => form_params,
|
@@ -172,7 +261,7 @@ module KlaviyoAPI
|
|
172
261
|
|
173
262
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
174
263
|
if @api_client.config.debugging
|
175
|
-
@api_client.config.logger.debug "API called: MetricsApi#
|
264
|
+
@api_client.config.logger.debug "API called: MetricsApi#get_metric\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
176
265
|
end
|
177
266
|
return data, status_code, headers
|
178
267
|
end
|
@@ -233,7 +322,7 @@ module KlaviyoAPI
|
|
233
322
|
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
234
323
|
|
235
324
|
# auth_names
|
236
|
-
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
325
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
237
326
|
|
238
327
|
new_options = opts.merge(
|
239
328
|
:operation => :"MetricsApi.get_metric_for_metric_property",
|
@@ -304,7 +393,7 @@ module KlaviyoAPI
|
|
304
393
|
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
305
394
|
|
306
395
|
# auth_names
|
307
|
-
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
396
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
308
397
|
|
309
398
|
new_options = opts.merge(
|
310
399
|
:operation => :"MetricsApi.get_metric_id_for_metric_property",
|
@@ -400,7 +489,7 @@ module KlaviyoAPI
|
|
400
489
|
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
401
490
|
|
402
491
|
# auth_names
|
403
|
-
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
492
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
404
493
|
|
405
494
|
new_options = opts.merge(
|
406
495
|
:operation => :"MetricsApi.get_metric_property",
|
@@ -419,71 +508,6 @@ module KlaviyoAPI
|
|
419
508
|
return data, status_code, headers
|
420
509
|
end
|
421
510
|
|
422
|
-
# Get Metric Relationships Flow Triggers
|
423
|
-
# Get all flows where the given metric is being used as the trigger.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `flows:read` `metrics:read`
|
424
|
-
# @param id [String]
|
425
|
-
# @param [Hash] opts the optional parameters
|
426
|
-
# @return [Hash<String, Object>]
|
427
|
-
def get_metric_relationships_flow_triggers(id, opts = {})
|
428
|
-
data, _status_code, _headers = get_metric_relationships_flow_triggers_with_http_info(id, opts)
|
429
|
-
data
|
430
|
-
end
|
431
|
-
|
432
|
-
# Get Metric Relationships Flow Triggers
|
433
|
-
# Get all flows where the given metric is being used as the trigger.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `flows:read` `metrics:read`
|
434
|
-
# @param id [String]
|
435
|
-
# @param [Hash] opts the optional parameters
|
436
|
-
# @return [Array<(Hash<String, Object>, Integer, Hash)>] Hash<String, Object> data, response status code and response headers
|
437
|
-
def get_metric_relationships_flow_triggers_with_http_info(id, opts = {})
|
438
|
-
if @api_client.config.debugging
|
439
|
-
@api_client.config.logger.debug 'Calling API: MetricsApi.get_metric_relationships_flow_triggers ...'
|
440
|
-
end
|
441
|
-
# verify the required parameter 'id' is set
|
442
|
-
if @api_client.config.client_side_validation && id.nil?
|
443
|
-
fail ArgumentError, "Missing the required parameter 'id' when calling MetricsApi.get_metric_relationships_flow_triggers"
|
444
|
-
end
|
445
|
-
# resource path
|
446
|
-
local_var_path = '/api/metrics/{id}/relationships/flow-triggers'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
447
|
-
|
448
|
-
# query parameters
|
449
|
-
query_params = opts[:query_params] || {}
|
450
|
-
|
451
|
-
# header parameters
|
452
|
-
header_params = opts[:header_params] || {}
|
453
|
-
# klaviyo api revision
|
454
|
-
header_params['revision'] = ENV['KLAVIYO_API_REVISION'] || ENV['API_REVISION'] || "2024-10-15"
|
455
|
-
# HTTP header 'Accept' (if needed)
|
456
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/vnd.api+json'])
|
457
|
-
|
458
|
-
# form parameters
|
459
|
-
form_params = opts[:form_params] || {}
|
460
|
-
|
461
|
-
# http body (model)
|
462
|
-
post_body = opts[:debug_body]
|
463
|
-
|
464
|
-
# return_type
|
465
|
-
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
466
|
-
|
467
|
-
# auth_names
|
468
|
-
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
469
|
-
|
470
|
-
new_options = opts.merge(
|
471
|
-
:operation => :"MetricsApi.get_metric_relationships_flow_triggers",
|
472
|
-
:header_params => header_params,
|
473
|
-
:query_params => query_params,
|
474
|
-
:form_params => form_params,
|
475
|
-
:body => post_body,
|
476
|
-
:auth_names => auth_names,
|
477
|
-
:return_type => return_type
|
478
|
-
)
|
479
|
-
|
480
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
481
|
-
if @api_client.config.debugging
|
482
|
-
@api_client.config.logger.debug "API called: MetricsApi#get_metric_relationships_flow_triggers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
483
|
-
end
|
484
|
-
return data, status_code, headers
|
485
|
-
end
|
486
|
-
|
487
511
|
# Get Metrics
|
488
512
|
# Get all metrics in an account. Requests can be filtered by the following fields: integration `name`, integration `category` Returns a maximum of 200 results per page.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m` **Scopes:** `metrics:read`
|
489
513
|
# @param [Hash] opts the optional parameters
|
@@ -551,7 +575,7 @@ module KlaviyoAPI
|
|
551
575
|
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
552
576
|
|
553
577
|
# auth_names
|
554
|
-
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
578
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
555
579
|
|
556
580
|
new_options = opts.merge(
|
557
581
|
:operation => :"MetricsApi.get_metrics",
|
@@ -585,6 +609,9 @@ module KlaviyoAPI
|
|
585
609
|
# alias of `get_properties_for_metric`
|
586
610
|
alias get_metric_metric_properties get_properties_for_metric
|
587
611
|
|
612
|
+
# alias of `get_properties_for_metric`
|
613
|
+
alias get_metric_properties get_properties_for_metric
|
614
|
+
|
588
615
|
# Get Properties for Metric
|
589
616
|
# Get the metric properties for the given metric ID.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `metrics:read`
|
590
617
|
# @param id [String] The ID of the metric
|
@@ -633,7 +660,7 @@ module KlaviyoAPI
|
|
633
660
|
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
634
661
|
|
635
662
|
# auth_names
|
636
|
-
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
663
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
637
664
|
|
638
665
|
new_options = opts.merge(
|
639
666
|
:operation => :"MetricsApi.get_properties_for_metric",
|
@@ -655,6 +682,9 @@ module KlaviyoAPI
|
|
655
682
|
# alias of `get_properties_for_metric_with_http_info`
|
656
683
|
alias get_metric_metric_properties_with_http_info get_properties_for_metric_with_http_info
|
657
684
|
|
685
|
+
# alias of `get_properties_for_metric_with_http_info`
|
686
|
+
alias get_metric_properties_with_http_info get_properties_for_metric_with_http_info
|
687
|
+
|
658
688
|
# Get Property IDs for Metric
|
659
689
|
# Get the IDs of metric properties for the given metric.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `metrics:read`
|
660
690
|
# @param id [String] The ID of the metric
|
@@ -668,6 +698,9 @@ module KlaviyoAPI
|
|
668
698
|
# alias of `get_property_ids_for_metric`
|
669
699
|
alias get_metric_relationships_metric_properties get_property_ids_for_metric
|
670
700
|
|
701
|
+
# alias of `get_property_ids_for_metric`
|
702
|
+
alias get_metric_relationships_properties get_property_ids_for_metric
|
703
|
+
|
671
704
|
# Get Property IDs for Metric
|
672
705
|
# Get the IDs of metric properties for the given metric.<br><br>*Rate limits*:<br>Burst: `1/s`<br>Steady: `15/m` **Scopes:** `metrics:read`
|
673
706
|
# @param id [String] The ID of the metric
|
@@ -704,7 +737,7 @@ module KlaviyoAPI
|
|
704
737
|
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
705
738
|
|
706
739
|
# auth_names
|
707
|
-
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
740
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
708
741
|
|
709
742
|
new_options = opts.merge(
|
710
743
|
:operation => :"MetricsApi.get_property_ids_for_metric",
|
@@ -726,6 +759,9 @@ module KlaviyoAPI
|
|
726
759
|
# alias of `get_property_ids_for_metric_with_http_info`
|
727
760
|
alias get_metric_relationships_metric_properties_with_http_info get_property_ids_for_metric_with_http_info
|
728
761
|
|
762
|
+
# alias of `get_property_ids_for_metric_with_http_info`
|
763
|
+
alias get_metric_relationships_properties_with_http_info get_property_ids_for_metric_with_http_info
|
764
|
+
|
729
765
|
# Query Metric Aggregates
|
730
766
|
# Query and aggregate event data associated with a metric, including native Klaviyo metrics, integration-specific metrics, and custom events. Queries must be passed in the JSON body of your `POST` request. To request campaign and flow performance data that matches the data shown in Klaviyo's UI, we recommend the [Reporting API](https://developers.klaviyo.com/en/reference/reporting_api_overview). Results can be filtered and grouped by time, event, or profile dimensions. To learn more about how to use this endpoint, check out our new [Using the Query Metric Aggregates Endpoint guide](https://developers.klaviyo.com/en/docs/using-the-query-metric-aggregates-endpoint). For a comprehensive list of request body parameters, native Klaviyo metrics, and their associated attributes for grouping and filtering, please refer to the [metrics attributes guide](https://developers.klaviyo.com/en/docs/supported_metrics_and_attributes).<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m` **Scopes:** `metrics:read`
|
731
767
|
# @param metric_aggregate_query [MetricAggregateQuery] Retrieve Metric Aggregations
|
@@ -780,7 +816,7 @@ module KlaviyoAPI
|
|
780
816
|
return_type = opts[:debug_return_type] || 'Hash<String, Object>'
|
781
817
|
|
782
818
|
# auth_names
|
783
|
-
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key']
|
819
|
+
auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key', 'OAuth']
|
784
820
|
|
785
821
|
new_options = opts.merge(
|
786
822
|
:operation => :"MetricsApi.query_metric_aggregates",
|