BambooHR for node.js
$ npm install node-bamboohr
var bamboohr = new apikey: '123' subdomain: 'test'bamboohr
Get a list of all employees.
callback is required.
Employee object initialized with supplied
// No API call is made by instantiating an employee objectvar employee = bamboohr// You can supply some field values if you wantvar employee = bamboohr// This notation is generally only going to be used for adding a new employeevar new_employee = bamboohr
employee.get([fieldName, fieldName, fieldName ], callback)
employee data. Only supplied fields are retrieved, you can get a list of fields from the metadata api or the default field list from the Single Dimensional Data documentation
callback takes an error and an employee object as its arguments
var employee = bamboohr// request firstName, lastName, displayName for employee w/ id 1employee
Update an employee's information
callback takes an error, if no error, then it worked
Add a new employee
callback take an error and the employee object as arguments
var employee = bamboohremployee
employee.jobInfo([id, ][data, ]callback), employee.employmentStatus([id, ][data, ]callback), employee.compensation([id, ][data, ]callback), employee.dependents([id, ][data, ]callback), employee.contacts([id, ][data, ]callback)
Shorthand accessors for Tabular Data
Get the data
Add a row
Update a row
employee.customTable(tableName, [id, ][data, ]callback)
Uses the same setup as the above table accessors, but you have to supply the table name. Get a list of tables from the Metadata API.
Copyright © 2014 Brian Hartvigsen
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.