# BambooHR

BambooHR is a cloud-based human resources (HR) software service for small and mid-size businesses.

## Overview

BambooHR is an American technology company that provides human resources software as a service. BambooHR's services include an applicant tracking system and an employee benefits tracker.

## API Information

The BambooHR connector has the following Base URL: **XXXXXX**. More information can be found on their main API documentation (v1) site. Details regarding their API limitations can be found here.

## BambooHR templates

Please note that we have the following BambooHR templates available:
These will give you pre-configured best practice ways of working with BambooHR and integrating it with other connectors.
However, please continue to at least read the Authentication setup instructions on this page to enable you to get started with using BambooHR.

## Authentication

### Version 5.0+ OAuth 2.0 Authentication

Within the workflow builder, click on the BambooHR connector to display the connector properties panel. Select the **Authentication** tab and click on the **Create new authentication** button.

![Create bamboohr auth](https://tray.ai/documentation/images/connectors/service/bamboohr/bamboo-create-new-auth.png)

In the Tray.io authentication pop-up modal, name your authentication in a way that makes it easy to identify within a potentially large list (for example, whether it's a **Sandbox** or **Production** authentication).

Consider who and how many people will need access to this authentication when choosing where to create it (**Personal** vs **Organisational**).

The next page will ask you for your **Client ID**, **Client Secret**, and **Subdomain**.

![Bamboohr client and secret id auth and domain](https://tray.ai/documentation/images/connectors/service/bamboohr/bamboo-required-fields.png)

Your **subdomain** can be found in the first section of your BambooHR instance URL:

![bamboohr-subdomain](https://tray.ai/documentation/images/connectors/service/bamboohr/0af7b61c-3683b069_bamboohr-subdomain.png)

#### Obtaining OAuth 2.0 Credentials from BambooHR

To get your **Client ID** and **Client Secret**, navigate to the BambooHR Developer Console: <https://developers.bamboohr.com>

After logging in, add a new application if you don't already have one.

![Bamboohr add new app](https://tray.ai/documentation/images/connectors/service/bamboohr/bamboo-add-new-oauth.png)

Select the application you want to use, which will take you to the app's dashboard. First, add the callback URL by clicking on **App details**.

![Bamboohr app details](https://tray.ai/documentation/images/connectors/service/bamboohr/bamboo-app-details.png)

Add the **callback URL** as: `https://auth.tray.io/oauth2/token`

![Bamboohr callback url](https://tray.ai/documentation/images/connectors/service/bamboohr/bamboo-add-callback-url.png)

Next, configure the required **scopes** for the application by clicking **Select Scopes**.

![Bamboohr scopes button](https://tray.ai/documentation/images/connectors/service/bamboohr/bamboo-scopes-button.png)

Select the scopes you need for your integration and make sure to click **Save**.

Finally, copy your **Client ID** and **Client Secret** from the application dashboard.

![Bamboohr copy client secret id](https://tray.ai/documentation/images/connectors/service/bamboohr/bamboo-copy-credentials.png)

#### Completing OAuth 2.0 Authorization

Fill in the **Client ID**, **Client Secret**, and your **subdomain** in the Tray.io authentication pop-up window. Tick any scopes you want to be sent on the request(make sure you don't send any scopes that you didn't previously configured in the Bamboo app) and add extra scopes in the **Extra permissions scope** field if needed, then click the **Create authentication** button.

You will be prompted to authorize and consent access to the application. Click **Allow** to complete the authorization.

Your connector authentication setup should now be complete. Please run the simplest operation available to test and verify that you can retrieve data as expected.

***

### API Token Authentication

Within the builder, click on the BambooHR connector to display the connector properties panel. Select the **Auth** tab and click on the **New authentication** button.
In the Tray authentication pop-up modal name your authentication in a way that will quickly identify it within a potentially large list. For example whether it is a Sandbox or Production auth, etc.
Consider who/ how many people will need access to this authentication when choosing where to create this authentication ('Personal' vs 'Organisational').
The next page asks you for your **API Token** and Subdomain.
![bamboohr-popups](https://tray.ai/documentation/images/connectors/service/bamboohr/0af7b61c-9e9e067c_Group_1_1.png)
To generate an API key you need to log in and click your name in the upper right-hand corner of any page. If you have sufficient permission there will be an 'API Keys' option displayed in the menu.
![bamboohr-api-key](https://tray.ai/documentation/images/connectors/service/bamboohr/0af7b61c-8130fc22_bamboohr-api-key.png)
Generate a new API key. Make sure to copy it carefully as viewing it again (for security reasons) will not be possible.
![bamboohr-api-key-generate](https://tray.ai/documentation/images/connectors/service/bamboohr/0af7b61c-0069a9f1_bamboohr-api-key-generate.png)
Your subdomain can be found within the first section of your BambooHR URL:
![bamboohr-subdomain](https://tray.ai/documentation/images/connectors/service/bamboohr/0af7b61c-3683b069_bamboohr-subdomain.png)
Once you have added these fields to your Tray authentication pop-up window click the **Create authentication** button. 
Your connector authentication setup should now be complete. Please run the simplest operation available to test and make sure you can retrieve data as expected.

## Available Operations

The examples below show one or two of the available connector operations in use.
Please see the [Full Operations Reference](#operationsFull) at the end of this page for details on all available operations for this connector.

## Example usage

> **Info:** **TRAY POTENTIAL:** Tray.io is extremely flexible. By design there is no fixed
> way of working with it - you can pull whatever data you need from other
> services and work with it using our core and helper connectors. This demo
> which follows shows only one possible way of working with Tray.io and the
> BambooHR connector. Once you've finished working through this example please
> see our [Introduction to working with data and
> jsonpaths](https://tray.ai/documentation/platform/automation-integration/building-workflows/mapping-data/basic-data-concepts/) page and
> [Data Guide](https://tray.ai/documentation/platform/automation-integration/building-workflows/mapping-data/mapping-data-between-steps/) for more details.

The instructions below will take you through how to add, update and get an employee using the BambooHR connector.
The workflow logic is as follows:

1. Setup using a manual trigger and use the first BambooHR connector to add a new employee.
2. Use the next step to update said employees details.
3. Get the newly updated details of said employee.
   The final outcome should look like this:
   ![bamboohr-wf-complete](https://tray.ai/documentation/images/connectors/service/bamboohr/0af7b61c-8cc87029_alksdjfh.png)

### 1 - Add Trigger & Add Employee

Here we are using a Manual Trigger for testing purposes. In a real life
scenario it is far more likely that the incoming employee information will
be coming in from another service connector. So while the data has been hard
coded here the use of jsonpaths is more likely and would be better
dynamically.
![bamboohr-step-1](https://tray.ai/documentation/images/connectors/service/bamboohr/0af7b61c-91223b6a_Group_3.png)

### 2 - Update Employee

The second BambooHR connector step updates the newly created BambooHR
employee (created in `bamboohr-1`). This could come in from any number of
services. You could for example include the new employee's email address
from a Google Drive connector. In this case we are hard coding the employee
`status` (a field already available in BambooHR) to `active`.
![bamboohr-step-2](https://tray.ai/documentation/images/connectors/service/bamboohr/0af7b61c-b82f04a3_Group_2.png)

### 3 - Get Employee

Add the BambooHR information fields you wish to gather on your chosen
employee. Again choose form the dropdown options available and jsonpath your
BambooHR ID field. Now when you run your workflow you will see within the
Debug panels that not only have you created and updated your new employee,
but you also have the information you requested available to you.
![bamboohr-step-3](https://tray.ai/documentation/images/connectors/service/bamboohr/0af7b61c-7f7d73d8_Group_2_1.png)
