A .NET client for the BambooHR REST API.
Bamboo HR recently removed support for SSLv3 and TLSv1.0, so if you're running .Net < 4.6.1, you'll need to add this line to your application somewhere, probably inside Application_Start() in your Global.asax. Keep in mind that this is a global change to your applcation. If there are any other calls you make to HTTPS endpoints that only support SSLv3, they will stop working. Most services probably don't even support SSLv3 anymore anyway, read this CloudFlare post for more information on the subject. Thanks goes to the Nifty Nick Craver for the fix.
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls |
SecurityProtocolType.Tls11 |
SecurityProtocolType.Tls12;
A demo project is included!
- Open
Program.cs
and uncomment any demo calls you want to make. - Open the App.config and fill in the blanks with information from your API account.
- Hit F5 to run the console app.
- Bask in the gloriously incandescent data gifted unto to you by your affordable and friendly HR system.
For the demo project, make sure you update the App.Config with your API stuffs. It will look something like this:
<add key="BambooApiUser" value="email@example.com" />
<add key="BambooApiKey" value="sadjlksdfguoi45u498j0sdfjoiksdfj08sdf" />
<add key="BambooApiUrl" value="https://api.bamboohr.com/api/gateway.php/examplecompanyname/v1" />
<add key="BambooCompanyUrl" value="https://examplecompanyname.bamboohr.com" />
If you're using this in the context of a web application project or website project, just add those lines to the <appSettings>
section of your web.config.
At some point, I may provide a programmatic way to configure this information for use in other scenarios??? What are those other scenarios!?!?!?
Here is a probably-mostly-up-to-date list of implemented API calls:
- - Single Dimensional Data
- [-] - Employees
- - Add an employee
- - Get an employee
- - Update an employee
- [-] - Get a directory of employees (sort of, through custom report)
- - Reports
- - Request a company report
- - Request a custom report
- - Employee Files
- - List employee files and categories
- - Add an employee file category
- - Update an employee file
- - Download an employee file
- - Upload an employee file
- - Company Files
- - List company files and categories
- - Add a company file category
- - Update a company file
- - Download a company file
- - Upload a company file
- [-] - Employees
- - Tabular Data
- - Get a table
- - Update a row
- - Add a row
- - Get tables for changed employees
- - Time Off
- - Get time off requests
- - Add a time off request
- - Change a request status
- - Add a time off history entry
- - List assigned Time Off Policies
- - Assign a new Time Off Policy
- - Add a time off history override
- - Estimate future time off balances
- - Get a list of who's out, including company holidays
- - Photos
- - Get an employee photo
- - Upload an employee photo
- - Using a photo from BambooHR's servers
- - Metadata
- - Get a list of fields
- - Get a list of tabular fields
- - Get the details for "list" fields in an account
- - Add or update values for "list" fields in an account
- - Get a list of time off types
- - Get a list of time off policies
- - Get a list of users
- - Last Change Information
- - Login
This library doesn't do any caching for you, make sure you don't spam the API and go over your limit! There's probably a limit, right?
Thanks to Stack Overflow for letting me (John Bubriski) open source this code.
MIT, but check the LICENSE file in case I'm trolling you.