Sha256: fdb77eea8678a9d44f7ee93983897ba15e03f79a4164498e751c51d3cfc00596

Contents?: true

Size: 736 Bytes

Versions: 2

Compression:

Stored size: 736 Bytes

Contents

module Mrkt
  module ImportLeads
    def import_lead(file, format = 'csv', lookup_field = nil, list_id: nil, partition_name: nil)
      params = {
        format: format,
        file: Faraday::UploadIO.new(file, 'text/csv')
      }
      params[:lookupField] = lookup_field if lookup_field
      params[:listId] = list_id if list_id
      params[:partitionName] = partition_name if partition_name

      post('/bulk/v1/leads.json', params)
    end

    def import_lead_status(id)
      get("/bulk/v1/leads/batch/#{id}.json")
    end

    def import_lead_failures(id)
      get("/bulk/v1/leads/batch/#{id}/failures.json")
    end

    def import_lead_warnings(id)
      get("/bulk/v1/leads/batch/#{id}/warnings.json")
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mrkt-0.5.0 lib/mrkt/concerns/import_leads.rb
mrkt-0.4.0 lib/mrkt/concerns/import_leads.rb