Class: KlaviyoBeta::ProfilesApi
- Inherits:
-
Object
- Object
- KlaviyoBeta::ProfilesApi
- Defined in:
- lib/klaviyo_sdk_beta/api/profiles_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#create_profile(profile_create_query, opts = {}) ⇒ Hash<String, Object>
Create Profile Create a profile
*Rate limits*:
Burst: `75/s`
Steady: `700/m`. -
#create_profile_with_http_info(profile_create_query, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
Create Profile Create a profile<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m`.
-
#get_profile(id, opts = {}) ⇒ Hash<String, Object>
Get Profile Get a single profile by ID.
-
#get_profile_lists(profile_id, opts = {}) ⇒ Hash<String, Object>
Get Profile Lists Returns a list of list memberships for a given profile
*Rate limits*:
Burst: `3/s`
Steady: `60/m`. -
#get_profile_lists_with_http_info(profile_id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
Get Profile Lists Returns a list of list memberships for a given profile<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m`.
-
#get_profile_relationships(id, related_resource, opts = {}) ⇒ Hash<String, Object>
Get Profile Relationships Returns a list of list or segment membership relationships for a given profile.
-
#get_profile_relationships_with_http_info(id, related_resource, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
Get Profile Relationships Returns a list of list or segment membership relationships for a given profile.
-
#get_profile_segments(profile_id, opts = {}) ⇒ Hash<String, Object>
Get Profile Segments Returns a list of segment memberships for a given profile
*Rate limits*:
Burst: `3/s`
Steady: `60/m`. -
#get_profile_segments_with_http_info(profile_id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
Get Profile Segments Returns a list of segment memberships for a given profile<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m`.
-
#get_profile_with_http_info(id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
Get Profile Get a single profile by ID.
-
#get_profiles(opts = {}) ⇒ Hash<String, Object>
Get Profiles Return a list of profiles for the company, optionally filtered and sorted.
-
#get_profiles_with_http_info(opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
Get Profiles Return a list of profiles for the company, optionally filtered and sorted.
-
#initialize(api_client = ApiClient.default) ⇒ ProfilesApi
constructor
A new instance of ProfilesApi.
-
#subscribe_profiles(subscription_create_job_create_query, opts = {}) ⇒ Hash<String, Object>
Subscribe Profiles Subscribes one or more profiles to marketing.
-
#subscribe_profiles_with_http_info(subscription_create_job_create_query, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
Subscribe Profiles Subscribes one or more profiles to marketing.
-
#suppress_profiles(suppression_create_job_create_query, opts = {}) ⇒ Hash<String, Object>
Suppress Profiles Suppresses one or more profiles from receiving marketing.
-
#suppress_profiles_with_http_info(suppression_create_job_create_query, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
Suppress Profiles Suppresses one or more profiles from receiving marketing.
-
#unsubscribe_profiles(unsubscription_create_job_create_query, opts = {}) ⇒ Hash<String, Object>
Unsubscribe Profiles Unsubscribes one or more profiles from marketing.
-
#unsubscribe_profiles_with_http_info(unsubscription_create_job_create_query, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
Unsubscribe Profiles Unsubscribes one or more profiles from marketing.
-
#unsuppress_profiles(unsuppression_create_job_create_query, opts = {}) ⇒ Hash<String, Object>
Unsuppress Profiles Unsuppresses one or more profiles from receiving marketing.
-
#unsuppress_profiles_with_http_info(unsuppression_create_job_create_query, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
Unsuppress Profiles Unsuppresses one or more profiles from receiving marketing.
-
#update_profile(id, profile_partial_update_query, opts = {}) ⇒ Hash<String, Object>
Update Profile Update a profile
*Rate limits*:
Burst: `75/s`
Steady: `700/m`. -
#update_profile_with_http_info(id, profile_partial_update_query, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
Update Profile Update a profile<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m`.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ ProfilesApi
Returns a new instance of ProfilesApi.
19 20 21 |
# File 'lib/klaviyo_sdk_beta/api/profiles_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/klaviyo_sdk_beta/api/profiles_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#create_profile(profile_create_query, opts = {}) ⇒ Hash<String, Object>
Create Profile Create a profile
*Rate limits*:
Burst: `75/s`
Steady: `700/m`
27 28 29 30 |
# File 'lib/klaviyo_sdk_beta/api/profiles_api.rb', line 27 def create_profile(profile_create_query, opts = {}) data, _status_code, _headers = create_profile_with_http_info(profile_create_query, opts) data end |
#create_profile_with_http_info(profile_create_query, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
Create Profile Create a profile<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m`
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/klaviyo_sdk_beta/api/profiles_api.rb', line 37 def create_profile_with_http_info(profile_create_query, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProfilesApi.create_profile ...' end # verify the required parameter 'profile_create_query' is set if @api_client.config.client_side_validation && profile_create_query.nil? fail ArgumentError, "Missing the required parameter 'profile_create_query' when calling ProfilesApi.create_profile" end # resource path local_var_path = '/api/profiles/' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-09-07.pre" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(profile_create_query) # return_type return_type = opts[:debug_return_type] || 'Hash<String, Object>' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] = opts.merge( :operation => :"ProfilesApi.create_profile", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ProfilesApi#create_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_profile(id, opts = {}) ⇒ Hash<String, Object>
Get Profile Get a single profile by ID. Returns a full profile (or 404 if not found). Sparse fields can be provided to return a subset of profile fields. Includes can be provided to retrieve related resource data (lists and segment memberships)
*Rate limits*:
Burst: `75/s`
Steady: `700/m`
101 102 103 104 |
# File 'lib/klaviyo_sdk_beta/api/profiles_api.rb', line 101 def get_profile(id, opts = {}) data, _status_code, _headers = get_profile_with_http_info(id, opts) data end |
#get_profile_lists(profile_id, opts = {}) ⇒ Hash<String, Object>
Get Profile Lists Returns a list of list memberships for a given profile
*Rate limits*:
Burst: `3/s`
Steady: `60/m`
191 192 193 194 |
# File 'lib/klaviyo_sdk_beta/api/profiles_api.rb', line 191 def get_profile_lists(profile_id, opts = {}) data, _status_code, _headers = get_profile_lists_with_http_info(profile_id, opts) data end |
#get_profile_lists_with_http_info(profile_id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
Get Profile Lists Returns a list of list memberships for a given profile<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m`
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 |
# File 'lib/klaviyo_sdk_beta/api/profiles_api.rb', line 202 def get_profile_lists_with_http_info(profile_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProfilesApi.get_profile_lists ...' end # verify the required parameter 'profile_id' is set if @api_client.config.client_side_validation && profile_id.nil? fail ArgumentError, "Missing the required parameter 'profile_id' when calling ProfilesApi.get_profile_lists" end allowable_values = ["name", "created", "updated"] if @api_client.config.client_side_validation && opts[:'fields_list'] && !opts[:'fields_list'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_list\", must include one of #{allowable_values}" end # resource path local_var_path = '/api/profiles/{profile_id}/lists/'.sub('{' + 'profile_id' + '}', CGI.escape(profile_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'fields[list]'] = @api_client.build_collection_param(opts[:'fields_list'], :csv) if !opts[:'fields_list'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-09-07.pre" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash<String, Object>' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] = opts.merge( :operation => :"ProfilesApi.get_profile_lists", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ProfilesApi#get_profile_lists\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_profile_relationships(id, related_resource, opts = {}) ⇒ Hash<String, Object>
Get Profile Relationships Returns a list of list or segment membership relationships for a given profile
263 264 265 266 |
# File 'lib/klaviyo_sdk_beta/api/profiles_api.rb', line 263 def get_profile_relationships(id, , opts = {}) data, _status_code, _headers = get_profile_relationships_with_http_info(id, , opts) data end |
#get_profile_relationships_with_http_info(id, related_resource, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
Get Profile Relationships Returns a list of list or segment membership relationships for a given profile
274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 |
# File 'lib/klaviyo_sdk_beta/api/profiles_api.rb', line 274 def get_profile_relationships_with_http_info(id, , opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProfilesApi.get_profile_relationships ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.get_profile_relationships" end # verify the required parameter 'related_resource' is set if @api_client.config.client_side_validation && .nil? fail ArgumentError, "Missing the required parameter 'related_resource' when calling ProfilesApi.get_profile_relationships" end # verify enum value allowable_values = ["lists", "segments"] if @api_client.config.client_side_validation && !allowable_values.include?() fail ArgumentError, "invalid value for \"related_resource\", must be one of #{allowable_values}" end # resource path local_var_path = '/api/profiles/{id}/relationships/{related_resource}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'related_resource' + '}', CGI.escape(.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-09-07.pre" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash<String, Object>' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] = opts.merge( :operation => :"ProfilesApi.get_profile_relationships", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ProfilesApi#get_profile_relationships\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_profile_segments(profile_id, opts = {}) ⇒ Hash<String, Object>
Get Profile Segments Returns a list of segment memberships for a given profile
*Rate limits*:
Burst: `3/s`
Steady: `60/m`
339 340 341 342 |
# File 'lib/klaviyo_sdk_beta/api/profiles_api.rb', line 339 def get_profile_segments(profile_id, opts = {}) data, _status_code, _headers = get_profile_segments_with_http_info(profile_id, opts) data end |
#get_profile_segments_with_http_info(profile_id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
Get Profile Segments Returns a list of segment memberships for a given profile<br><br>*Rate limits*:<br>Burst: `3/s`<br>Steady: `60/m`
350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 |
# File 'lib/klaviyo_sdk_beta/api/profiles_api.rb', line 350 def get_profile_segments_with_http_info(profile_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProfilesApi.get_profile_segments ...' end # verify the required parameter 'profile_id' is set if @api_client.config.client_side_validation && profile_id.nil? fail ArgumentError, "Missing the required parameter 'profile_id' when calling ProfilesApi.get_profile_segments" end allowable_values = ["name", "created", "updated"] if @api_client.config.client_side_validation && opts[:'fields_segment'] && !opts[:'fields_segment'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_segment\", must include one of #{allowable_values}" end # resource path local_var_path = '/api/profiles/{profile_id}/segments/'.sub('{' + 'profile_id' + '}', CGI.escape(profile_id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'fields[segment]'] = @api_client.build_collection_param(opts[:'fields_segment'], :csv) if !opts[:'fields_segment'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-09-07.pre" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash<String, Object>' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] = opts.merge( :operation => :"ProfilesApi.get_profile_segments", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ProfilesApi#get_profile_segments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_profile_with_http_info(id, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
Get Profile Get a single profile by ID. Returns a full profile (or 404 if not found). Sparse fields can be provided to return a subset of profile fields. Includes can be provided to retrieve related resource data (lists and segment memberships)<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m`
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 |
# File 'lib/klaviyo_sdk_beta/api/profiles_api.rb', line 115 def get_profile_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProfilesApi.get_profile ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.get_profile" end allowable_values = ["name", "created", "updated"] if @api_client.config.client_side_validation && opts[:'fields_list'] && !opts[:'fields_list'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_list\", must include one of #{allowable_values}" end allowable_values = ["email", "phone_number", "external_id", "anonymous_id", "first_name", "last_name", "organization", "title", "image", "created", "updated", "last_event_date", "location", "location.address1", "location.address2", "location.city", "location.country", "location.latitude", "location.longitude", "location.region", "location.zip", "location.timezone", "properties"] if @api_client.config.client_side_validation && opts[:'fields_profile'] && !opts[:'fields_profile'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_profile\", must include one of #{allowable_values}" end allowable_values = ["name", "created", "updated"] if @api_client.config.client_side_validation && opts[:'fields_segment'] && !opts[:'fields_segment'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_segment\", must include one of #{allowable_values}" end allowable_values = ["lists", "segments"] if @api_client.config.client_side_validation && opts[:'include'] && !opts[:'include'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"include\", must include one of #{allowable_values}" end # resource path local_var_path = '/api/profiles/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'fields[list]'] = @api_client.build_collection_param(opts[:'fields_list'], :csv) if !opts[:'fields_list'].nil? query_params[:'fields[profile]'] = @api_client.build_collection_param(opts[:'fields_profile'], :csv) if !opts[:'fields_profile'].nil? query_params[:'fields[segment]'] = @api_client.build_collection_param(opts[:'fields_segment'], :csv) if !opts[:'fields_segment'].nil? query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-09-07.pre" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash<String, Object>' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] = opts.merge( :operation => :"ProfilesApi.get_profile", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ProfilesApi#get_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_profiles(opts = {}) ⇒ Hash<String, Object>
Get Profiles Return a list of profiles for the company, optionally filtered and sorted. If unfiltered, returns all profiles for the company. Filters can be provided to narrow the results. Sort can be provided to order the results. Sparse fields can be provided to return a subset of profile fields. Pagination is available to load additional results.
*Rate limits*:
Burst: `10/s`
Steady: `150/m`
413 414 415 416 |
# File 'lib/klaviyo_sdk_beta/api/profiles_api.rb', line 413 def get_profiles(opts = {}) data, _status_code, _headers = get_profiles_with_http_info(opts) data end |
#get_profiles_with_http_info(opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
Get Profiles Return a list of profiles for the company, optionally filtered and sorted. If unfiltered, returns all profiles for the company. Filters can be provided to narrow the results. Sort can be provided to order the results. Sparse fields can be provided to return a subset of profile fields. Pagination is available to load additional results.<br><br>*Rate limits*:<br>Burst: `10/s`<br>Steady: `150/m`
426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 |
# File 'lib/klaviyo_sdk_beta/api/profiles_api.rb', line 426 def get_profiles_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProfilesApi.get_profiles ...' end allowable_values = ["email", "phone_number", "external_id", "anonymous_id", "first_name", "last_name", "organization", "title", "image", "created", "updated", "last_event_date", "location", "location.address1", "location.address2", "location.city", "location.country", "location.latitude", "location.longitude", "location.region", "location.zip", "location.timezone", "properties"] if @api_client.config.client_side_validation && opts[:'fields_profile'] && !opts[:'fields_profile'].all? { |item| allowable_values.include?(item) } fail ArgumentError, "invalid value for \"fields_profile\", must include one of #{allowable_values}" end allowable_values = ["created", "-created", "email", "-email", "id", "-id"] if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end # resource path local_var_path = '/api/profiles/' # query parameters query_params = opts[:query_params] || {} query_params[:'fields[profile]'] = @api_client.build_collection_param(opts[:'fields_profile'], :csv) if !opts[:'fields_profile'].nil? query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? query_params[:'page[cursor]'] = opts[:'page_cursor'] if !opts[:'page_cursor'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-09-07.pre" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'Hash<String, Object>' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] = opts.merge( :operation => :"ProfilesApi.get_profiles", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:GET, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ProfilesApi#get_profiles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#subscribe_profiles(subscription_create_job_create_query, opts = {}) ⇒ Hash<String, Object>
Subscribe Profiles Subscribes one or more profiles to marketing. Currently, supports email and SMS.
*Rate limits*:
Burst: `75/s`
Steady: `700/m`
489 490 491 492 |
# File 'lib/klaviyo_sdk_beta/api/profiles_api.rb', line 489 def subscribe_profiles(subscription_create_job_create_query, opts = {}) data, _status_code, _headers = subscribe_profiles_with_http_info(subscription_create_job_create_query, opts) data end |
#subscribe_profiles_with_http_info(subscription_create_job_create_query, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
Subscribe Profiles Subscribes one or more profiles to marketing. Currently, supports email and SMS.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m`
499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 |
# File 'lib/klaviyo_sdk_beta/api/profiles_api.rb', line 499 def subscribe_profiles_with_http_info(subscription_create_job_create_query, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProfilesApi.subscribe_profiles ...' end # verify the required parameter 'subscription_create_job_create_query' is set if @api_client.config.client_side_validation && subscription_create_job_create_query.nil? fail ArgumentError, "Missing the required parameter 'subscription_create_job_create_query' when calling ProfilesApi.subscribe_profiles" end # resource path local_var_path = '/api/profile-subscription-bulk-create-jobs/' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-09-07.pre" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(subscription_create_job_create_query) # return_type return_type = opts[:debug_return_type] || 'Hash<String, Object>' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] = opts.merge( :operation => :"ProfilesApi.subscribe_profiles", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ProfilesApi#subscribe_profiles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#suppress_profiles(suppression_create_job_create_query, opts = {}) ⇒ Hash<String, Object>
Suppress Profiles Suppresses one or more profiles from receiving marketing. Currently, supports email only.
*Rate limits*:
Burst: `75/s`
Steady: `700/m`
559 560 561 562 |
# File 'lib/klaviyo_sdk_beta/api/profiles_api.rb', line 559 def suppress_profiles(suppression_create_job_create_query, opts = {}) data, _status_code, _headers = suppress_profiles_with_http_info(suppression_create_job_create_query, opts) data end |
#suppress_profiles_with_http_info(suppression_create_job_create_query, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
Suppress Profiles Suppresses one or more profiles from receiving marketing. Currently, supports email only.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m`
569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 |
# File 'lib/klaviyo_sdk_beta/api/profiles_api.rb', line 569 def suppress_profiles_with_http_info(suppression_create_job_create_query, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProfilesApi.suppress_profiles ...' end # verify the required parameter 'suppression_create_job_create_query' is set if @api_client.config.client_side_validation && suppression_create_job_create_query.nil? fail ArgumentError, "Missing the required parameter 'suppression_create_job_create_query' when calling ProfilesApi.suppress_profiles" end # resource path local_var_path = '/api/profile-suppression-bulk-create-jobs/' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-09-07.pre" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(suppression_create_job_create_query) # return_type return_type = opts[:debug_return_type] || 'Hash<String, Object>' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] = opts.merge( :operation => :"ProfilesApi.suppress_profiles", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ProfilesApi#suppress_profiles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#unsubscribe_profiles(unsubscription_create_job_create_query, opts = {}) ⇒ Hash<String, Object>
Unsubscribe Profiles Unsubscribes one or more profiles from marketing. Currently, supports email and SMS.
*Rate limits*:
Burst: `75/s`
Steady: `700/m`
629 630 631 632 |
# File 'lib/klaviyo_sdk_beta/api/profiles_api.rb', line 629 def unsubscribe_profiles(unsubscription_create_job_create_query, opts = {}) data, _status_code, _headers = unsubscribe_profiles_with_http_info(unsubscription_create_job_create_query, opts) data end |
#unsubscribe_profiles_with_http_info(unsubscription_create_job_create_query, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
Unsubscribe Profiles Unsubscribes one or more profiles from marketing. Currently, supports email and SMS.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m`
639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 |
# File 'lib/klaviyo_sdk_beta/api/profiles_api.rb', line 639 def unsubscribe_profiles_with_http_info(unsubscription_create_job_create_query, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProfilesApi.unsubscribe_profiles ...' end # verify the required parameter 'unsubscription_create_job_create_query' is set if @api_client.config.client_side_validation && unsubscription_create_job_create_query.nil? fail ArgumentError, "Missing the required parameter 'unsubscription_create_job_create_query' when calling ProfilesApi.unsubscribe_profiles" end # resource path local_var_path = '/api/profile-unsubscription-bulk-create-jobs/' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-09-07.pre" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(unsubscription_create_job_create_query) # return_type return_type = opts[:debug_return_type] || 'Hash<String, Object>' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] = opts.merge( :operation => :"ProfilesApi.unsubscribe_profiles", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ProfilesApi#unsubscribe_profiles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#unsuppress_profiles(unsuppression_create_job_create_query, opts = {}) ⇒ Hash<String, Object>
Unsuppress Profiles Unsuppresses one or more profiles from receiving marketing. Currently, supports email only.
*Rate limits*:
Burst: `75/s`
Steady: `700/m`
699 700 701 702 |
# File 'lib/klaviyo_sdk_beta/api/profiles_api.rb', line 699 def unsuppress_profiles(unsuppression_create_job_create_query, opts = {}) data, _status_code, _headers = unsuppress_profiles_with_http_info(unsuppression_create_job_create_query, opts) data end |
#unsuppress_profiles_with_http_info(unsuppression_create_job_create_query, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
Unsuppress Profiles Unsuppresses one or more profiles from receiving marketing. Currently, supports email only.<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m`
709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 |
# File 'lib/klaviyo_sdk_beta/api/profiles_api.rb', line 709 def unsuppress_profiles_with_http_info(unsuppression_create_job_create_query, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProfilesApi.unsuppress_profiles ...' end # verify the required parameter 'unsuppression_create_job_create_query' is set if @api_client.config.client_side_validation && unsuppression_create_job_create_query.nil? fail ArgumentError, "Missing the required parameter 'unsuppression_create_job_create_query' when calling ProfilesApi.unsuppress_profiles" end # resource path local_var_path = '/api/profile-unsuppression-bulk-create-jobs/' # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-09-07.pre" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(unsuppression_create_job_create_query) # return_type return_type = opts[:debug_return_type] || 'Hash<String, Object>' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] = opts.merge( :operation => :"ProfilesApi.unsuppress_profiles", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:POST, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ProfilesApi#unsuppress_profiles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_profile(id, profile_partial_update_query, opts = {}) ⇒ Hash<String, Object>
Update Profile Update a profile
*Rate limits*:
Burst: `75/s`
Steady: `700/m`
770 771 772 773 |
# File 'lib/klaviyo_sdk_beta/api/profiles_api.rb', line 770 def update_profile(id, profile_partial_update_query, opts = {}) data, _status_code, _headers = update_profile_with_http_info(id, profile_partial_update_query, opts) data end |
#update_profile_with_http_info(id, profile_partial_update_query, opts = {}) ⇒ Array<(Hash<String, Object>, Integer, Hash)>
Update Profile Update a profile<br><br>*Rate limits*:<br>Burst: `75/s`<br>Steady: `700/m`
781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 |
# File 'lib/klaviyo_sdk_beta/api/profiles_api.rb', line 781 def update_profile_with_http_info(id, profile_partial_update_query, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ProfilesApi.update_profile ...' end # verify the required parameter 'id' is set if @api_client.config.client_side_validation && id.nil? fail ArgumentError, "Missing the required parameter 'id' when calling ProfilesApi.update_profile" end # verify the required parameter 'profile_partial_update_query' is set if @api_client.config.client_side_validation && profile_partial_update_query.nil? fail ArgumentError, "Missing the required parameter 'profile_partial_update_query' when calling ProfilesApi.update_profile" end # resource path local_var_path = '/api/profiles/{id}/'.sub('{' + 'id' + '}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} # klaviyo api revision header_params['revision'] = ENV['API_REVISION'] || "2022-09-07.pre" # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' content_type = @api_client.select_header_content_type(['application/json']) if !content_type.nil? header_params['Content-Type'] = content_type end # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(profile_partial_update_query) # return_type return_type = opts[:debug_return_type] || 'Hash<String, Object>' # auth_names auth_names = opts[:debug_auth_names] || ['Klaviyo-API-Key'] = opts.merge( :operation => :"ProfilesApi.update_profile", :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => return_type ) data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ProfilesApi#update_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |