Skip to content

Conversation

@jholt13
Copy link

@jholt13 jholt13 commented Nov 21, 2017

Copied from my PR on the public project (smeggingsmegger#34)

My organization's onboarding workflows depend on pulling information about new hires prior to their first day. BambooHR recently implemented "Effective Dates" which will allow changes (promotions, compensation changes, etc.) to be scheduled to happen. BambooHR added a parameter onlyCurrent which will allow you to see scheduled changes via the API prior to the changes taking place.

Example - getting a future employee's department prior to their start date:

curl -i -u "API_KEY:x" "https://api.bamboohr.com/api/gateway.php/<organization>/v1/employees/<id>?fields=department"
HTTP/1.1 200 OK
Server: nginx
Content-Type: text/xml; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Vary: Accept-Encoding
Cache-Control: no-cache
Date: Mon, 13 Nov 2017 00:35:45 GMT
Strict-Transport-Security: max-age=604800; includeSubdomains;
Vary: Authorization,User-Agent
X-Content-Type-Options: nosniff

<?xml version="1.0"?>
<employee id="<id>">
 <field id="department"></field>
</employee>

Using onlyCurrent=false

curl -i -u "API_KEY:x" "https://api.bamboohr.com/api/gateway.php/<organization>/v1/employees/<id>?fields=department&onlyCurrent=false"
HTTP/1.1 200 OK
Server: nginx
Content-Type: text/xml; charset=UTF-8
Transfer-Encoding: chunked
Connection: keep-alive
Vary: Accept-Encoding
Cache-Control: no-cache
Date: Mon, 13 Nov 2017 00:35:45 GMT
Strict-Transport-Security: max-age=604800; includeSubdomains;
Vary: Authorization,User-Agent
X-Content-Type-Options: nosniff

<?xml version="1.0"?>
<employee id="<id>">
 <field id="department">Merchant Activation</field>
</employee>

This functionality is implemented by adding onlyCurrent to the initial call of the PyBambooHR class.

bamboo = PyBambooHR(subdomain='yoursub', api_key='yourapikeyhere', onlyCurrent=False)

When onlyCurrent is not specified in the initial call it is assumed to be True, this way the library retains the current functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants