Ready to get started?

Connect to live data from BambooHR with the API Driver

Connect to BambooHR

Pipe BambooHR Data to CSV in PowerShell



Use standard PowerShell cmdlets to access BambooHR tables.

The CData Cmdlets Module for BambooHR is a standard PowerShell module offering straightforward integration with BambooHR. Below, you will find examples of using our API Cmdlets with native PowerShell cmdlets.

Creating a Connection to Your BambooHR Data

Start by setting the Profile connection property to the location of the BambooHR Profile on disk (e.g. C:\profiles\bamboohr.apip). Next, set the ProfileSettings connection property to the connection string for BambooHR (see below).

BambooHR API Profile Settings

In order to authenticate to BambooHR, you'll need to provide your API Key. To generate an API key, log in and click your name in the upper right-hand corner of any page to get to the user context menu. If you have sufficient permissions, there will be an "API Keys" option in that menu to go to the page, where you can create a new API Key. Additionally, you will need to set the Domain, found in the domain name of your BambooHR account. For example if your BambooHR account is acmeinc.bamboohr.com, then the Domain should be 'acmeinc'. Set both the API Key and Domain in the ProfileSettings property to connect.

$conn = Connect-API  -Profile "$Profile" -ProfileSettings "$ProfileSettings" -APIKey "$APIKey"

Selecting Data

Follow the steps below to retrieve data from the Employees table and pipe the result into to a CSV file:

Select-API -Connection $conn -Table Employees | Select -Property * -ExcludeProperty Connection,Table,Columns | Export-Csv -Path c:\myEmployeesData.csv -NoTypeInformation

You will notice that we piped the results from Select-API into a Select-Object cmdlet and excluded some properties before piping them into an Export-Csv cmdlet. We do this because the CData Cmdlets append Connection, Table, and Columns information onto each "row" in the result set, and we do not necessarily want that information in our CSV file.

The Connection, Table, and Columns are appended to the results in order to facilitate piping results from one of the CData Cmdlets directly into another one.