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

    The value of a coupon

  • body
  • 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, Fixnum, Hash)>

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

Parameters:

  • coupon_value

    The value of a coupon

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

    the optional parameters

Returns:

  • (Array<(Coupon, Fixnum, 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
# 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' + '}', coupon_value.to_s)

  # query parameters
  query_params = {}

  # header parameters
  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 = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['api_key_v1', 'integration_auth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Coupon')
  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
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



87
88
89
90
# File 'lib/talon_one/api/integration_api.rb', line 87

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, Fixnum, 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
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    Referral data, response status code and response headers



97
98
99
100
101
102
103
104
105
106
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
# File 'lib/talon_one/api/integration_api.rb', line 97

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 = {}

  # header parameters
  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 = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['api_key_v1', 'integration_auth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'Referral')
  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

    The value of a coupon

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

    the optional parameters

Returns:

  • (nil)


142
143
144
145
# File 'lib/talon_one/api/integration_api.rb', line 142

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, Fixnum, Hash)>

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

Parameters:

  • coupon_value

    The value of a coupon

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
# File 'lib/talon_one/api/integration_api.rb', line 153

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' + '}', coupon_value.to_s)

  # query parameters
  query_params = {}

  # header parameters
  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 = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['api_key_v1', 'integration_auth']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  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

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

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

    the optional parameters

Returns:

  • (nil)


200
201
202
203
# File 'lib/talon_one/api/integration_api.rb', line 200

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, Fixnum, 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

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

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
# File 'lib/talon_one/api/integration_api.rb', line 210

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' + '}', integration_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  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 = {}

  # http body (model)
  post_body = nil
  auth_names = ['api_key_v1', 'integration_auth']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  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_reserved_coupons(integration_id, opts = {}) ⇒ InlineResponse2001

Get all valid reserved coupons Returns all coupons this user is subscribed to that are valid and usable

Parameters:

  • integration_id

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

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

    the optional parameters

Returns:



253
254
255
256
# File 'lib/talon_one/api/integration_api.rb', line 253

def get_reserved_coupons(integration_id, opts = {})
  data, _status_code, _headers = get_reserved_coupons_with_http_info(integration_id, opts)
  data
end

#get_reserved_coupons_with_http_info(integration_id, opts = {}) ⇒ Array<(InlineResponse2001, Fixnum, Hash)>

Get all valid reserved coupons Returns all coupons this user is subscribed to that are valid and usable

Parameters:

  • integration_id

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

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

    the optional parameters

Returns:

  • (Array<(InlineResponse2001, Fixnum, Hash)>)

    InlineResponse2001 data, response status code and response headers



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
290
291
292
293
294
295
296
297
298
299
300
301
# File 'lib/talon_one/api/integration_api.rb', line 263

def get_reserved_coupons_with_http_info(integration_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: IntegrationApi.get_reserved_coupons ...'
  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_reserved_coupons"
  end
  # resource path
  local_var_path = '/v1/coupon_reservations/coupons/{integrationId}'.sub('{' + 'integrationId' + '}', integration_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  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 = {}

  # http body (model)
  post_body = nil
  auth_names = ['api_key_v1', 'integration_auth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InlineResponse2001')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: IntegrationApi#get_reserved_coupons\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

    The value of a coupon

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

    the optional parameters

Returns:



307
308
309
310
# File 'lib/talon_one/api/integration_api.rb', line 307

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, Fixnum, Hash)>

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

Parameters:

  • coupon_value

    The value of a coupon

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

    the optional parameters

Returns:

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

    InlineResponse200 data, response status code and response headers



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

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' + '}', coupon_value.to_s)

  # query parameters
  query_params = {}

  # header parameters
  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 = {}

  # http body (model)
  post_body = nil
  auth_names = ['api_key_v1', 'integration_auth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'InlineResponse200')
  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
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



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

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, Fixnum, 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
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    IntegrationState data, response status code and response headers



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

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 = {}

  # header parameters
  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 = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['api_key_v1', 'integration_auth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'IntegrationState')
  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

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

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

    the optional parameters

Returns:



416
417
418
419
# File 'lib/talon_one/api/integration_api.rb', line 416

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_with_http_info(integration_id, body, opts = {}) ⇒ Array<(IntegrationState, Fixnum, 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

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

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

    the optional parameters

Returns:

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

    IntegrationState data, response status code and response headers



427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
# File 'lib/talon_one/api/integration_api.rb', line 427

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' + '}', integration_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  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 = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['api_key_v1', 'integration_auth']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'IntegrationState')
  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

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

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

    the optional parameters

Returns:



476
477
478
479
# File 'lib/talon_one/api/integration_api.rb', line 476

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

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

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

    the optional parameters

Returns:

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

    IntegrationState data, response status code and response headers



487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
# File 'lib/talon_one/api/integration_api.rb', line 487

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' + '}', customer_session_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  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 = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['api_key_v1', 'integration_auth']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'IntegrationState')
  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