Sha256: bc8b423ffb98755999498cb9df1013792db1ad16b1bed17e6d90185e2d8c56a2

Contents?: true

Size: 708 Bytes

Versions: 6

Compression:

Stored size: 708 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')
      }

      optional = {
        lookupField: lookup_field,
        listId: list_id,
        partitionName: partition_name
      }

      post('/bulk/v1/leads.json', params, optional)
    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

6 entries across 6 versions & 1 rubygems

Version Path
mrkt-1.2.2 lib/mrkt/concerns/import_leads.rb
mrkt-1.2.1 lib/mrkt/concerns/import_leads.rb
mrkt-1.2.0 lib/mrkt/concerns/import_leads.rb
mrkt-1.1.1 lib/mrkt/concerns/import_leads.rb
mrkt-1.1.0 lib/mrkt/concerns/import_leads.rb
mrkt-1.0.1 lib/mrkt/concerns/import_leads.rb