bamboohr / api
Installs: 74 006
Dependents: 1
Suggesters: 0
Security: 0
Stars: 32
Watchers: 10
Forks: 21
Open Issues: 10
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
This package is not auto-updated.
Last update: 2024-11-05 19:50:33 UTC
README
A PHP wrapper for the BambooHR API
Quick Start
You will need two pieces of information to get started.
- The company subdomain of your BambooHR account. If you access bamboo at hamsterfarm.bamboohr.com, this is "hamsterfarm"
- An API key. You can find instructions on obtaining an API key here
- Install with composer
composer require bamboohr/api
Once you have that, the following code will get a directory of employees (as long as your user is able to access the directory)
<?php
include "BambooHR/API/API.php";
use \BambooHR\API\BambooAPI;
$bhr = new API("<company_subdomain>");
$bhr->setSecretKey("<bar>");
$response = $bhr->getDirectory();
if($response->isError()) {
trigger_error("Error communicating with BambooHR: " . $response->getErrorMessage());
}
$simplexml = $response->getContent();
...
?>
After that, you may want to explore the employee api, or just look through the wrapper code.
JSON
To get JSON output, change the following line :
$bhr = new API("<company_subdomain>");
to this:
$bhr = new API("<company_subdomain>", new BambooJSONHTTP());