Skip to content

Commit

Permalink
Add methods for creating candidates and prospects
Browse files Browse the repository at this point in the history
Adds methods for POSTing to create a candidate or prospect.
  • Loading branch information
kruppel committed Apr 6, 2018
1 parent c5041d4 commit bb0855f
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion lib/greenhouse_io/api/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,22 @@ def activity_feed(id, options = {})
get_from_harvest_api "/candidates/#{id}/activity_feed", options
end

def create_candidate(hash, on_behalf_of)
post_to_harvest_api(
'/candidates',
hash,
{ 'On-Behalf-Of' => on_behalf_of.to_s }
)
end

def create_prospect(hash, on_behalf_of)
post_to_harvest_api(
'/prospects',
hash,
{ 'On-Behalf-Of' => on_behalf_of.to_s }
)
end

def create_candidate_note(candidate_id, note_hash, on_behalf_of)
post_to_harvest_api(
"/candidates/#{candidate_id}/activity_feed/notes",
Expand Down Expand Up @@ -96,7 +112,7 @@ def permitted_options(options)

def get_from_harvest_api(url, options = {})
response = get_response(url, {
:query => permitted_options(options),
:query => permitted_options(options),
:basic_auth => basic_auth
})

Expand Down

0 comments on commit bb0855f

Please sign in to comment.