Functions for interacting with saved custom reports in the BambooHR API.
Covers the current, non-deprecated "Custom Reports" endpoints only. The
older /reports/custom and /reports/{id} endpoints are deprecated in
favour of these, and the newer Datasets API (which replaces ad-hoc
reporting entirely) lives under /v1_2 and /v2 — a different API
version prefix than the rest of this client supports — so it's out of
scope here.
Summary
Functions
Executes a saved custom report and returns its data.
Retrieves a paginated list of saved custom reports available in the account.
Functions
@spec get_report(BambooHR.Client.t(), integer(), map()) :: BambooHR.Client.response()
Executes a saved custom report and returns its data.
The "data" array contains one flat map per employee record, keyed by
the fields selected when the report was created.
Parameters
client- Client configuration created withBambooHR.Client.new/1report_id- The numeric ID of the saved custom report to executeparams- Optional query params:"page"(default 1) and"page_size"(default 500, max 1000)
Examples
iex> BambooHR.Reports.get_report(client, 42)
{:ok, %{"data" => [%{"firstName" => "John", "status" => "Active"}], "aggregations" => []}}
@spec list_reports(BambooHR.Client.t(), map()) :: BambooHR.Client.response()
Retrieves a paginated list of saved custom reports available in the account.
Each entry contains an "id" and a "name"; pass the "id" to
get_report/3 to execute the report and retrieve its data.
Parameters
client- Client configuration created withBambooHR.Client.new/1params- Optional query params:"page"(default 1) and"page_size"(default 500, max 1000)
Examples
iex> BambooHR.Reports.list_reports(client)
{:ok, %{"reports" => [%{"id" => 42, "name" => "Headcount by Department"}]}}