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

#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)


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

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



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

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)


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

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



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

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

Returns:



292
293
294
295
# File 'lib/talon_one/api/integration_api.rb', line 292

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

Returns:

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

    CustomerInventory data, response status code and response headers



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

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?

  # 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:



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

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



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
404
405
406
407
408
409
410
411
412
413
414
415
# File 'lib/talon_one/api/integration_api.rb', line 370

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)

    Flag to indicate whether to skip persisting the changes or not (Will not persist if set to &#39;true&#39;).

Returns:



423
424
425
426
# File 'lib/talon_one/api/integration_api.rb', line 423

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)

    Flag to indicate whether to skip persisting the changes or not (Will not persist if set to &#39;true&#39;).

Returns:

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

    IntegrationState data, response status code and response headers



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

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 Update (or create) a [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)

    Flag to indicate whether to skip persisting the changes or not (Will not persist if set to &#39;true&#39;).

Returns:



491
492
493
494
# File 'lib/talon_one/api/integration_api.rb', line 491

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_v2(customer_profile_id, body, opts = {}) ⇒ CustomerProfileUpdate

Update a Customer Profile Update (or create) a [Customer Profile][]. 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. [Customer Profile]: /Getting-Started/entities#customer-profile

Parameters:

  • customer_profile_id (String)

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

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

    the optional parameters

Returns:



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

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

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

Update a Customer Profile Update (or create) a [Customer Profile][]. 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. [Customer Profile]: /Getting-Started/entities#customer-profile

Parameters:

  • customer_profile_id (String)

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

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

    the optional parameters

Returns:

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

    CustomerProfileUpdate data, response status code and response headers



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

def update_customer_profile_v2_with_http_info(customer_profile_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 'customer_profile_id' is set
  if @api_client.config.client_side_validation && customer_profile_id.nil?
    fail ArgumentError, "Missing the required parameter 'customer_profile_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/{customerProfileId}'.sub('{' + 'customerProfileId' + '}', CGI.escape(customer_profile_id.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] || 'CustomerProfileUpdate' 

  # 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 Update (or create) a [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)

    Flag to indicate whether to skip persisting the changes or not (Will not persist if set to &#39;true&#39;).

Returns:

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

    IntegrationState data, response status code and response headers



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

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_session(customer_session_id, body, opts = {}) ⇒ IntegrationState

Update a Customer Session Update (or create) a [Customer Session][]. For example, the items in a customers cart are part of a session. The Talon.One platform supports multiple simultaneous sessions for the same profile, so if you have multiple ways of accessing the same application you have the option of either tracking multiple independent sessions or using the same session across all of them. You should share sessions when application access points share other state, such as the users cart. If two points of access to the application have independent state (e.g. a user can have different items in their cart across the two) they should use independent customer session ID’s. The ‘profileId` parameter in the request body should correspond to an `integrationId` for a customer profile, to track an anonymous session use the empty string (`""`) as the `profileId`. Note that you do not need to create a customer profile first: if the specified profile does not yet exist, an empty profile will be created automatically. 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. 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. [Customer Session]: /Getting-Started/entities#customer-session

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)

    Flag to indicate whether to skip persisting the changes or not (Will not persist if set to &#39;true&#39;).

Returns:



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

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][]. For example, the items in a customers cart are part of a session. The Talon.One platform supports multiple simultaneous sessions for the same profile, so if you have multiple ways of accessing the same application you have the option of either tracking multiple independent sessions or using the same session across all of them. You should share sessions when application access points share other state, such as the users cart. If two points of access to the application have independent state (e.g. a user can have different items in their cart across the two) they should use independent customer session ID’s. The ‘profileId` parameter in the request body should correspond to an `integrationId` for a customer profile, to track an anonymous session use the empty string (`""`) as the `profileId`. Note that you do not need to create a customer profile first: if the specified profile does not yet exist, an empty profile will be created automatically. Updating a customer profile will return a response with the requested integration state. This includes the effects that were generated due to triggered campaigns, the created coupons and referral objects, as well as any entity that was requested in the request parameter "responseContent". 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. [Customer Session]: /Getting-Started/entities#customer-session

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)

    Flag to indicate whether to skip persisting the changes or not (Will not persist if set to &#39;true&#39;).

Returns:



707
708
709
710
# File 'lib/talon_one/api/integration_api.rb', line 707

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][]. For example, the items in a customers cart are part of a session. The Talon.One platform supports multiple simultaneous sessions for the same profile, so if you have multiple ways of accessing the same application you have the option of either tracking multiple independent sessions or using the same session across all of them. You should share sessions when application access points share other state, such as the users cart. If two points of access to the application have independent state (e.g. a user can have different items in their cart across the two) they should use independent customer session ID&#39;s. The &#x60;profileId&#x60; parameter in the request body should correspond to an &#x60;integrationId&#x60; for a customer profile, to track an anonymous session use the empty string (&#x60;&quot;&quot;&#x60;) as the &#x60;profileId&#x60;. Note that you do not need to create a customer profile first: if the specified profile does not yet exist, an empty profile will be created automatically. Updating a customer profile will return a response with the requested integration state. This includes the effects that were generated due to triggered campaigns, the created coupons and referral objects, as well as any entity that was requested in the request parameter &quot;responseContent&quot;. 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. [Customer Session]: /Getting-Started/entities#customer-session

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)

    Flag to indicate whether to skip persisting the changes or not (Will not persist if set to &#39;true&#39;).

Returns:

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

    IntegrationStateV2 data, response status code and response headers



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
767
768
769
770
771
# File 'lib/talon_one/api/integration_api.rb', line 719

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 Update (or create) a [Customer Session][]. For example, the items in a customers cart are part of a session. The Talon.One platform supports multiple simultaneous sessions for the same profile, so if you have multiple ways of accessing the same application you have the option of either tracking multiple independent sessions or using the same session across all of them. You should share sessions when application access points share other state, such as the users cart. If two points of access to the application have independent state (e.g. a user can have different items in their cart across the two) they should use independent customer session ID&#39;s. The &#x60;profileId&#x60; parameter in the request body should correspond to an &#x60;integrationId&#x60; for a customer profile, to track an anonymous session use the empty string (&#x60;&quot;&quot;&#x60;) as the &#x60;profileId&#x60;. Note that you do not need to create a customer profile first: if the specified profile does not yet exist, an empty profile will be created automatically. 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. 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. [Customer Session]: /Getting-Started/entities#customer-session

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)

    Flag to indicate whether to skip persisting the changes or not (Will not persist if set to &#39;true&#39;).

Returns:

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

    IntegrationState data, response status code and response headers



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
693
694
695
696
697
698
# File 'lib/talon_one/api/integration_api.rb', line 646

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