Class: TalonOne::IntegrationApi

Inherits:
Object
  • Object
show all
Defined in:
lib/talon_one/api/integration_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ IntegrationApi

Returns a new instance of IntegrationApi.



19
20
21
# File 'lib/talon_one/api/integration_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/talon_one/api/integration_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_coupon_reservation(coupon_value, body, opts = {}) ⇒ Coupon

Create a new coupon reservation Creates a coupon reservation for all passed customer profiles on this couponID

Parameters:

  • coupon_value (String)

    The value of a coupon

  • body (CouponReservations)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



28
29
30
31
# File 'lib/talon_one/api/integration_api.rb', line 28

def create_coupon_reservation(coupon_value, body, opts = {})
  data, _status_code, _headers = create_coupon_reservation_with_http_info(coupon_value, body, opts)
  data
end

#create_coupon_reservation_with_http_info(coupon_value, body, opts = {}) ⇒ Array<(Coupon, Integer, Hash)>

Create a new coupon reservation Creates a coupon reservation for all passed customer profiles on this couponID

Parameters:

  • coupon_value (String)

    The value of a coupon

  • body (CouponReservations)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Coupon, Integer, Hash)>)

    Coupon data, response status code and response headers



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/talon_one/api/integration_api.rb', line 39

def create_coupon_reservation_with_http_info(coupon_value, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.create_coupon_reservation ...'
  end
  # verify the required parameter 'coupon_value' is set
  if @api_client.config.client_side_validation && coupon_value.nil?
    fail ArgumentError, "Missing the required parameter 'coupon_value' when calling IntegrationApi.create_coupon_reservation"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling IntegrationApi.create_coupon_reservation"
  end
  # resource path
  local_var_path = '/v1/coupon_reservations/{couponValue}'.sub('{' + 'couponValue' + '}', CGI.escape(coupon_value.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(body) 

  # return_type
  return_type = opts[:return_type] || 'Coupon' 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key_v1', 'integration_auth']

  new_options = opts.merge(
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#create_coupon_reservation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_referral(body, opts = {}) ⇒ Referral

Create a referral code for an advocate Creates a referral code for an advocate. The code will be valid for the referral campaign for which is created, indicated in the ‘campaignId` parameter, and will be associated with the profile specified in the `advocateProfileIntegrationId` parameter as the advocate’s profile.

Parameters:

  • body (NewReferral)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



97
98
99
100
# File 'lib/talon_one/api/integration_api.rb', line 97

def create_referral(body, opts = {})
  data, _status_code, _headers = create_referral_with_http_info(body, opts)
  data
end

#create_referral_with_http_info(body, opts = {}) ⇒ Array<(Referral, Integer, Hash)>

Create a referral code for an advocate Creates a referral code for an advocate. The code will be valid for the referral campaign for which is created, indicated in the &#x60;campaignId&#x60; parameter, and will be associated with the profile specified in the &#x60;advocateProfileIntegrationId&#x60; parameter as the advocate&#39;s profile.

Parameters:

  • body (NewReferral)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(Referral, Integer, Hash)>)

    Referral data, response status code and response headers



107
108
109
110
111
112
113
114
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
# File 'lib/talon_one/api/integration_api.rb', line 107

def create_referral_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.create_referral ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling IntegrationApi.create_referral"
  end
  # resource path
  local_var_path = '/v1/referrals'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(body) 

  # return_type
  return_type = opts[:return_type] || 'Referral' 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key_v1', 'integration_auth']

  new_options = opts.merge(
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#create_referral\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_referrals_for_multiple_advocates(body, opts = {}) ⇒ InlineResponse201

Create referral codes for multiple advocates Creates unique referral codes for multiple advocates. The code will be valid for the referral campaign for which it is created, indicated in the ‘campaignId` parameter, and one referral code will be associated with one advocate using the profile specified in the `advocateProfileIntegrationId` parameter as the advocate’s profile.

Parameters:

Options Hash (opts):

  • :silent (String)

    If set to &#x60;yes&#x60;, response will be an empty 204, otherwise a list of integration states will be generated (up to 1000).

Returns:



162
163
164
165
# File 'lib/talon_one/api/integration_api.rb', line 162

def create_referrals_for_multiple_advocates(body, opts = {})
  data, _status_code, _headers = create_referrals_for_multiple_advocates_with_http_info(body, opts)
  data
end

#create_referrals_for_multiple_advocates_with_http_info(body, opts = {}) ⇒ Array<(InlineResponse201, Integer, Hash)>

Create referral codes for multiple advocates Creates unique referral codes for multiple advocates. The code will be valid for the referral campaign for which it is created, indicated in the &#x60;campaignId&#x60; parameter, and one referral code will be associated with one advocate using the profile specified in the &#x60;advocateProfileIntegrationId&#x60; parameter as the advocate&#39;s profile.

Parameters:

Options Hash (opts):

  • :silent (String)

    If set to &#x60;yes&#x60;, response will be an empty 204, otherwise a list of integration states will be generated (up to 1000).

Returns:

  • (Array<(InlineResponse201, Integer, Hash)>)

    InlineResponse201 data, response status code and response headers



173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# File 'lib/talon_one/api/integration_api.rb', line 173

def create_referrals_for_multiple_advocates_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.create_referrals_for_multiple_advocates ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling IntegrationApi.create_referrals_for_multiple_advocates"
  end
  # resource path
  local_var_path = '/v1/referrals_for_multiple_advocates'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'silent'] = opts[:'silent'] if !opts[:'silent'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(body) 

  # return_type
  return_type = opts[:return_type] || 'InlineResponse201' 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key_v1', 'integration_auth']

  new_options = opts.merge(
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#create_referrals_for_multiple_advocates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_coupon_reservation(coupon_value, body, opts = {}) ⇒ nil

Delete coupon reservations Removes all passed customer profiles reservation from this coupon

Parameters:

  • coupon_value (String)

    The value of a coupon

  • body (CouponReservations)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


229
230
231
232
# File 'lib/talon_one/api/integration_api.rb', line 229

def delete_coupon_reservation(coupon_value, body, opts = {})
  delete_coupon_reservation_with_http_info(coupon_value, body, opts)
  nil
end

#delete_coupon_reservation_with_http_info(coupon_value, body, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete coupon reservations Removes all passed customer profiles reservation from this coupon

Parameters:

  • coupon_value (String)

    The value of a coupon

  • body (CouponReservations)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
# File 'lib/talon_one/api/integration_api.rb', line 240

def delete_coupon_reservation_with_http_info(coupon_value, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.delete_coupon_reservation ...'
  end
  # verify the required parameter 'coupon_value' is set
  if @api_client.config.client_side_validation && coupon_value.nil?
    fail ArgumentError, "Missing the required parameter 'coupon_value' when calling IntegrationApi.delete_coupon_reservation"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling IntegrationApi.delete_coupon_reservation"
  end
  # resource path
  local_var_path = '/v1/coupon_reservations/{couponValue}'.sub('{' + 'couponValue' + '}', CGI.escape(coupon_value.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(body) 

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key_v1', 'integration_auth']

  new_options = opts.merge(
    :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(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#delete_coupon_reservation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_customer_data(integration_id, opts = {}) ⇒ nil

Delete the personal data of a customer Delete all attributes on the customer profile and on entities that reference that customer profile.

Parameters:

  • integration_id (String)

    The custom identifier for this profile, must be unique within the account.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


296
297
298
299
# File 'lib/talon_one/api/integration_api.rb', line 296

def delete_customer_data(integration_id, opts = {})
  delete_customer_data_with_http_info(integration_id, opts)
  nil
end

#delete_customer_data_with_http_info(integration_id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete the personal data of a customer Delete all attributes on the customer profile and on entities that reference that customer profile.

Parameters:

  • integration_id (String)

    The custom identifier for this profile, must be unique within the account.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



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
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
# File 'lib/talon_one/api/integration_api.rb', line 306

def delete_customer_data_with_http_info(integration_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.delete_customer_data ...'
  end
  # verify the required parameter 'integration_id' is set
  if @api_client.config.client_side_validation && integration_id.nil?
    fail ArgumentError, "Missing the required parameter 'integration_id' when calling IntegrationApi.delete_customer_data"
  end
  # resource path
  local_var_path = '/v1/customer_data/{integrationId}'.sub('{' + 'integrationId' + '}', CGI.escape(integration_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key_v1', 'integration_auth']

  new_options = opts.merge(
    :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(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#delete_customer_data\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_customer_inventory(integration_id, opts = {}) ⇒ CustomerInventory

Get an inventory of all data associated with a specific customer profile Get information regarding entities referencing this customer profile’s integrationId. Currently we support customer profile information, referral codes and reserved coupons. In the future, this will be expanded with loyalty points.

Parameters:

  • integration_id (String)

    The custom identifier for this profile, must be unique within the account.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :profile (Boolean)

    optional flag to decide if you would like customer profile information in the response

  • :referrals (Boolean)

    optional flag to decide if you would like referral information in the response

  • :coupons (Boolean)

    optional flag to decide if you would like coupon information in the response

  • :loyalty (Boolean)

    optional flag to decide if you would like loyalty information in the response

  • :giveaways (Boolean)

    optional flag to decide if you would like giveaways information in the response

Returns:



361
362
363
364
# File 'lib/talon_one/api/integration_api.rb', line 361

def get_customer_inventory(integration_id, opts = {})
  data, _status_code, _headers = get_customer_inventory_with_http_info(integration_id, opts)
  data
end

#get_customer_inventory_with_http_info(integration_id, opts = {}) ⇒ Array<(CustomerInventory, Integer, Hash)>

Get an inventory of all data associated with a specific customer profile Get information regarding entities referencing this customer profile&#39;s integrationId. Currently we support customer profile information, referral codes and reserved coupons. In the future, this will be expanded with loyalty points.

Parameters:

  • integration_id (String)

    The custom identifier for this profile, must be unique within the account.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :profile (Boolean)

    optional flag to decide if you would like customer profile information in the response

  • :referrals (Boolean)

    optional flag to decide if you would like referral information in the response

  • :coupons (Boolean)

    optional flag to decide if you would like coupon information in the response

  • :loyalty (Boolean)

    optional flag to decide if you would like loyalty information in the response

  • :giveaways (Boolean)

    optional flag to decide if you would like giveaways information in the response

Returns:

  • (Array<(CustomerInventory, Integer, Hash)>)

    CustomerInventory data, response status code and response headers



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
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
# File 'lib/talon_one/api/integration_api.rb', line 376

def get_customer_inventory_with_http_info(integration_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.get_customer_inventory ...'
  end
  # verify the required parameter 'integration_id' is set
  if @api_client.config.client_side_validation && integration_id.nil?
    fail ArgumentError, "Missing the required parameter 'integration_id' when calling IntegrationApi.get_customer_inventory"
  end
  # resource path
  local_var_path = '/v1/customer_profiles/{integrationId}/inventory'.sub('{' + 'integrationId' + '}', CGI.escape(integration_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'profile'] = opts[:'profile'] if !opts[:'profile'].nil?
  query_params[:'referrals'] = opts[:'referrals'] if !opts[:'referrals'].nil?
  query_params[:'coupons'] = opts[:'coupons'] if !opts[:'coupons'].nil?
  query_params[:'loyalty'] = opts[:'loyalty'] if !opts[:'loyalty'].nil?
  query_params[:'giveaways'] = opts[:'giveaways'] if !opts[:'giveaways'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # 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[:body] 

  # return_type
  return_type = opts[:return_type] || 'CustomerInventory' 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key_v1', 'integration_auth']

  new_options = opts.merge(
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#get_customer_inventory\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_reserved_customers(coupon_value, opts = {}) ⇒ InlineResponse200

Get the users that have this coupon reserved Returns all users that have this coupon marked as reserved

Parameters:

  • coupon_value (String)

    The value of a coupon

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



433
434
435
436
# File 'lib/talon_one/api/integration_api.rb', line 433

def get_reserved_customers(coupon_value, opts = {})
  data, _status_code, _headers = get_reserved_customers_with_http_info(coupon_value, opts)
  data
end

#get_reserved_customers_with_http_info(coupon_value, opts = {}) ⇒ Array<(InlineResponse200, Integer, Hash)>

Get the users that have this coupon reserved Returns all users that have this coupon marked as reserved

Parameters:

  • coupon_value (String)

    The value of a coupon

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(InlineResponse200, Integer, Hash)>)

    InlineResponse200 data, response status code and response headers



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
483
484
485
486
487
488
# File 'lib/talon_one/api/integration_api.rb', line 443

def get_reserved_customers_with_http_info(coupon_value, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.get_reserved_customers ...'
  end
  # verify the required parameter 'coupon_value' is set
  if @api_client.config.client_side_validation && coupon_value.nil?
    fail ArgumentError, "Missing the required parameter 'coupon_value' when calling IntegrationApi.get_reserved_customers"
  end
  # resource path
  local_var_path = '/v1/coupon_reservations/customerprofiles/{couponValue}'.sub('{' + 'couponValue' + '}', CGI.escape(coupon_value.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # 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[:body] 

  # return_type
  return_type = opts[:return_type] || 'InlineResponse200' 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key_v1', 'integration_auth']

  new_options = opts.merge(
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#get_reserved_customers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#track_event(body, opts = {}) ⇒ IntegrationState

Track an Event Records an arbitrary event in a customer session. For example, an integration might record an event when a user updates their payment information. The ‘sessionId` body parameter is required, an event is always part of a session. Much like updating a customer session, if either the profile or the session do not exist, a new empty one will be created. Note that if the specified session already exists, it must belong to the same `profileId` or an error will be returned. As with customer sessions, you can use an empty string for `profileId` to indicate that this is an anonymous session. Updating a customer profile will return a response with the full integration state. This includes the current state of the customer profile, the customer session, the event that was recorded, and an array of effects that took place.

Parameters:

  • body (NewEvent)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :dry (Boolean)

    Indicates whether to persist the changes. Changes are ignored when &#x60;dry&#x3D;true&#x60;.

Returns:



496
497
498
499
# File 'lib/talon_one/api/integration_api.rb', line 496

def track_event(body, opts = {})
  data, _status_code, _headers = track_event_with_http_info(body, opts)
  data
end

#track_event_with_http_info(body, opts = {}) ⇒ Array<(IntegrationState, Integer, Hash)>

Track an Event Records an arbitrary event in a customer session. For example, an integration might record an event when a user updates their payment information. The &#x60;sessionId&#x60; body parameter is required, an event is always part of a session. Much like updating a customer session, if either the profile or the session do not exist, a new empty one will be created. Note that if the specified session already exists, it must belong to the same &#x60;profileId&#x60; or an error will be returned. As with customer sessions, you can use an empty string for &#x60;profileId&#x60; to indicate that this is an anonymous session. Updating a customer profile will return a response with the full integration state. This includes the current state of the customer profile, the customer session, the event that was recorded, and an array of effects that took place.

Parameters:

  • body (NewEvent)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :dry (Boolean)

    Indicates whether to persist the changes. Changes are ignored when &#x60;dry&#x3D;true&#x60;.

Returns:

  • (Array<(IntegrationState, Integer, Hash)>)

    IntegrationState data, response status code and response headers



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
553
554
555
# File 'lib/talon_one/api/integration_api.rb', line 507

def track_event_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.track_event ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling IntegrationApi.track_event"
  end
  # resource path
  local_var_path = '/v1/events'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'dry'] = opts[:'dry'] if !opts[:'dry'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(body) 

  # return_type
  return_type = opts[:return_type] || 'IntegrationState' 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key_v1', 'integration_auth']

  new_options = opts.merge(
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#track_event\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_customer_profile(integration_id, body, opts = {}) ⇒ IntegrationState

Update a Customer Profile V1 ⚠️ Deprecation Notice: Support for requests to this endpoint will end on 15.07.2021. We will not remove the endpoint, and it will still be accessible for you to use. For new features support, migrate to [API V2.0](/Getting-Started/APIV2). Update (or create) a [Customer Profile](developers.talon.one/Getting-Started/entities#customer-profile). This profile information can then be matched and/or updated by campaign [Rules][]. The ‘integrationId` may be any identifier that will remain stable for the customer. For example, you might use a database ID, an email, or a phone number as the `integrationId`. It is vital that this ID not change over time, so **don’t** use any identifier that the customer can update themselves. E.g. if your application allows a customer to update their e-mail address, you should instead use a database ID. Updating a customer profile will return a response with the full integration state. This includes the current state of the customer profile, the customer session, the event that was recorded, and an array of effects that took place. [Customer Profile]: /Getting-Started/entities#customer-profile [Rules]: /Getting-Started/entities#campaigns-rulesets-and-coupons

Parameters:

  • integration_id (String)

    The custom identifier for this profile, must be unique within the account.

  • body (NewCustomerProfile)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :dry (Boolean)

    Indicates whether to persist the changes. Changes are ignored when &#x60;dry&#x3D;true&#x60;.

Returns:



564
565
566
567
# File 'lib/talon_one/api/integration_api.rb', line 564

def update_customer_profile(integration_id, body, opts = {})
  data, _status_code, _headers = update_customer_profile_with_http_info(integration_id, body, opts)
  data
end

#update_customer_profile_audiences(body, opts = {}) ⇒ nil

Update a Customer Profile Audiences Update one ore multiple Customer Profiles with the specified Audiences

Parameters:

Returns:

  • (nil)


635
636
637
638
# File 'lib/talon_one/api/integration_api.rb', line 635

def update_customer_profile_audiences(body, opts = {})
  update_customer_profile_audiences_with_http_info(body, opts)
  nil
end

#update_customer_profile_audiences_with_http_info(body, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Update a Customer Profile Audiences Update one ore multiple Customer Profiles with the specified Audiences

Parameters:

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



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
# File 'lib/talon_one/api/integration_api.rb', line 645

def update_customer_profile_audiences_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.update_customer_profile_audiences ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling IntegrationApi.update_customer_profile_audiences"
  end
  # resource path
  local_var_path = '/v2/customer_audiences'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(body) 

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key_v1']

  new_options = opts.merge(
    :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, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#update_customer_profile_audiences\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_customer_profile_v2(integration_id, body, opts = {}) ⇒ IntegrationStateV2

Update a Customer Profile Update (or create) a [Customer Profile](developers.talon.one/Getting-Started/entities#customer-profile). The ‘integrationId` must be any identifier that remains stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Updating a customer profile returns a response with the requested integration state. If `runRuleEngine` is set to `true`, the response includes: - The effects generated by the triggered campaigns. - The created coupons and referral objects. - Any entity that was requested in the `responseContent` request parameter.

Parameters:

  • integration_id (String)

    The custom identifier for this profile. Must be unique within the account.

  • body (CustomerProfileIntegrationRequestV2)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :run_rule_engine (Boolean)

    Indicates whether to run the rule engine. (default to false)

  • :dry (Boolean)

    Indicates whether to persist the changes. Changes are ignored when &#x60;dry&#x3D;true&#x60;. Only used when &#x60;runRuleEngine&#x60; is set to &#x60;true&#x60;.

Returns:



700
701
702
703
# File 'lib/talon_one/api/integration_api.rb', line 700

def update_customer_profile_v2(integration_id, body, opts = {})
  data, _status_code, _headers = update_customer_profile_v2_with_http_info(integration_id, body, opts)
  data
end

#update_customer_profile_v2_with_http_info(integration_id, body, opts = {}) ⇒ Array<(IntegrationStateV2, Integer, Hash)>

Update a Customer Profile Update (or create) a [Customer Profile](developers.talon.one/Getting-Started/entities#customer-profile). The &#x60;integrationId&#x60; must be any identifier that remains stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. Updating a customer profile returns a response with the requested integration state. If &#x60;runRuleEngine&#x60; is set to &#x60;true&#x60;, the response includes: - The effects generated by the triggered campaigns. - The created coupons and referral objects. - Any entity that was requested in the &#x60;responseContent&#x60; request parameter.

Parameters:

  • integration_id (String)

    The custom identifier for this profile. Must be unique within the account.

  • body (CustomerProfileIntegrationRequestV2)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :run_rule_engine (Boolean)

    Indicates whether to run the rule engine.

  • :dry (Boolean)

    Indicates whether to persist the changes. Changes are ignored when &#x60;dry&#x3D;true&#x60;. Only used when &#x60;runRuleEngine&#x60; is set to &#x60;true&#x60;.

Returns:

  • (Array<(IntegrationStateV2, Integer, Hash)>)

    IntegrationStateV2 data, response status code and response headers



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
763
764
765
766
# File 'lib/talon_one/api/integration_api.rb', line 713

def update_customer_profile_v2_with_http_info(integration_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.update_customer_profile_v2 ...'
  end
  # verify the required parameter 'integration_id' is set
  if @api_client.config.client_side_validation && integration_id.nil?
    fail ArgumentError, "Missing the required parameter 'integration_id' when calling IntegrationApi.update_customer_profile_v2"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling IntegrationApi.update_customer_profile_v2"
  end
  # resource path
  local_var_path = '/v2/customer_profiles/{integrationId}'.sub('{' + 'integrationId' + '}', CGI.escape(integration_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'runRuleEngine'] = opts[:'run_rule_engine'] if !opts[:'run_rule_engine'].nil?
  query_params[:'dry'] = opts[:'dry'] if !opts[:'dry'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(body) 

  # return_type
  return_type = opts[:return_type] || 'IntegrationStateV2' 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key_v1']

  new_options = opts.merge(
    :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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#update_customer_profile_v2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_customer_profile_with_http_info(integration_id, body, opts = {}) ⇒ Array<(IntegrationState, Integer, Hash)>

Update a Customer Profile V1 ⚠️ Deprecation Notice: Support for requests to this endpoint will end on 15.07.2021. We will not remove the endpoint, and it will still be accessible for you to use. For new features support, migrate to [API V2.0](/Getting-Started/APIV2). Update (or create) a [Customer Profile](developers.talon.one/Getting-Started/entities#customer-profile). This profile information can then be matched and/or updated by campaign [Rules][]. The &#x60;integrationId&#x60; may be any identifier that will remain stable for the customer. For example, you might use a database ID, an email, or a phone number as the &#x60;integrationId&#x60;. It is vital that this ID not change over time, so **don&#39;t** use any identifier that the customer can update themselves. E.g. if your application allows a customer to update their e-mail address, you should instead use a database ID. Updating a customer profile will return a response with the full integration state. This includes the current state of the customer profile, the customer session, the event that was recorded, and an array of effects that took place. [Customer Profile]: /Getting-Started/entities#customer-profile [Rules]: /Getting-Started/entities#campaigns-rulesets-and-coupons

Parameters:

  • integration_id (String)

    The custom identifier for this profile, must be unique within the account.

  • body (NewCustomerProfile)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :dry (Boolean)

    Indicates whether to persist the changes. Changes are ignored when &#x60;dry&#x3D;true&#x60;.

Returns:

  • (Array<(IntegrationState, Integer, Hash)>)

    IntegrationState data, response status code and response headers



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
623
624
625
626
627
628
# File 'lib/talon_one/api/integration_api.rb', line 576

def update_customer_profile_with_http_info(integration_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.update_customer_profile ...'
  end
  # verify the required parameter 'integration_id' is set
  if @api_client.config.client_side_validation && integration_id.nil?
    fail ArgumentError, "Missing the required parameter 'integration_id' when calling IntegrationApi.update_customer_profile"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling IntegrationApi.update_customer_profile"
  end
  # resource path
  local_var_path = '/v1/customer_profiles/{integrationId}'.sub('{' + 'integrationId' + '}', CGI.escape(integration_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'dry'] = opts[:'dry'] if !opts[:'dry'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(body) 

  # return_type
  return_type = opts[:return_type] || 'IntegrationState' 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key_v1', 'integration_auth']

  new_options = opts.merge(
    :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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#update_customer_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_customer_profiles_v2(body, opts = {}) ⇒ MultipleCustomerProfileIntegrationResponseV2

Update multiple Customer Profiles Update (or create) up to 1000 [Customer Profiles](developers.talon.one/Getting-Started/entities#customer-profile) in 1 request. The ‘integrationId` must be any identifier that remains stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. A customer profile [can be linked to one or more sessions](developers.talon.one/Integration-API/API-Reference#updateCustomerSessionV2).

Parameters:

Options Hash (opts):

  • :silent (String)

    If set to &#x60;yes&#x60;, response will be an empty 204, otherwise a list of integration states will be generated (up to 1000).

Returns:



774
775
776
777
# File 'lib/talon_one/api/integration_api.rb', line 774

def update_customer_profiles_v2(body, opts = {})
  data, _status_code, _headers = update_customer_profiles_v2_with_http_info(body, opts)
  data
end

#update_customer_profiles_v2_with_http_info(body, opts = {}) ⇒ Array<(MultipleCustomerProfileIntegrationResponseV2, Integer, Hash)>

Update multiple Customer Profiles Update (or create) up to 1000 [Customer Profiles](developers.talon.one/Getting-Started/entities#customer-profile) in 1 request. The &#x60;integrationId&#x60; must be any identifier that remains stable for the customer. Do not use an ID that the customer can update themselves. For example, you can use a database ID. A customer profile [can be linked to one or more sessions](developers.talon.one/Integration-API/API-Reference#updateCustomerSessionV2).

Parameters:

Options Hash (opts):

  • :silent (String)

    If set to &#x60;yes&#x60;, response will be an empty 204, otherwise a list of integration states will be generated (up to 1000).

Returns:



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
# File 'lib/talon_one/api/integration_api.rb', line 785

def update_customer_profiles_v2_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.update_customer_profiles_v2 ...'
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling IntegrationApi.update_customer_profiles_v2"
  end
  # resource path
  local_var_path = '/v2/customer_profiles'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'silent'] = opts[:'silent'] if !opts[:'silent'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(body) 

  # return_type
  return_type = opts[:return_type] || 'MultipleCustomerProfileIntegrationResponseV2' 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key_v1']

  new_options = opts.merge(
    :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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#update_customer_profiles_v2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_customer_session(customer_session_id, body, opts = {}) ⇒ IntegrationState

Update a Customer Session V1 ⚠️ Deprecation Notice: Support for requests to this endpoint will end on 15.07.2021. We will not remove the endpoint, and it will still be accessible for you to use. For new features support, migrate to [API V2.0](developers.talon.one/Getting-Started/APIV2). Update (or create) a [Customer Session](developers.talon.one/Getting-Started/entities#customer-session). For example, use this endpoint to represent which items are in the customer’s cart. The Talon.One platform supports multiple simultaneous sessions for the same profile. If you have multiple ways of accessing the same application you can either: - Track multiple independent sessions or, - Use the same session across all of them. You should share sessions when application access points share other state, such as the user’s cart. If two points of access to the application have independent states, for example a user can have different items in their cart across the two) they should use independent customer session ID’s. To link a session to a customer profile, set the ‘profileId` parameter in the request body to a customer profile’s ‘integrationId`. To track an anonymous session use the empty string (`""`) as the `profileId`. Note: You do not have to create a customer profile first. If the specified profile does not exist, an empty profile is created automatically. Updating a customer profile returns a response with the full integration state. This includes the current state of the customer profile, the customer session, the event that was recorded, and an array of effects that took place. The currency for the session and the cart items in the session is the same as that of the application with which the session is associated.

Parameters:

  • customer_session_id (String)

    The custom identifier for this session, must be unique within the account.

  • body (NewCustomerSession)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :dry (Boolean)

    Indicates whether to persist the changes. Changes are ignored when &#x60;dry&#x3D;true&#x60;.

Returns:



842
843
844
845
# File 'lib/talon_one/api/integration_api.rb', line 842

def update_customer_session(customer_session_id, body, opts = {})
  data, _status_code, _headers = update_customer_session_with_http_info(customer_session_id, body, opts)
  data
end

#update_customer_session_v2(customer_session_id, body, opts = {}) ⇒ IntegrationStateV2

Update a Customer Session Update (or create) a [Customer Session](developers.talon.one/Getting-Started/entities#customer-session). For example, use this endpoint to represent which items are in the customer’s cart. The Talon.One platform supports multiple simultaneous sessions for the same profile. If you have multiple ways of accessing the same application you can either: - Track multiple independent sessions or, - Use the same session across all of them. You should share sessions when application access points share other state, such as the user’s cart. If two points of access to the application have independent states, for example a user can have different items in their cart across the two) they should use independent customer session ID’s. To link a session to a customer profile, set the ‘profileId` parameter in the request body to a customer profile’s ‘integrationId`. To track an anonymous session use the empty string (`""`) as the `profileId`. Note: You do not have to create a customer profile first. If the specified profile does not exist, an empty profile is created automatically. Updating a customer session returns a response with the requested integration state. If `runRuleEngine` is set to `true`, the response includes: - The effects generated by the triggered campaigns. - The created coupons and referral objects. - Any entity that was requested in the `responseContent` request parameter. The currency for the session and the cart items in the session is the same as that of the application with which the session is associated.

Parameters:

  • customer_session_id (String)

    The custom identifier for this session, must be unique within the account.

  • body (IntegrationRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :dry (Boolean)

    Indicates whether to persist the changes. Changes are ignored when &#x60;dry&#x3D;true&#x60;.

Returns:



915
916
917
918
# File 'lib/talon_one/api/integration_api.rb', line 915

def update_customer_session_v2(customer_session_id, body, opts = {})
  data, _status_code, _headers = update_customer_session_v2_with_http_info(customer_session_id, body, opts)
  data
end

#update_customer_session_v2_with_http_info(customer_session_id, body, opts = {}) ⇒ Array<(IntegrationStateV2, Integer, Hash)>

Update a Customer Session Update (or create) a [Customer Session](developers.talon.one/Getting-Started/entities#customer-session). For example, use this endpoint to represent which items are in the customer&#39;s cart. The Talon.One platform supports multiple simultaneous sessions for the same profile. If you have multiple ways of accessing the same application you can either: - Track multiple independent sessions or, - Use the same session across all of them. You should share sessions when application access points share other state, such as the user&#39;s cart. If two points of access to the application have independent states, for example a user can have different items in their cart across the two) they should use independent customer session ID&#39;s. To link a session to a customer profile, set the &#x60;profileId&#x60; parameter in the request body to a customer profile&#39;s &#x60;integrationId&#x60;. To track an anonymous session use the empty string (&#x60;&quot;&quot;&#x60;) as the &#x60;profileId&#x60;. Note: You do not have to create a customer profile first. If the specified profile does not exist, an empty profile is created automatically. Updating a customer session returns a response with the requested integration state. If &#x60;runRuleEngine&#x60; is set to &#x60;true&#x60;, the response includes: - The effects generated by the triggered campaigns. - The created coupons and referral objects. - Any entity that was requested in the &#x60;responseContent&#x60; request parameter. The currency for the session and the cart items in the session is the same as that of the application with which the session is associated.

Parameters:

  • customer_session_id (String)

    The custom identifier for this session, must be unique within the account.

  • body (IntegrationRequest)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :dry (Boolean)

    Indicates whether to persist the changes. Changes are ignored when &#x60;dry&#x3D;true&#x60;.

Returns:

  • (Array<(IntegrationStateV2, Integer, Hash)>)

    IntegrationStateV2 data, response status code and response headers



927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
# File 'lib/talon_one/api/integration_api.rb', line 927

def update_customer_session_v2_with_http_info(customer_session_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.update_customer_session_v2 ...'
  end
  # verify the required parameter 'customer_session_id' is set
  if @api_client.config.client_side_validation && customer_session_id.nil?
    fail ArgumentError, "Missing the required parameter 'customer_session_id' when calling IntegrationApi.update_customer_session_v2"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling IntegrationApi.update_customer_session_v2"
  end
  # resource path
  local_var_path = '/v2/customer_sessions/{customerSessionId}'.sub('{' + 'customerSessionId' + '}', CGI.escape(customer_session_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'dry'] = opts[:'dry'] if !opts[:'dry'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(body) 

  # return_type
  return_type = opts[:return_type] || 'IntegrationStateV2' 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key_v1']

  new_options = opts.merge(
    :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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#update_customer_session_v2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_customer_session_with_http_info(customer_session_id, body, opts = {}) ⇒ Array<(IntegrationState, Integer, Hash)>

Update a Customer Session V1 ⚠️ Deprecation Notice: Support for requests to this endpoint will end on 15.07.2021. We will not remove the endpoint, and it will still be accessible for you to use. For new features support, migrate to [API V2.0](developers.talon.one/Getting-Started/APIV2). Update (or create) a [Customer Session](developers.talon.one/Getting-Started/entities#customer-session). For example, use this endpoint to represent which items are in the customer&#39;s cart. The Talon.One platform supports multiple simultaneous sessions for the same profile. If you have multiple ways of accessing the same application you can either: - Track multiple independent sessions or, - Use the same session across all of them. You should share sessions when application access points share other state, such as the user&#39;s cart. If two points of access to the application have independent states, for example a user can have different items in their cart across the two) they should use independent customer session ID&#39;s. To link a session to a customer profile, set the &#x60;profileId&#x60; parameter in the request body to a customer profile&#39;s &#x60;integrationId&#x60;. To track an anonymous session use the empty string (&#x60;&quot;&quot;&#x60;) as the &#x60;profileId&#x60;. Note: You do not have to create a customer profile first. If the specified profile does not exist, an empty profile is created automatically. Updating a customer profile returns a response with the full integration state. This includes the current state of the customer profile, the customer session, the event that was recorded, and an array of effects that took place. The currency for the session and the cart items in the session is the same as that of the application with which the session is associated.

Parameters:

  • customer_session_id (String)

    The custom identifier for this session, must be unique within the account.

  • body (NewCustomerSession)
  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :dry (Boolean)

    Indicates whether to persist the changes. Changes are ignored when &#x60;dry&#x3D;true&#x60;.

Returns:

  • (Array<(IntegrationState, Integer, Hash)>)

    IntegrationState data, response status code and response headers



854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
# File 'lib/talon_one/api/integration_api.rb', line 854

def update_customer_session_with_http_info(customer_session_id, body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.update_customer_session ...'
  end
  # verify the required parameter 'customer_session_id' is set
  if @api_client.config.client_side_validation && customer_session_id.nil?
    fail ArgumentError, "Missing the required parameter 'customer_session_id' when calling IntegrationApi.update_customer_session"
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling IntegrationApi.update_customer_session"
  end
  # resource path
  local_var_path = '/v1/customer_sessions/{customerSessionId}'.sub('{' + 'customerSessionId' + '}', CGI.escape(customer_session_id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'dry'] = opts[:'dry'] if !opts[:'dry'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(body) 

  # return_type
  return_type = opts[:return_type] || 'IntegrationState' 

  # auth_names
  auth_names = opts[:auth_names] || ['api_key_v1', 'integration_auth']

  new_options = opts.merge(
    :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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#update_customer_session\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end