lib/emarsys/data_objects/contact.rb
# Update a contact. The given params are transformed to emarsys ids.
#
# @param key_id [Integer, String] internal id of key field
# @param key_value [Integer, String] value of internal id field
# @param params [Hash] Contact information to update
# @param create_if_not_exists [Boolean] Whether to create contact if it does not exist
# @return [Hash] internal id of the contact
# @example
#   Emarsys::Contact.update('app_id', 23, {:firstname => "Jon", :lastname => "Doe"})
#   Emarsys::Contact.update('3', 'john.doe@example.com', {'1' => "Jon", '2' => "Doe"}, true)
Update a contact. The given params are transformed to emarsys ids.
Update a contact . The given params are transformed to emarsys ids .
def update(key_id:, key_value:, params: {}, create_if_not_exists: false, account: nil)
        path = "contact#{create_if_not_exists ? '/?create_if_not_exists=1' : ''}"
        transformed_key_id = transform_key_id(key_id)
        put account, path, params.merge!({'key_id' => transformed_key_id, transformed_key_id => key_value})
      end
def update ( key_id : , key_value : , params : { } , create_if_not_exists : false , account : nil ) path = "contact#{create_if_not_exists ? '/?create_if_not_exists=1' : ''}" transformed_key_id = transform_key_id ( key_id ) put account , path , params . merge! ( { 'key_id' => transformed_key_id , transformed_key_id => key_value } ) end
Update a contact.
Update a contact .
internal id of the contact
internal id of the contact
Hash
key_id
internal id of key field
internal id of key field
key_value
value of internal id field
value of internal id field
params
Contact information to update
Contact information to update
create_if_not_exists
Whether to create contact if it does not exist
Whether to create contact if it does not exist
account
<not_specific>
example
None