BambooHR.Hiring (BambooHR v0.5.0)

Copy Markdown View Source

Functions for interacting with the Applicant Tracking System (ATS) in the BambooHR API.

The owner of the API key used for these endpoints must have access to ATS settings.

Summary

Functions

Creates a new candidate application for a job opening.

Retrieves the applicant statuses configured for the company, including both system-defined and custom statuses.

Retrieves the full details of a single application, including applicant info, job details, questions and answers, and status history.

Retrieves a paginated list of job applications.

Retrieves all company locations available for use when creating a job opening.

Retrieves the list of employees who can be assigned as a hiring lead when creating a new job opening.

Retrieves a list of job opening summaries.

Updates the status of an application.

Functions

create_application_comment(client, application_id, comment_data)

@spec create_application_comment(BambooHR.Client.t(), integer(), map()) ::
  BambooHR.Client.response()

Adds a comment to an application.

Parameters

  • client - Client configuration created with BambooHR.Client.new/1
  • application_id - The ID of the application to add a comment to
  • comment_data - Map with "comment" (required) and "type" (optional, defaults to "comment")

Examples

iex> BambooHR.Hiring.create_application_comment(client, 42, %{"comment" => "Great fit"})
{:ok, %{"type" => "comment", "id" => 55}}

create_candidate(client, first_name, last_name, job_id, opts \\ [])

@spec create_candidate(
  BambooHR.Client.t(),
  String.t(),
  String.t(),
  integer(),
  keyword()
) ::
  BambooHR.Client.response()

Creates a new candidate application for a job opening.

Only fields required by the target job opening's standard questions need to be provided beyond first_name, last_name, and job_id.

Parameters

  • client - Client configuration created with BambooHR.Client.new/1
  • first_name - The candidate's first name
  • last_name - The candidate's last name
  • job_id - The ID of the job opening for the candidate application
  • opts - Optional keyword list of additional fields, e.g. :email, :phoneNumber, :source, :address, :city, :state, :zip, :country, :linkedinUrl, :dateAvailable, :desiredSalary, :referredBy, :websiteUrl, :highestEducation, :collegeName, :references, and the binary file fields :resume / :coverLetter (each as {binary_content, filename: "..."})

Examples

iex> BambooHR.Hiring.create_candidate(client, "Jane", "Doe", 7, email: "jane@example.com")
{:ok, %{"result" => "success", "candidateId" => 99}}

create_job_opening(client, posting_title, job_status, hiring_lead, employment_type, job_description, opts \\ [])

@spec create_job_opening(
  BambooHR.Client.t(),
  String.t(),
  String.t(),
  integer(),
  String.t(),
  String.t(),
  keyword()
) :: BambooHR.Client.response()

Creates a new job opening.

Use get_company_locations/1 and get_hiring_leads/1 to obtain valid IDs for the jobLocation and hiring_lead fields.

Parameters

  • client - Client configuration created with BambooHR.Client.new/1
  • posting_title - The posting title of the job opening
  • job_status - One of "Draft", "Open", "On Hold", "Filled", "Canceled"
  • hiring_lead - Employee ID of the hiring lead (from get_hiring_leads/1)
  • employment_type - e.g. "Full-Time", "Part-Time", "Contractor"
  • job_description - The long-form text description of the job opening
  • opts - Optional keyword list of additional fields, e.g. :department, :minimumExperience, :compensation, :jobLocation (from get_company_locations/1), :internalJobCode, :locationType, and the applicationQuestion* fields (each "true", "false", or "Required")

Examples

iex> BambooHR.Hiring.create_job_opening(client, "Engineer", "Open", 123, "Full-Time", "Build things")
{:ok, %{"result" => "success", "jobOpeningId" => "42"}}

get_applicant_statuses(client)

@spec get_applicant_statuses(BambooHR.Client.t()) :: BambooHR.Client.response()

Retrieves the applicant statuses configured for the company, including both system-defined and custom statuses.

Parameters

Examples

iex> BambooHR.Hiring.get_applicant_statuses(client)
{:ok, [%{"id" => "1", "name" => "New", "enabled" => true}]}

get_application(client, application_id)

@spec get_application(BambooHR.Client.t(), integer()) :: BambooHR.Client.response()

Retrieves the full details of a single application, including applicant info, job details, questions and answers, and status history.

Parameters

  • client - Client configuration created with BambooHR.Client.new/1
  • application_id - The ID of the application to retrieve

Examples

iex> BambooHR.Hiring.get_application(client, 42)
{:ok, %{"id" => 42, "applicant" => %{"firstName" => "Jane"}}}

get_applications(client, params \\ %{})

@spec get_applications(BambooHR.Client.t(), map()) :: BambooHR.Client.response()

Retrieves a paginated list of job applications.

Parameters

  • client - Client configuration created with BambooHR.Client.new/1
  • params - Optional query params: "page", "jobId", "applicationStatusId", "applicationStatus", "jobStatusGroups", "searchString", "sortBy", "sortOrder", "newSince"

Examples

iex> BambooHR.Hiring.get_applications(client)
{:ok, %{"applications" => [], "paginationComplete" => true, "nextPageUrl" => nil}}

get_company_locations(client)

@spec get_company_locations(BambooHR.Client.t()) :: BambooHR.Client.response()

Retrieves all company locations available for use when creating a job opening.

Use the returned location IDs as the jobLocation field passed to create_job_opening/7.

Parameters

Examples

iex> BambooHR.Hiring.get_company_locations(client)
{:ok, [%{"id" => 1, "name" => "HQ"}]}

get_hiring_leads(client)

@spec get_hiring_leads(BambooHR.Client.t()) :: BambooHR.Client.response()

Retrieves the list of employees who can be assigned as a hiring lead when creating a new job opening.

Use the returned employeeId values as the hiring_lead argument to create_job_opening/7.

Parameters

Examples

iex> BambooHR.Hiring.get_hiring_leads(client)
{:ok, [%{"employeeId" => 123, "preferredFullName" => "Jane Smith"}]}

get_job_summaries(client, params \\ %{})

@spec get_job_summaries(BambooHR.Client.t(), map()) :: BambooHR.Client.response()

Retrieves a list of job opening summaries.

By default returns all non-deleted job openings.

Parameters

  • client - Client configuration created with BambooHR.Client.new/1
  • params - Optional query params: "statusGroups", "status_ids", "sortBy", "sortOrder"

Examples

iex> BambooHR.Hiring.get_job_summaries(client)
{:ok, [%{"id" => 7, "title" => %{"label" => "Engineer"}, "status" => %{"label" => "Open"}}]}

update_applicant_status(client, application_id, status_id)

@spec update_applicant_status(BambooHR.Client.t(), integer(), integer()) ::
  BambooHR.Client.response()

Updates the status of an application.

Use get_applicant_statuses/1 to obtain valid status IDs.

Parameters

  • client - Client configuration created with BambooHR.Client.new/1
  • application_id - The ID of the application to update
  • status_id - The ID of the status to assign to the application

Examples

iex> BambooHR.Hiring.update_applicant_status(client, 42, 2)
{:ok, nil}