Class: Fountain::Api::Applicants

Inherits:
Object
  • Object
show all
Includes:
RequestHelper
Defined in:
lib/fountain/api/applicants.rb

Overview

Fountain Applicant API

Constant Summary

Constants included from RequestHelper

RequestHelper::DEFAULT_REQUEST_OPTIONS

Instance Method Summary collapse

Methods included from RequestHelper

#request, #request_json

Instance Method Details

#list(filter_options = {}) ⇒ Array

List applicants

Parameters:

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

    A hash of options to send to Fountain. funnel_id - Unique identifier of the position/funnel stage_id - Unique identifier of the stage stage - Filter applicants by stage type labels - MUST be URL-encoded cursor - Cursor parameter for cursor-based pagination

Returns:

  • (Array)

    of Fountain::Applicant



18
19
20
21
22
23
24
25
26
27
# File 'lib/fountain/api/applicants.rb', line 18

def list(filter_options = {})
  response = request_json(
    '/v2/applicants',
    body: Util.slice_hash(
      filter_options,
      :funnel_id, :stage_id, :stage, :labels, :cursor
    )
  )
  Fountain::Applicants.new response
end

#update(applicant_id, update_options = {}) ⇒ Fountain::Applicant

Update applicant info

Parameters:

  • applicant_id (String)

    ID of the Fountain applicant

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

    A hash of options to update applicant name email phone_number data - must be passed in a data object/array secure_data - See ‘Secure Fields’ section of

    https://developer.fountain.com/docs/update-applicant-info
    

    rejection_reason on_hold_reason

Returns:



43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/fountain/api/applicants.rb', line 43

def update(applicant_id, update_options = {})
  response = request_json(
    "/v2/applicants/#{applicant_id}",
    method: :put,
    body: Util.slice_hash(
      update_options,
      :name, :email, :phone_number, :data, :secure_data,
      :rejection_reason, :on_hold_reason
    )
  )
  Fountain::Applicant.new response
end