Class: Fountain::Api::Applicants
- Inherits:
-
Object
- Object
- Fountain::Api::Applicants
- Extended by:
- RequestHelper
- Defined in:
- lib/fountain/api/applicants.rb
Overview
Fountain Applicant Management API
Constant Summary
Constants included from RequestHelper
RequestHelper::DEFAULT_REQUEST_OPTIONS
Class Method Summary collapse
-
.advance_applicant(applicant_id, advance_options = {}) ⇒ Object
Advance an Applicant.
-
.advance_applicants(applicant_ids, stage_id, advanced_options = {}) ⇒ Object
Advance multiple Applicants.
-
.create(name, email, phone_number, create_options = {}) ⇒ Fountain::Applicant
Create an Applicant.
-
.delete(applicant_id) ⇒ Boolean
Delete an Applicant.
-
.get(applicant_id) ⇒ Fountain::Applicant
Get Applicant Info.
-
.get_interview_sessions(applicant_id) ⇒ [Fountain::Slot]
Get Interview Sessions.
-
.get_secure_documents(applicant_id) ⇒ [Fountain::SecureDocument]
Get Applicant Documents.
-
.get_transition_history(applicant_id) ⇒ [Fountain::Transition]
Get Transition History.
-
.list(filter_options = {}) ⇒ Fountain::Applicants
List applicants.
-
.update(applicant_id, update_options = {}) ⇒ Fountain::Applicant
Update Applicant Info.
Methods included from RequestHelper
Class Method Details
.advance_applicant(applicant_id, advance_options = {}) ⇒ Object
Advance an Applicant
127 128 129 130 131 132 133 134 135 136 137 138 |
# File 'lib/fountain/api/applicants.rb', line 127 def self.advance_applicant(applicant_id, = {}) response = request( "/v2/applicants/#{applicant_id}/advance", method: :put, body: Util.slice_hash( , :skip_automated_actions, :stage_id, :funnel_id ) ) check_response response, Net::HTTPNoContent true end |
.advance_applicants(applicant_ids, stage_id, advanced_options = {}) ⇒ Object
Advance multiple Applicants
148 149 150 151 152 153 154 155 156 157 158 159 |
# File 'lib/fountain/api/applicants.rb', line 148 def self.advance_applicants(applicant_ids, stage_id, = {}) response = request( "/v2/applicants/advance?stage_id=#{stage_id}", method: :post, body: Util.slice_hash( , :skip_automated_actions, :funnel_id ).merge(ids: applicant_ids) ) check_response response, Net::HTTPNoContent true end |
.create(name, email, phone_number, create_options = {}) ⇒ Fountain::Applicant
Create an Applicant
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/fountain/api/applicants.rb', line 45 def self.create(name, email, phone_number, = {}) filtered_params = Util.slice_hash( , :data, :secure_data, :funnel_id, :stage_id, :skip_automated_actions ) response = request_json( '/v2/applicants', method: :post, expected_response: [Net::HTTPCreated, Net::HTTPOK], body: { name: name, email: email, phone_number: phone_number }.merge(filtered_params) ) Fountain::Applicant.new response end |
.delete(applicant_id) ⇒ Boolean
Delete an Applicant
65 66 67 68 69 70 71 72 |
# File 'lib/fountain/api/applicants.rb', line 65 def self.delete(applicant_id) response = request( "/v2/applicants/#{applicant_id}", method: :delete ) check_response response true end |
.get(applicant_id) ⇒ Fountain::Applicant
Get Applicant Info
78 79 80 81 |
# File 'lib/fountain/api/applicants.rb', line 78 def self.get(applicant_id) response = request_json("/v2/applicants/#{applicant_id}") Fountain::Applicant.new response end |
.get_interview_sessions(applicant_id) ⇒ [Fountain::Slot]
Get Interview Sessions
165 166 167 168 |
# File 'lib/fountain/api/applicants.rb', line 165 def self.get_interview_sessions(applicant_id) response = request_json("/v2/applicants/#{applicant_id}/booked_slots") response['booked_slots'].map { |hash| Fountain::Slot.new hash } end |
.get_secure_documents(applicant_id) ⇒ [Fountain::SecureDocument]
Get Applicant Documents
114 115 116 117 |
# File 'lib/fountain/api/applicants.rb', line 114 def self.get_secure_documents(applicant_id) response = request_json("/v2/applicants/#{applicant_id}/secure_documents") response['secure_documents'].map { |hash| Fountain::SecureDocument.new hash } end |
.get_transition_history(applicant_id) ⇒ [Fountain::Transition]
Get Transition History
174 175 176 177 |
# File 'lib/fountain/api/applicants.rb', line 174 def self.get_transition_history(applicant_id) response = request_json("/v2/applicants/#{applicant_id}/transitions") response['transitions'].map { |hash| Fountain::Transition.new hash } end |
.list(filter_options = {}) ⇒ Fountain::Applicants
List applicants
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/fountain/api/applicants.rb', line 20 def self.list( = {}) response = request_json( '/v2/applicants', body: Util.slice_hash( , :funnel_id, :stage_id, :stage, :labels, :cursor ) ) Fountain::Applicants.new response end |
.update(applicant_id, update_options = {}) ⇒ Fountain::Applicant
Update Applicant Info
97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/fountain/api/applicants.rb', line 97 def self.update(applicant_id, = {}) response = request_json( "/v2/applicants/#{applicant_id}", method: :put, body: Util.slice_hash( , :name, :email, :phone_number, :data, :secure_data, :rejection_reason, :on_hold_reason ) ) Fountain::Applicant.new response end |