Sha256: d5bee003ad250ce1e69d1bd6feca014cdc87ebf1f24c764f45d65ed09061b337

Contents?: true

Size: 965 Bytes

Versions: 4

Compression:

Stored size: 965 Bytes

Contents

module CustomerioAPI
  class TrackResource < Resource
    # Example: Create/Update a Shop object
    # attributes = { type: 'object', action: 'identify', identifiers: { object_type_id: '2', object_id: 'linh-us'}, attributes: {name: "linh-us"} }
    # v2_client.track.entity(attributes)
    # Response: {}

    def entity(attributes)
      post_request('entity', body: attributes).body
    end

    # Example: Create/Update multiple objects
    # attributes: an array of people or objects
    # attributes = [
    #   { type: 'object', action: 'identify', identifiers: { object_type_id: '1', object_id: 'linh-us' }, attributes: { name: 'linh-us' } },
    #   { type: 'object', action: 'identify', identifiers: { object_type_id: '1', object_id: 'PostCo' }, attributes: { name: 'PostCo' } }
    #   ]

    # v2_client.track.batch(attributes)
    # Response: {}

    def batch(attributes)
      post_request('batch', body: { batch: attributes }).body
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
customerio_api-0.5.0 lib/customerio_api/resources/track_resource.rb
customerio_api-0.4.0 lib/customerio_api/resources/track_resource.rb
customerio_api-0.3.0 lib/customerio_api/resources/track_resource.rb
customerio_api-0.2.0 lib/customerio_api/resources/track_resource.rb