Class: Bamboozled::API::ApplicantTracking
- Defined in:
- lib/bamboozled/api/applicant_tracking.rb
Constant Summary collapse
- APPLICATION_STATUS_GROUPS =
%w[ALL ALL_ACTIVE NEW ACTIVE INACTIVE HIRED].freeze
- JOB_STATUS_GROUPS =
[ "ALL", "DRAFT_AND_OPEN", "Open", "Filled", "Draft", "Deleted", "On Hold", "Canceled" ].freeze
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#add_comment(applicant_id, comment) ⇒ Object
Add comments to an application – POST /applications/:id/comments.
-
#application(applicant_id) ⇒ Object
Get the details of an application – GET /applications/:id.
-
#applications(params = {}) ⇒ Object
Get a list of applications, following pagination – GET /applications.
-
#change_status(applicant_id, status_id) ⇒ Object
Change applicant’s status – POST /applications/:id/status.
-
#job_summaries(params = {}) ⇒ Object
Get a list of job summaries – GET /jobs.
-
#statuses ⇒ Object
Get a list of statuses for a company – GET /statuses.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Bamboozled::API::Base
Instance Method Details
#add_comment(applicant_id, comment) ⇒ Object
Add comments to an application – POST /applications/:id/comments
42 43 44 45 46 47 |
# File 'lib/bamboozled/api/applicant_tracking.rb', line 42 def add_comment(applicant_id, comment) details = { type: "comment", comment: comment }.to_json = { body: details, headers: { "Content-Type" => "application/json" } } request(:post, "applicant_tracking/applications/#{applicant_id}/comments", ) end |
#application(applicant_id) ⇒ Object
Get the details of an application – GET /applications/:id
37 38 39 |
# File 'lib/bamboozled/api/applicant_tracking.rb', line 37 def application(applicant_id) request(:get, "applicant_tracking/applications/#{applicant_id}") end |
#applications(params = {}) ⇒ Object
Get a list of applications, following pagination – GET /applications
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/bamboozled/api/applicant_tracking.rb', line 24 def applications(params = {}) # rubocop:disable Style/OptionHash page_limit = params.delete(:page_limit) { 1 } applications_array = [] 1.upto page_limit do |i| response = request_applications(params.merge(page: i)) applications_array += response["applications"] break if response["paginationComplete"] end applications_array end |
#change_status(applicant_id, status_id) ⇒ Object
Change applicant’s status – POST /applications/:id/status
55 56 57 58 59 60 |
# File 'lib/bamboozled/api/applicant_tracking.rb', line 55 def change_status(applicant_id, status_id) details = { status: status_id.to_i }.to_json = { body: details, headers: { "Content-Type" => "application/json" } } request(:post, "applicant_tracking/applications/#{applicant_id}/status", ) end |
#job_summaries(params = {}) ⇒ Object
Get a list of job summaries – GET /jobs
13 14 15 16 17 18 19 20 21 |
# File 'lib/bamboozled/api/applicant_tracking.rb', line 13 def job_summaries(params = {}) # rubocop:disable Style/OptionHash query = { "statusGroups": "ALL", # JOB_STATUS_GROUPS "sortBy": "created", # "count", "title", "lead", "created", "status" "sortOrder": "ASC" # "ASC", "DESC" }.merge(params) request(:get, "applicant_tracking/jobs", query: query) end |
#statuses ⇒ Object
Get a list of statuses for a company – GET /statuses
50 51 52 |
# File 'lib/bamboozled/api/applicant_tracking.rb', line 50 def statuses request(:get, "applicant_tracking/statuses") end |