Time tracking

The time tracking API is used to send approved hours worked to BambooHR, similar to how you would send hours to a payroll company. These hours are stored in BambooHR and can be used to accrue paid time off using BambooHR’s accrual feature, and/or sent to a BambooHR payroll partner during the payroll run. This makes it possible for the customer to use BambooHR as the source of all payroll related data.

Time records can be added to BambooHR or can be retrieved from BambooHR. When adding time records to BambooHR, certain fields are required with each entry such as a date, associated pay rate, and a rate type (see documentation below). Identifying information for the employee is also required so the hours may be associated with the proper employee in BambooHR. Lists of employees and their accompanying identifying information can be retrieved through our api (see Single Dimensional Data).

Please note that only approved hours should be sent to BambooHR since there will be no distinction of approved or not-approved in BambooHR. If non-approved hours are sent to BambooHR, accruals may occur on those hours and they also may be passed to payroll. Edits to approved hours (additions or subtractions) should be sent as new records with their associated date (the date of the hours worked).

Get a time tracking record
HTTP Method:
GET
Path:
/api/gateway.php/{company}/v1/timetracking/record/{timeTrackingId}

Sample Response:

{
  "timeTrackingId": "9abf58d1-6657-11e6-b28d-0800272a335a",
  "employeeId": "40342",
  "divisionId": "17964",
  "departmentId": "17939",
  "jobTitleId": "17924",
  "payCode": "002455",
  "dateHoursWorked": "2016-08-11",
  "type": "P",
  "payRate": "27.7765",
  "rateType": "REG",
  "hoursWorked": "4.5760",
  "adjustedHours": "-3.4240",
  "jobData": "9abf58d1-6657-11e6-b,9abf58d1-6657-11e6-a"
}
Add a time tracking record
HTTP Method:
POST
Path:
/api/gateway.php/{company}/v1/timetracking/add
Minimum Required Fields:
timeTrackingId, employeeId, dateHoursWorked, rateType, hoursWorked
Additional Parameters:
payRate, divisionId, departmentId, jobTitleId, payCode, jobCode, jobData
Notes:

rateType must be one of: 'REG','OT'

The time tracking id can be any id you use to track the record up to 36 characters in length. (i.e. UUID)

The dateHoursWorked needs to be submitted in ISO 8601 Date Format. (YYYY-MM-DD format)

jobData: a list of up to four 20 characters max job numbers in comma delimited format with no spaces

Success Response:
201 - The time tracking id will be returned in JSON.
Failure Response:

400 - if any required field is missing, any of the ids are invalid, or the posted JSON is not valid

Sample Request:

{
  "timeTrackingId": "9abf58d1-6657-11e6-b28d-0800272a335a",
  "employeeId": "40342",
  "divisionId": "17964",
  "departmentId": "17939",
  "jobTitleId": "17924",
  "payCode": "002455",
  "dateHoursWorked": "2016-08-11",
  "payRate": "27.7765",
  "rateType": "REG",
  "hoursWorked": "4.5760",
  "jobCode:" "123456",
  "jobData": "9abf58d1-6657-11e6-b,9abf58d1-6657-11e6-a"
}

Sample Response:

{
  "timeTrackingId": "9abf58d1-6657-11e6-b28d-0800272a335a",
}
Adjust a time tracking record
HTTP Method:
PUT
Path:
/api/gateway.php/{company}/v1/timetracking/adjust
Minimum Required Fields:
timeTrackingId, hoursWorked
Notes:

The time tracking id can be any id you use to track the record up to 36 characters in length. (i.e. UUID)

Success Response:
201 - The time tracking id will be returned in JSON.
Failure Response:

400 - if any required field is missing, any of the ids are invalid, or the posted JSON is not valid

Sample Request:

{
  "timeTrackingId": "9abf58d1-6657-11e6-b28d-0800272a335a",
  "hoursWorked": "4.5760"
}

Sample Response:

{
  "timeTrackingId": "9abf58d1-6657-11e6-b28d-0800272a335a"
}
Delete a time tracking record
HTTP Method:
DELETE
Path:
/api/gateway.php/{company}/v1/timetracking/delete/{timeTrackingId}
Minimum Required Fields:
timeTrackingId
Notes:

The time tracking id is the existing id you use to track the record

Success Response:
20o - Record removed.
Failure Response:

400 - if the time tracking id cannot be found

Sample URL:
https://api.bamboohr.com/api/gateway.php/testcorp/v1/timetracking/delete/9abf58d1-6657-11e6-b28d-0800272a335a

Sample Response:

{
  "status": "success",
  "message": "Record removed"
}
Bulk Add/Adjust time tracking records
HTTP Method:
POST
Request Body:
Array of time tracking objects
Path:
/api/gateway.php/{company}/v1/timetracking/record
Minimum Required Fields Within Each Time Tracking Object:
timeTrackingId, employeeId, dateHoursWorked, rateType, hoursWorked
Additional Parameters:
payRate, divisionId, departmentId, jobTitleId, payCode, jobCode, jobData
Notes:

rateType must be one of: 'REG','OT'

The time tracking id can be any id you use to track the record up to 36 characters in length. (i.e. UUID)

The dateHoursWorked needs to be submitted in ISO 8601 Date Format. (YYYY-MM-DD format)

jobData: a list of up to four 20 characters max job numbers in comma delimited format

If adjusting a time tracking entry the entire original timeTracking object must be presented and only the hoursWorked may be changed

Success Response:
201 - An array of objects with success as true or false depending on the success of each time tracking object in the request along with the successful ids or the reason of the error.
Sample URL:
https://api.bamboohr.com/api/gateway.php/testcorp/v1/timetracking/record

Sample Request:

[
   {
	"timeTrackingId": "9abf58d1-6657-11e6-b28d-0800272a335a",
	"employeeId": "40342",
	"divisionId": "17964",
	"departmentId": "17939",
	"jobTitleId": "17924",
	"payCode": "002455",
	"dateHoursWorked": "2017-04-15",
	"payRate": "27.7765",
	"rateType": "REG",
	"hoursWorked": "4.5760",
	"jobCode:" "123456",
	"jobData": "9abf58d1-6657-11e6-b,9abf58d1-6657-11e6-a"
   },
   {
	"timeTrackingId" : "1010"
	"employeeId" : "7",
	"dateHoursWorked" : "2017-04-16",
	"rateType" : "REG",
	"hoursWorked" : "5.5",
   }
]					

Sample Response:

[
  {
	"success": true,
	"response": {
	  "id": "9abf58d1-6657-11e6-b28d-0800272a335a"
	}
  },
  {
	"success": true,
	"response": {
	  "id": "1010"
	}
  }
]							

Another Sample Request:

Notice the 2nd entry is an attempt to adjust hours on timeTrackingId 1010 from the first Sample Request

[
   {
	"timeTrackingId": "1510",
	"employeeId": "7",
	"divisionId": "18029",
	"departmentId": "18028",
	"jobTitleId": "18027",
	"dateHoursWorked": "2017-04-15",
	"rateType": "REG",
	"hoursWorked": "4.5760"
   },
   {
	"timeTrackingId" : "1010",
	"employeeId" : "7",
	"dateHoursWorked" : "2017-04-16",
	"rateType" : "OT",
	"hoursWorked" : "6.5"
   }
]					

Sample Response:

[
  {
	"success": true,
	"response": {
	  "id": "1510"
	}
  },
  {
	"success": false,
	"response": {
	   "message": "Only hours worked can be edited on an update. (rateType)    
				   is either missing or not allowed to be updated"
	}
  }
]							

Have more questions? We're here to help, so please contact us.