Releases: BambooHR/bhr-api-php
Releases · BambooHR/bhr-api-php
Release list
BambooHR PHP SDK v2.0.1
Adds Datasets getFieldOptions, switches Goals endpoints to return detailed employee goal model, removes legacy ATSApi, and updates auth examples and endpoint docs.
SDK/API changes:
- Datasets: Add POST /api/v1/datasets/{datasetName}/field-options (getFieldOptions).
- Applicant Tracking: Move getApplicationDetails into ApplicantTrackingApi; remove ATSApi entirely.
- Goals: Change responses to TransformedApiEmployeeGoalDetails for create/update/progress/milestone endpoints.
Models:
- Add TransformedApiEmployeeGoalDetails and TransformedApiEmployeeGoalDetailsGoal.
- Update DataRequest (add showHistory) and Field (add entityName).
- Adjust PutGoalV11Request nullability; simplify ApiException (remove requestId handling).
Docs & Examples:
- Refresh endpoint descriptions/verbs across many APIs.
- Update auth examples to use API key by default; note spec access change in README.
BambooHR PHP SDK v2.0.0
A complete rewrite of the BambooHR PHP SDK with a modern, fluent interface and comprehensive OAuth support.
✨ Highlights
- Fluent API Client - Modern builder pattern for intuitive configuration
- OAuth with Auto-Refresh - Full OAuth 2.0 support including automatic token refresh with callbacks
- API Key Support - Traditional API key authentication still fully supported
- 20 Exception Types - Comprehensive exception hierarchy for precise error handling
- Secure Logging - Built-in logging with automatic sensitive data redaction
- Configurable Retries - Built-in retry logic with
withRetries()and customizable status codes - 100+ Endpoints - 21 API classes covering all public BambooHR APIs
- 160+ Data Models - Fully typed models with PHP 8.1+ features
- Static Analysis - PHPStan level 8 support for type safety
⚠️ Breaking Changes
- PHP 8.1+ required
- Namespace changed from
BambooHR\API\toBhrSdk\ - New client initialization using fluent builder pattern (
ApiClientreplacesBambooAPI) - Exception class replaced -
BambooHTTPExceptionreplaced by specific exception types - Method signature changes - some methods have different parameter orders (e.g., fields before ID)
See MIGRATION.md for detailed upgrade instructions and examples.
🚀 Quick Start
$client = (new ApiClient())
->withOAuth('your-oauth-token')
->forCompany('your-company')
->withRetries(3)
->build();
$employee = $client->employees()->getEmployee('firstName,lastName', '123');🔒 Security
- Automatic masking of sensitive data in logs (API keys, tokens, passwords)
- Improved OAuth token handling
🐛 Fixes
- Improved error messages with detailed debugging information
- Better handling of rate limiting (429) responses
- Consistent response format across all API methods
- Type safety issues resolved with strict typing
📚 Documentation
- Getting Started - Make your first API call in 15 minutes
- Migration Guide - Detailed upgrade instructions with before/after examples
- Authentication Guide - OAuth and API key setup
- Examples - 8 practical code examples for common scenarios
Easier JSON access
Thanks to some contributions from @ncareau, there's now a simpler standard way of requesting JSON responses.
Testing and Code Quality release
This release includes a lot of help from @Gisleburt to enable unit testing, and following and including tools to enforce coding standards.