bamboohr / api
BambooHR API documentation. https://www.bamboohr.com/api/documentation/
Installs: 92 528
Dependents: 1
Suggesters: 0
Security: 0
Stars: 32
Watchers: 8
Forks: 22
Open Issues: 11
pkg:composer/bamboohr/api
Requires
- php: ^5.5 || ^7
- ext-curl: *
Requires (Dev)
- bamboohr/phpcs: ^1.0
- phpmd/phpmd: ^2.4
- phpunit/phpunit: ^4.8|^5.4
- sebastian/phpcpd: ^2.0
- squizlabs/php_codesniffer: ^3.2
- dev-master
- v1.2.0
- v1.1.0
- v1.0.0
- dev-BK/platapi/autoGeneratedSdk
- dev-alyman/PHPSTAN
- dev-alyman/SPN-2341
- dev-aaronbarnes/SPN-2319
- dev-alyman/SPN-2322
- dev-alyman/SPN-2404
- dev-alyman/SPN-2425
- dev-alyman/SPN-2315
- dev-alyman/SPN-2321
- dev-alyman/SPN-2297
- dev-alyman/SPN-2312
- dev-alyman/SPN-2307
- dev-alyman/SPN-2306
- dev-alyman/SPN-2303
- dev-alyman/SPN-2308
- dev-alyman/SPN-2300
- dev-alyman/SPN-2298/update
- dev-alyman/SPN-2298/fix-uuids
- dev-BK/platapi/spn-1825/sdk-v2
- dev-bknutson/platapi/SPN-1816
- dev-mh/sApiens/SPN-698_BSD3_Licensing
- dev-PHP-8-support
- dev-quality-phpcs
- dev-jlesueur/curl_error
This package is not auto-updated.
Last update: 2025-11-19 00:30:46 UTC
README
BambooHR API documentation. https://www.bamboohr.com/api/documentation/
Installation & Usage
Requirements
PHP 8.1 and later.
Composer
To install the bindings via Composer, simply run:
composer require bamboohr/api
This will install the latest version of the SDK from Packagist, the main Composer repository.
Manual Installation
Download the files and include autoload.php:
<?php require_once('/path/to/OpenAPIClient-php/vendor/autoload.php');
Changelog
For a detailed list of changes and version history, see CHANGELOG.md.
Getting Started using the Fluent API Client (Recommended)
The SDK provides a modern, fluent interface for easier configuration and usage:
Quick Start with Fluent Interface
<?php require_once(__DIR__ . '/vendor/autoload.php'); use BhrSdk\Client\ApiClient; // Simple setup with OAuth authentication $client = (new ApiClient()) ->withOAuth('your-oauth-token') ->forCompany('your-company-subdomain') ->build(); // Use convenience methods to access APIs $employee = $client->employees()->getEmployee('firstName,lastName', '123'); $timeOffRequests = $client->timeOff()->getTimeOffRequests();
Authentication Methods
OAuth (Recommended)
$client = (new ApiClient()) ->withOAuth('your-oauth-token') ->forCompany('acme') ->build();
API Key
$client = (new ApiClient()) ->withApiKey('your-api-key') ->forCompany('acme') ->build();
Also refer to the getting started docs found here: https://documentation.bamboohr.com/docs/getting-started
Convenience Methods
Access commonly used APIs with simple method calls:
$client->employees() // EmployeesApi $client->timeOff() // TimeOffApi $client->benefits() // BenefitsApi $client->reports() // ReportsApi $client->goals() // GoalsApi $client->training() // TrainingApi $client->timeTracking() // TimeTrackingApi $client->photos() // PhotosApi $client->webhooks() // WebhooksApi $client->tabularData() // TabularDataApi $client->accountInformation() // AccountInformationApi $client->applicantTracking() // ApplicantTrackingApi $client->companyFiles() // CompanyFilesApi $client->employeeFiles() // EmployeeFilesApi $client->ats() // ATSApi $client->customReports() // CustomReportsApi $client->datasets() // DatasetsApi $client->hours() // HoursApi $client->lastChangeInformation() // LastChangeInformationApi $client->login() // LoginApi $client->manual() // ManualApi
Advanced Configuration
$client = (new ApiClient()) ->withOAuth('your-oauth-token') ->forCompany('acme') ->withRetries(3) // Configure retry attempts ->withDebug(true) // Enable debug mode ->withLogging(null, 'debug') // Enable secure logging ->withHostIndex(1) // Set custom host index ->build();
Secure Logging
The SDK includes secure logging with automatic sensitive data redaction:
use BhrSdk\Client\Logger\SecureLogger; // Enable logging with default settings $client = (new ApiClient()) ->withOAuth('your-oauth-token') ->forCompany('acme') ->withLogging() // Defaults to 'info' level ->build(); // Custom log level $client->withLogging(null, 'debug'); // debug, info, warning, or error // Custom logger $customLogger = new SecureLogger(true, 'debug'); $client->withLogging($customLogger);
Note: Sensitive data (API keys, tokens, passwords) is automatically masked in logs.
Complete Example
<?php require_once(__DIR__ . '/vendor/autoload.php'); use BhrSdk\Client\ApiClient; // Configure the client $client = (new ApiClient()) ->withOAuth('your-oauth-token') ->forCompany('acme') ->withLogging(null, 'info') ->withRetries(3) ->build(); try { // Get employee information // Note: getEmployee returns array<string,mixed>, use array access $employee = $client->employees()->getEmployee('firstName,lastName', '123'); echo "Employee: {$employee['firstName']} {$employee['lastName']}\n"; // Get time off requests $requests = $client->timeOff()->getTimeOffRequests(); echo "Time off requests: " . count($requests) . "\n"; // Get employee photo $photo = $client->photos()->getEmployeePhoto('123', 'small'); // Access any API using getApi() $customApi = $client->getApi(\BhrSdk\Api\CustomReportsApi::class); } catch (Exception $e) { echo 'Error: ' . $e->getMessage() . PHP_EOL; }
Backward Compatibility
The traditional approach still works if you prefer it:
$config = BhrSdk\Configuration::getDefaultConfiguration() ->setUsername('YOUR_API_KEY') ->setPassword('x'); $apiInstance = new BhrSdk\Api\EmployeesApi( new GuzzleHttp\Client(), $config );
Migration Guide
If you're upgrading from an older version of the SDK or transitioning from direct API calls:
- Complete Migration Guide - Comprehensive guide for upgrading
- Migration Examples - Practical code examples showing before/after patterns
⚠️ Critical: Return Types
Returns are arrays, not objects:
// ✓ Correct - use array access $employee = $api->getEmployee('firstName,lastName', '123'); echo $employee['firstName']; // ✗ Wrong - will cause fatal error echo $employee->getFirstName();
Method name changes:
$client->employeeFiles() // ✓ Correct $client->files() // ✗ Doesn't exist
For detailed migration steps and troubleshooting, see MIGRATION.md.
OAuth Token Refresh
The SDK supports automatic OAuth token refresh when using BambooHR's OAuth 2.0 flow:
$client = (new ApiClient()) ->withOAuthRefresh( accessToken: 'your-access-token', refreshToken: 'your-refresh-token', clientId: 'your-oauth-client-id', clientSecret: 'your-oauth-client-secret', expiresIn: 3600 // Optional: seconds until token expires ) ->forCompany('acme') ->build(); // SDK automatically refreshes the token when: // 1. The token is about to expire (proactive refresh) // 2. A 401 Unauthorized response is received (reactive refresh)
Persisting Refreshed Tokens:
When tokens are refreshed, you'll need to save the new tokens. Use the callback:
$client = (new ApiClient()) ->withOAuthRefresh( accessToken: $accessToken, refreshToken: $refreshToken, clientId: $clientId, clientSecret: $clientSecret ) ->onTokenRefresh(function($newAccessToken, $newRefreshToken, $oldAccessToken, $oldRefreshToken) { // Save to database, session, cache, etc. saveUserTokens($userId, $newAccessToken, $newRefreshToken); }) ->forCompany('acme') ->build();
Note: Token refresh only activates when both accessToken AND refreshToken are provided via withOAuthRefresh(). Using the standard withOAuth() method will not enable automatic refresh.
API Endpoints
All URIs are relative to https://companySubDomain.bamboohr.com
| Class | Method | HTTP request | Description |
|---|---|---|---|
| ATSApi | getApplicationDetails | GET /api/v1/applicant_tracking/applications/{applicationId} | Get Application Details |
| AccountInformationApi | getCountriesOptions | GET /api/v1/meta/countries/options | Get all countries |
| AccountInformationApi | getListOfUsers | GET /api/v1/meta/users | Get a List of Users |
| AccountInformationApi | getStatesByCountryId | GET /api/v1/meta/provinces/{countryId} | Get states by country ID |
| AccountInformationApi | metadataAddOrUpdateValuesForListFields | PUT /api/v1/meta/lists/{listFieldId} | Add or Update Values for List Fields |
| AccountInformationApi | metadataGetAListOfFields | GET /api/v1/meta/fields | Get a list of fields |
| AccountInformationApi | metadataGetAListOfTabularFields | GET /api/v1/meta/tables | Get a list of tabular fields |
| AccountInformationApi | metadataGetDetailsForListFields | GET /api/v1/meta/lists | Get details for list fields |
| ApplicantTrackingApi | addNewCandidate | POST /api/v1/applicant_tracking/application | Add New Candidate |
| ApplicantTrackingApi | addNewJobOpening | POST /api/v1/applicant_tracking/job_opening | Add New Job Opening |
| ApplicantTrackingApi | getApplications | GET /api/v1/applicant_tracking/applications | Get Applications |
| ApplicantTrackingApi | getCompanyLocations | GET /api/v1/applicant_tracking/locations | Get Company Locations |
| ApplicantTrackingApi | getHiringLeads | GET /api/v1/applicant_tracking/hiring_leads | Get Hiring Leads |
| ApplicantTrackingApi | getJobSummaries | GET /api/v1/applicant_tracking/jobs | Get Job Summaries |
| ApplicantTrackingApi | getStatuses | GET /api/v1/applicant_tracking/statuses | Get Statuses |
| ApplicantTrackingApi | postApplicantStatus | POST /api/v1/applicant_tracking/applications/{applicationId}/status | Change Applicant's Status |
| ApplicantTrackingApi | postApplicationComment | POST /api/v1/applicant_tracking/applications/{applicationId}/comments | Add Application Comment |
| BenefitsApi | addEmployeeDependent | POST /api/v1/employeedependents | Add an employee dependent |
| BenefitsApi | getBenefitCoverages | GET /api/v1/benefitcoverages | Get benefit coverages |
| BenefitsApi | getBenefitDeductionTypes | GET /api/v1/benefits/settings/deduction_types/all | Get benefit deduction types |
| BenefitsApi | getEmployeeDependent | GET /api/v1/employeedependents/{id} | Get employee dependent |
| BenefitsApi | getEmployeeDependents | GET /api/v1/employeedependents | Get all employee dependents |
| BenefitsApi | getMemberBenefit | GET /api/v1/benefit/member_benefit | Get a list of member benefit events |
| BenefitsApi | updateEmployeeDependent | PUT /api/v1/employeedependents/{id} | Update an employee dependent |
| CompanyFilesApi | addCompanyFileCategory | POST /api/v1/files/categories | Add Company File Category |
| CompanyFilesApi | deleteCompanyFile | DELETE /api/v1/files/{fileId} | Delete Company File |
| CompanyFilesApi | getCompanyFile | GET /api/v1/files/{fileId} | Get an Company File |
| CompanyFilesApi | listCompanyFiles | GET /api/v1/files/view | List company files and categories |
| CompanyFilesApi | updateCompanyFile | POST /api/v1/files/{fileId} | Update Company File |
| CompanyFilesApi | uploadCompanyFile | POST /api/v1/files | Upload Company File |
| CustomReportsApi | getByReportId | GET /api/v1/custom-reports/{reportId} | Get Report by ID |
| CustomReportsApi | listReports | GET /api/v1/custom-reports | List Reports |
| DatasetsApi | getDataFromDataset | POST /api/v1/datasets/{datasetName} | Get Data from Dataset |
| DatasetsApi | getDatasets | GET /api/v1/datasets | Get Data Sets |
| DatasetsApi | getFieldsFromDataset | GET /api/v1/datasets/{datasetName}/fields | Get Fields from Dataset |
| EmployeeFilesApi | addEmployeeFileCategory | POST /api/v1/employees/files/categories | Add Employee File Category |
| EmployeeFilesApi | deleteEmployeeFile | DELETE /api/v1/employees/{id}/files/{fileId} | Delete Employee File |
| EmployeeFilesApi | getEmployeeFile | GET /api/v1/employees/{id}/files/{fileId} | Get an Employee File |
| EmployeeFilesApi | listEmployeeFiles | GET /api/v1/employees/{id}/files/view | List employee files and categories |
| EmployeeFilesApi | updateEmployeeFile | POST /api/v1/employees/{id}/files/{fileId} | Update Employee File |
| EmployeeFilesApi | uploadEmployeeFile | POST /api/v1/employees/{id}/files | Upload Employee File |
| EmployeesApi | addEmployee | POST /api/v1/employees | Add Employee |
| EmployeesApi | getCompanyInformation | GET /api/v1/company_information | Get Company Information |
| EmployeesApi | getEmployee | GET /api/v1/employees/{id} | Get Employee |
| EmployeesApi | getEmployeesDirectory | GET /api/v1/employees/directory | Get Employee Directory |
| EmployeesApi | getEmployeesList | GET /api/v1/employees | Get Employees |
| EmployeesApi | updateEmployee | POST /api/v1/employees/{id} | Update Employee |
| GoalsApi | deleteGoal | DELETE /api/v1/performance/employees/{employeeId}/goals/{goalId} | Delete Goal |
| GoalsApi | deleteGoalComment | DELETE /api/v1/performance/employees/{employeeId}/goals/{goalId}/comments/{commentId} | Delete Goal Comment |
| GoalsApi | getCanCreateGoal | GET /api/v1/performance/employees/{employeeId}/goals/canCreateGoals | Can Create a Goal |
| GoalsApi | getGoalAggregate | GET /api/v1/performance/employees/{employeeId}/goals/{goalId}/aggregate | Get Aggregate Goal Info |
| GoalsApi | getGoalComments | GET /api/v1/performance/employees/{employeeId}/goals/{goalId}/comments | Get Goal Comments |
| GoalsApi | getGoals | GET /api/v1/performance/employees/{employeeId}/goals | Get Goals |
| GoalsApi | getGoalsAggregateV1 | GET /api/v1/performance/employees/{employeeId}/goals/aggregate | Get All Aggregate Goal Info |
| GoalsApi | getGoalsAggregateV11 | GET /api/v1_1/performance/employees/{employeeId}/goals/aggregate | Get All Aggregate Goal Info, Version 1.1 |
| GoalsApi | getGoalsAggregateV12 | GET /api/v1_2/performance/employees/{employeeId}/goals/aggregate | Get All Aggregate Goal Info, Version 1.2 |
| GoalsApi | getGoalsAlignmentOptions | GET /api/v1/performance/employees/{employeeId}/goals/alignmentOptions | Alignable Goal Options |
| GoalsApi | getGoalsFiltersV1 | GET /api/v1/performance/employees/{employeeId}/goals/filters | Get Goals Filters |
| GoalsApi | getGoalsFiltersV11 | GET /api/v1_1/performance/employees/{employeeId}/goals/filters | Get Goals Filters |
| GoalsApi | getGoalsFiltersV12 | GET /api/v1_2/performance/employees/{employeeId}/goals/filters | Get Goal Status Counts, Version 1.2 |
| GoalsApi | getGoalsShareOptions | GET /api/v1/performance/employees/{employeeId}/goals/shareOptions | Available Goal Sharing Options |
| GoalsApi | postCloseGoal | POST /api/v1/performance/employees/{employeeId}/goals/{goalId}/close | Close Goal |
| GoalsApi | postGoal | POST /api/v1/performance/employees/{employeeId}/goals | Create Goal |
| GoalsApi | postGoalComment | POST /api/v1/performance/employees/{employeeId}/goals/{goalId}/comments | Create Goal Comment |
| GoalsApi | postReopenGoal | POST /api/v1/performance/employees/{employeeId}/goals/{goalId}/reopen | Reopen a Goal |
| GoalsApi | putGoalComment | PUT /api/v1/performance/employees/{employeeId}/goals/{goalId}/comments/{commentId} | Update Goal Comment |
| GoalsApi | putGoalMilestoneProgress | PUT /api/v1/performance/employees/{employeeId}/goals/{goalId}/milestones/{milestoneId}/progress | Update Milestone Progress |
| GoalsApi | putGoalProgress | PUT /api/v1/performance/employees/{employeeId}/goals/{goalId}/progress | Update Goal Progress |
| GoalsApi | putGoalSharedWith | PUT /api/v1/performance/employees/{employeeId}/goals/{goalId}/sharedWith | Update Goal Sharing |
| GoalsApi | putGoalV1 | PUT /api/v1/performance/employees/{employeeId}/goals/{goalId} | Update Goal |
| GoalsApi | putGoalV11 | PUT /api/v1_1/performance/employees/{employeeId}/goals/{goalId} | Update Goal, V1.1 |
| HoursApi | addTimeTrackingBulk | POST /api/v1/timetracking/record | Add/Edit Hour Records |
| HoursApi | addTimeTrackingHourRecord | POST /api/v1/timetracking/add | Add Hour Record |
| HoursApi | deleteTimeTrackingById | DELETE /api/v1/timetracking/delete/{id} | Delete Hour Record |
| HoursApi | editTimeTrackingRecord | PUT /api/v1/timetracking/adjust | Edit Hour Record |
| HoursApi | getTimeTrackingRecord | GET /api/v1/timetracking/record/{id} | Get Hour Record |
| LastChangeInformationApi | getChangedEmployeeIds | GET /api/v1/employees/changed | Gets all updated employee IDs |
| LoginApi | login | POST /api/v1/login | User Login |
| PhotosApi | getEmployeePhoto | GET /api/v1/employees/{employeeId}/photo/{size} | Get an employee photo |
| PhotosApi | uploadEmployeePhoto | POST /api/v1/employees/{employeeId}/photo | Store a new employee photo |
| ReportsApi | getCompanyReport | GET /api/v1/reports/{id} | Get company report |
| ReportsApi | requestCustomReport | POST /api/v1/reports/custom | Request a custom report |
| TabularDataApi | addEmployeeTableRow | POST /api/v1/employees/{id}/tables/{table} | Adds a table row |
| TabularDataApi | addEmployeeTableRowV1 | POST /api/v1_1/employees/{id}/tables/{table} | Adds a table row |
| TabularDataApi | deleteEmployeeTableRowV1 | DELETE /api/v1/employees/{id}/tables/{table}/{rowId} | Deletes a table row |
| TabularDataApi | getChangedEmployeeTableData | GET /api/v1/employees/changed/tables/{table} | Gets all updated employee table data |
| TabularDataApi | getEmployeeTableRow | GET /api/v1/employees/{id}/tables/{table} | Gets table rows for a given employee and table combination |
| TabularDataApi | updateEmployeeTableRow | POST /api/v1/employees/{id}/tables/{table}/{rowId} | Updates a table row. |
| TabularDataApi | updateEmployeeTableRowV | POST /api/v1_1/employees/{id}/tables/{table}/{rowId} | Updates a table row. |
| TimeOffApi | getAListOfWhoIsOut | GET /api/v1/time_off/whos_out | Get a list of Who's Out |
| TimeOffApi | getTimeOffPolicies | GET /api/v1/meta/time_off/policies | Get Time Off Policies |
| TimeOffApi | getTimeOffTypes | GET /api/v1/meta/time_off/types | Get Time Off Types |
| TimeOffApi | timeOffAddATimeOffHistoryItemForTimeOffRequest | PUT /api/v1/employees/{employeeId}/time_off/history | Add a Time Off History Item For Time Off Request |
| TimeOffApi | timeOffAddATimeOffRequest | PUT /api/v1/employees/{employeeId}/time_off/request | Add a Time Off Request |
| TimeOffApi | timeOffAdjustTimeOffBalance | PUT /api/v1/employees/{employeeId}/time_off/balance_adjustment | Adjust Time Off Balance |
| TimeOffApi | timeOffAssignTimeOffPoliciesForAnEmployee | PUT /api/v1/employees/{employeeId}/time_off/policies | Assign Time Off Policies for an Employee |
| TimeOffApi | timeOffAssignTimeOffPoliciesForAnEmployeeV11 | PUT /api/v1_1/employees/{employeeId}/time_off/policies | Assign Time Off Policies for an Employee, Version 1.1 |
| TimeOffApi | timeOffChangeARequestStatus | PUT /api/v1/time_off/requests/{requestId}/status | Change a Request Status |
| TimeOffApi | timeOffEstimateFutureTimeOffBalances | GET /api/v1/employees/{employeeId}/time_off/calculator | Estimate Future Time Off Balances |
| TimeOffApi | timeOffGetTimeOffRequests | GET /api/v1/time_off/requests | Get Time Off Requests |
| TimeOffApi | timeOffListTimeOffPoliciesForEmployee | GET /api/v1/employees/{employeeId}/time_off/policies | List Time Off Policies for Employee |
| TimeOffApi | timeOffListTimeOffPoliciesForEmployeeV11 | GET /api/v1_1/employees/{employeeId}/time_off/policies | List Time Off Policies for Employee, Version 1.1 |
| TimeTrackingApi | addEditTimesheetClockEntries | POST /api/v1/time_tracking/clock_entries/store | Add/Edit Timesheet Clock Entries |
| TimeTrackingApi | addEditTimesheetHourEntries | POST /api/v1/time_tracking/hour_entries/store | Add/Edit Timesheet Hour Entries |
| TimeTrackingApi | addTimesheetClockInEntry | POST /api/v1/time_tracking/employees/{employeeId}/clock_in | Add Timesheet Clock-In Entry |
| TimeTrackingApi | addTimesheetClockOutEntry | POST /api/v1/time_tracking/employees/{employeeId}/clock_out | Add Timesheet Clock-Out Entry |
| TimeTrackingApi | createTimeTrackingProject | POST /api/v1/time_tracking/projects | Create Time Tracking Project |
| TimeTrackingApi | deleteTimesheetClockEntriesViaPost | POST /api/v1/time_tracking/clock_entries/delete | Delete Timesheet Clock Entries |
| TimeTrackingApi | deleteTimesheetHourEntriesViaPost | POST /api/v1/time_tracking/hour_entries/delete | Delete Timesheet Hour Entries |
| TimeTrackingApi | getTimesheetEntries | GET /api/v1/time_tracking/timesheet_entries | Get Timesheet Entries |
| TrainingApi | addNewEmployeeTrainingRecord | POST /api/v1/training/record/employee/{employeeId} | Add New Employee Training Record |
| TrainingApi | addTrainingCategory | POST /api/v1/training/category | Add Training Category |
| TrainingApi | addTrainingType | POST /api/v1/training/type | Add Training Type |
| TrainingApi | deleteEmployeeTrainingRecord | DELETE /api/v1/training/record/{employeeTrainingRecordId} | Delete Employee Training Record |
| TrainingApi | deleteTrainingCategory | DELETE /api/v1/training/category/{trainingCategoryId} | Delete Training Category |
| TrainingApi | deleteTrainingType | DELETE /api/v1/training/type/{trainingTypeId} | Delete Training Type |
| TrainingApi | listEmployeeTrainings | GET /api/v1/training/record/employee/{employeeId} | List Employee Trainings |
| TrainingApi | listTrainingCategories | GET /api/v1/training/category | List Training Categories |
| TrainingApi | listTrainingTypes | GET /api/v1/training/type | List Training Types |
| TrainingApi | updateEmployeeTrainingRecord | PUT /api/v1/training/record/{employeeTrainingRecordId} | Update Employee Training Record |
| TrainingApi | updateTrainingCategory | PUT /api/v1/training/category/{trainingCategoryId} | Update Training Category |
| TrainingApi | updateTrainingType | PUT /api/v1/training/type/{trainingTypeId} | Update Training Type |
| WebhooksApi | deleteWebhook | DELETE /api/v1/webhooks/{id} | Delete Webhook |
| WebhooksApi | getMonitorFields | GET /api/v1/webhooks/monitor_fields | Get monitor fields |
| WebhooksApi | getWebhook | GET /api/v1/webhooks/{id} | Get Webhook |
| WebhooksApi | getWebhookList | GET /api/v1/webhooks | Gets as list of webhooks for the user API key. |
| WebhooksApi | getWebhookLogs | GET /api/v1/webhooks/{id}/log | Get Webhook Logs |
| WebhooksApi | postWebhook | POST /api/v1/webhooks | Add Webhook |
| WebhooksApi | putWebhook | PUT /api/v1/webhooks/{id} | Update Webhook |
Models
- AddNewEmployeeTrainingRecordRequest
- AddNewEmployeeTrainingRecordRequestCost
- AddTrainingCategoryRequest
- AddTrainingTypeRequest
- AddTrainingTypeRequestCategory
- AdjustTimeOffBalance
- AdjustTimeTrackingRequestSchema
- ApplicationDetails
- ApplicationDetailsApplicant
- ApplicationDetailsJob
- ApplicationDetailsQuestionsAndAnswersInner
- ApplicationDetailsQuestionsAndAnswersInnerAnswer
- ApplicationDetailsQuestionsAndAnswersInnerQuestion
- ApplicationDetailsStatus
- ApplicationsList
- ApplicationsListApplications
- ApplicationsListApplicationsItemsInner
- ApplicationsListApplicationsItemsInnerApplicant
- ApplicationsListApplicationsItemsInnerJob
- ApplicationsListApplicationsItemsInnerStatus
- ClockEntriesSchema
- ClockEntryIdsSchema
- ClockEntrySchema
- ClockInRequestSchema
- ClockOutRequestSchema
- CompanyFileUpdate
- CompanyInformation
- CompanyInformationAddress
- Country
- CountrySchema
- CursorPagedResponseMetadata
- CursorPagesResponse
- CursorPaginationQueryObject
- DataRequest
- DataRequestAggregationsInner
- DataRequestFilters
- DataRequestFiltersFiltersInner
- DataRequestSortByInner
- Dataset
- DatasetFieldsResponse
- DatasetResponse
- Employee
- EmployeeDependent
- EmployeeFileUpdate
- EmployeeResponse
- EmployeeResponseAggregationsInner
- EmployeeTimesheetEntryTransformer
- Field
- FieldList
- FieldListFieldsInner
- FieldOptionsRequestSchema
- FieldOptionsRequestSchemaDependentFieldsValueInner
- FieldOptionsTransformer
- Forbidden
- GetEmployeesEmployeeResponse
- GetEmployeesFilterRequestObject
- GetEmployeesResponseObject
- GetEmployeesResponseObjectLinks
- GetGoalsAlignmentOptionsRequest
- Goal
- GoalAggregate
- GoalAggregateAlignsWithOptionsInner
- GoalAggregateCommentsInner
- GoalAggregatePersonsInner
- GoalFiltersV1
- GoalFiltersV11
- GoalFiltersV11FiltersInner
- GoalFiltersV11FiltersInnerActions
- GoalFiltersV1FiltersInner
- GoalsAggregateV1
- GoalsAggregateV11
- GoalsAggregateV11CommentsInner
- GoalsAggregateV12
- GoalsAggregateV12CommentsInner
- GoalsAggregateV1CommentsInner
- GoalsAggregateV1PersonsInner
- GoalsList
- HiringLead
- HiringLeadsList
- HourEntriesRequestSchema
- HourEntryIdsSchema
- HourEntrySchema
- InternalServerError
- InvalidRequest
- InvalidRequestError
- JsonDirectoryEmployee
- JsonDirectoryEmployeeFieldsInner
- ListFieldValues
- ListFieldValuesOptionsInner
- Location
- LocationsList
- MemberBenefitEvent
- MemberBenefitEventMembersInner
- MemberBenefitEventMembersInnerCoveragesInner
- MemberBenefitEventMembersInnerCoveragesInnerEventsInner
- NewWebHook
- Pagination
- PostApplicantStatusRequest
- PostApplicationCommentRequest
- PostGoalRequest
- PostGoalRequestMilestonesInner
- PostNewEmployee
- ProjectCreateRequestSchema
- ProjectInfoApiTransformer
- ProjectInfoApiTransformerProject
- ProjectInfoApiTransformerTask
- PutGoalMilestoneProgressRequest
- PutGoalProgressRequest
- PutGoalSharedWithRequest
- PutGoalV11Request
- PutGoalV11RequestMilestonesInner
- Report
- ReportsResponse
- Request
- RequestCustomReport
- RequestCustomReportFilters
- RequestCustomReportFiltersLastChanged
- State
- StateProvinceResponseSchema
- StateProvinceSchema
- TableRowDeleteResponse
- TableRowUpdate
- TaskCreateSchema
- TimeOffAssignTimeOffPoliciesForAnEmployeeRequestInner
- TimeOffHistory
- TimeOffRequest
- TimeOffRequestDatesInner
- TimeOffRequestNotesInner
- TimeTrackingBulkResponseSchema
- TimeTrackingBulkResponseSchemaResponse
- TimeTrackingDeleteResponseSchema
- TimeTrackingIdResponseSchema
- TimeTrackingProjectWithTasksAndEmployeeIds
- TimeTrackingRecord
- TimeTrackingRecordSchema
- TimeTrackingRecordSchemaProject
- TimeTrackingRecordSchemaProjectTask
- TimeTrackingRecordSchemaShiftDifferential
- TimeTrackingTask
- TimesheetEntryInfoApiTransformer
- TrainingCategory
- TrainingCategoryList
- TrainingRecord
- TrainingRecordList
- TrainingType
- TrainingTypeList
- TransformedApiGoal
- TransformedApiGoalGoal
- TransformedApiGoalGoalActions
- TransformedApiGoalGoalMilestonesInner
- Unauthorized
- Unauthorized1
- UnauthorizedErrorsInner
- UpdateEmployeeTrainingRecordRequest
- UpdateTrainingCategoryRequest
- UpdateTrainingTypeRequest
- UpdateTrainingTypeRequestCategory
- WebHookLogResponse
- WebHookResponse
- Webhook
- WebhookBadRequest
- WebhookError
- WebhookErrorErrors
- WebhookSubErrorProperty
- WebhookSubErrorPropertyPostFieldsInner
- WebhookSubErrorPropertyUnknownFieldsInner
- WebhooksList
- WebhooksListWebhooksInner
- XmlDirectoryEmployee
- XmlDirectoryEmployeeEmployees
- XmlDirectoryEmployeeEmployeesEmployeeInner
- XmlDirectoryEmployeeEmployeesEmployeeInnerFieldInner
- XmlDirectoryEmployeeFieldset
- XmlDirectoryEmployeeFieldsetFieldInner
Exceptions
- Exceptions - Information about exceptions, potential causes, and debugging tips
Authorization
Authentication schemes defined for the API:
oauth
- Type: OAuth
- Flow: client credentials
- Authorization URL: https://{companyDomain}.bamboohr.com/authorize.php
- Scopes: N/A
To authenticate with OAuth, use the withOAuth() method outlined in the Authentication Methods section.
Or use the withOAuthRefresh() method to enable automatic token refresh, as outlined in the OAuth Token Refresh section.
api key
- Type: HTTP Basic Authentication
- The API key is used as the username with a fixed password of 'x'
- API keys provide full access to your BambooHR account
- Generate API keys in your BambooHR account under Account > API Keys
To authenticate with an API key, use the withApiKey() method, as outlined in the Authentication Methods section.
Security Note: Store your API key securely and never expose it in client-side code.
Also refer to the getting started docs found here: https://documentation.bamboohr.com/docs/getting-started
Contributing
We welcome contributions to improve this SDK! Here's how you can help:
Bug Reports and Feature Requests
Please use the issue tracker to report any bugs or request features.
Pull Requests
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Run the tests to ensure everything works
- Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Development Guidelines
- Follow the existing code style and conventions
- Add/update tests for any new or changed functionality
- Update documentation as needed (if updating this readme, update the mustache template and run
make generate) - Keep pull requests focused on a single topic
- Run code quality tools before submitting your code:
# Check code style with PHP_CodeSniffer make phpcs # Run static analysis with PHPStan make phpstan
Testing
Before submitting a pull request, make sure all tests pass:
# First, install dependencies if you haven't already composer install # Then run the test suite make test # To run specific tests with phpunit directly vendor/bin/phpunit tests/path/to/TestFile.php vendor/bin/phpunit --filter=testMethodName
Generating SDK
NOTE: this requires a public OpenAPI spec file, which is only available to BambooHR developers.
The path to the spec file is specified by the OPENAPI_SPEC_PATH environment variable.
To generate the SDK, run:
make generate
Manual changes to the auto-generated code
If you need to make manual changes to the auto-generated code, update the corresponding template in the templates-php directory and run make generate to regenerate the SDK.
We have updated most of the templates fairly extensively to conform to our coding standards.
Nearly all files under lib and test are generated by the make generate command, with the following exceptions and notes:
lib/Api/ManualApi.phplib/ApiErrorHelper.phplib/ApiHelper.phplib/Client/*(all files in this directory)test/Client/*(all files in this directory)test/ApiErrorHelperTest.php
Custom descriptions for some API docs are added in the scripts/add_custom_headers_to_api_docs.sh script, which is run as part of the make generate command.
Note: regeneration will not force an overwrite of tests in the test directory, unless tests are deleted first.
Generating Error Documentation
The error documentation is automatically generated from the error messages defined in ApiErrorHelper.php. To update the documentation when error messages are added or modified, run:
make generate-error-docs
Note that this script will also run as part of the make generate command.
This will:
- Regenerate the
docs/Exceptions/Exceptions.mdfile with the latest error information - Generate exception classes in
lib/Exceptions/for each error type - Generate exception documentation in
docs/Exceptions/Classes/
Support
If you encounter any issues or need assistance with this SDK, please contact us through one of these channels:
- Documentation: Refer to the official documentation
- Community: Check existing issues and discussions for similar problems
- Issue Tracker: Submit bugs and feature requests through our GitHub issue tracker
About this package
This PHP package is automatically generated by the OpenAPI Generator project:
- API version:
1.0- Package version:
2.0.0 - Generator version:
7.16.0
- Package version:
- Build package:
org.openapitools.codegen.languages.PhpClientCodegen