Skip to content

Commit

Permalink
Merge pull request #69 from Skookum/release/0.3.0
Browse files Browse the repository at this point in the history
Merging 0.3.0 into master
  • Loading branch information
splybon authored Aug 15, 2019
2 parents 0c5a927 + f2a8667 commit 3751524
Show file tree
Hide file tree
Showing 13 changed files with 938 additions and 10 deletions.
30 changes: 22 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,34 +8,46 @@

### Bug Fixes

## 0.3.0 (2019-08-15)

### New Features

- New api `ApplicantTracking` allows fetching of applicant tracking data. At this time it is currently in **beta**. ([@danhealy][])

### Changes

- Updating the versions of the following dependencies ([@cabello][])
- `"httparty", "~> 0.17"`
- `"json", "~> 2"`

## 0.2.0 (2019-03-01)

### New Features

* New method `Report#custom` allows fetching a custom report of employees. ([@artfuldodger][])
* Make httpparty options configurable ([@ivanovv][])
* Add time tracking api interface ([@nlively][])
- New method `Report#custom` allows fetching a custom report of employees. ([@artfuldodger][])
- Make httpparty options configurable ([@ivanovv][])
- Add time tracking api interface ([@nlively][])

### Changes

* Using github actions for linting and testing
- Using github actions for linting and testing

### Bug Fixes

* Fix Metadata API calls. Fixes [Issue #38](https://github.com/Skookum/bamboozled/issues/36) and [Issue #5](https://github.com/Skookum/bamboozled/issues/5)
- Fix Metadata API calls. Fixes [Issue #38](https://github.com/Skookum/bamboozled/issues/36) and [Issue #5](https://github.com/Skookum/bamboozled/issues/5)

## 0.1.0 (2016-06-14)

### New Features

* New method `Employee#add` allows client to create new employees. ([@kylefdoherty][])
* New method `Employee#update` allows client to update new employees. ([@kylefdoherty][])
- New method `Employee#add` allows client to create new employees. ([@kylefdoherty][])
- New method `Employee#update` allows client to update new employees. ([@kylefdoherty][])

### Changes

### Bug Fixes

* Added missing documentation for `Employee#add`. ([@mjording][])
- Added missing documentation for `Employee#add`. ([@mjording][])

[@markrickert]: https://github.com/markrickert
[@enriikke]: https://github.com/Enriikke
Expand All @@ -46,3 +58,5 @@
[@chrisman]: https://github.com/chrisman
[@ivanovv]: https://github.com/ivanovv
[@nlively]: https://github.com/nlively
[@danhealy]: https://github.com/danhealy
[@cabello]: https://github.com/cabello
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,31 @@ client.report.custom(fields, format = "JSON")
client.report.find(report_number, format = "JSON", fd = true)
```

### Applicant Tracking System
The ATS API is currently in **beta**. Please note that BambooHR may make breaking changes without
warning. Refer to the [documentation](https://www.bamboohr.com/api/documentation/ats.php) for
details.

```ruby
# Get a list of job summaries
client.applicant_tracking.job_summaries

# Get a list of applications, following pagination
client.applicant_tracking.applications(page_limit: 10)

# Get the details of an application
client.applicant_tracking.application(123)

# Add comments to an application
client.applicant_tracking.add_comment(123, "Great Application!")

# Get a list of statuses for a company
client.applicant_tracking.statuses

# Change applicant's status
client.applicant_tracking.change_status(123, 3)
```

### Metadata

```ruby
Expand Down
4 changes: 2 additions & 2 deletions bamboozled.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "rspec", "~> 3.1"
spec.add_development_dependency "webmock", "~> 1.20"

spec.add_dependency "httparty", "~> 0.13"
spec.add_dependency "json", "~> 1.8"
spec.add_dependency "httparty", "~> 0.17"
spec.add_dependency "json", "~> 2"
end
1 change: 1 addition & 0 deletions lib/bamboozled.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
require "bamboozled/ext/yesno"
require "bamboozled/api/base"
require "bamboozled/api/field_collection"
require "bamboozled/api/applicant_tracking"
require "bamboozled/api/employee"
require "bamboozled/api/report"
require "bamboozled/api/time_off"
Expand Down
77 changes: 77 additions & 0 deletions lib/bamboozled/api/applicant_tracking.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Implement endpoints for Bamboo HR's Applicant Tracking System
# https://www.bamboohr.com/api/documentation/ats.php
module Bamboozled
module API
class ApplicantTracking < Base
APPLICATION_STATUS_GROUPS = %w[ALL ALL_ACTIVE NEW ACTIVE INACTIVE HIRED].freeze

JOB_STATUS_GROUPS = [
"ALL", "DRAFT_AND_OPEN", "Open", "Filled", "Draft", "Deleted", "On Hold", "Canceled"
].freeze

# Get a list of job summaries -- GET /jobs
def job_summaries(params = {}) # rubocop:disable Style/OptionHash
query = {
"statusGroups": "ALL", # JOB_STATUS_GROUPS
"sortBy": "created", # "count", "title", "lead", "created", "status"
"sortOrder": "ASC" # "ASC", "DESC"
}.merge(params)

request(:get, "applicant_tracking/jobs", query: query)
end

# Get a list of applications, following pagination -- GET /applications
def applications(params = {}) # rubocop:disable Style/OptionHash
page_limit = params.delete(:page_limit) { 1 }

applications_array = []
1.upto page_limit do |i|
response = request_applications(params.merge(page: i))
applications_array += response["applications"]
break if response["paginationComplete"]
end
applications_array
end

# Get the details of an application -- GET /applications/:id
def application(applicant_id)
request(:get, "applicant_tracking/applications/#{applicant_id}")
end

# Add comments to an application -- POST /applications/:id/comments
def add_comment(applicant_id, comment)
details = { type: "comment", comment: comment }.to_json
options = { body: details, headers: { "Content-Type" => "application/json" } }

request(:post, "applicant_tracking/applications/#{applicant_id}/comments", options)
end

# Get a list of statuses for a company -- GET /statuses
def statuses
request(:get, "applicant_tracking/statuses")
end

# Change applicant's status -- POST /applications/:id/status
def change_status(applicant_id, status_id)
details = { status: status_id.to_i }.to_json
options = { body: details, headers: { "Content-Type" => "application/json" } }

request(:post, "applicant_tracking/applications/#{applicant_id}/status", options)
end

protected

def request_applications(params = {}) # rubocop:disable Style/OptionHash
# Also supported:
# page, jobId, applicationStatusId, applicationStatus (APPLICATION_STATUS_GROUPS),
# jobStatusGroups (JOB_STATUS_GROUPS), searchString
query = {
"sortBy": "created_date", # "first_name", "job_title", "rating", "phone", "status", "last_updated", "created_date"
"sortOrder": "ASC" # "ASC", "DESC"
}.merge(params)

request(:get, "applicant_tracking/applications", query: query)
end
end
end
end
4 changes: 4 additions & 0 deletions lib/bamboozled/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,9 @@ def time_off
def time_tracking
@time_tracking ||= Bamboozled::API::TimeTracking.new(@subdomain, @api_key, @httparty_options)
end

def applicant_tracking
@applicant_tracking ||= Bamboozled::API::ApplicantTracking.new(@subdomain, @api_key, @httparty_options)
end
end
end
177 changes: 177 additions & 0 deletions spec/fixtures/applicant_statuses.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
HTTP/1.1 200 OK
content-type: application/json; charset=utf-8
date: Tue, 28 May 2019 19:25:35 UTC

[
{
"code": "NEW",
"description": null,
"enabled": true,
"id": "1",
"manageable": false,
"name": "New",
"translatedName": "New"
},
{
"code": "REVIEWED",
"description": null,
"enabled": true,
"id": "2",
"manageable": false,
"name": "Reviewed",
"translatedName": "Reviewed"
},
{
"code": "SCHEDPHONE",
"description": null,
"enabled": true,
"id": "3",
"manageable": false,
"name": "Schedule Phone Screen",
"translatedName": "Schedule Phone Screen"
},
{
"code": "PHONED",
"description": null,
"enabled": true,
"id": "4",
"manageable": false,
"name": "Phone Screened",
"translatedName": "Phone Screened"
},
{
"code": "SCHEDINT",
"description": null,
"enabled": true,
"id": "5",
"manageable": false,
"name": "Schedule Interview",
"translatedName": "Schedule Interview"
},
{
"code": "INTERVIEW",
"description": null,
"enabled": true,
"id": "6",
"manageable": false,
"name": "Interviewed",
"translatedName": "Interviewed"
},
{
"code": "ONHOLD",
"description": null,
"enabled": true,
"id": "7",
"manageable": false,
"name": "Put on Hold",
"translatedName": "Put on Hold"
},
{
"code": "REFCHECK",
"description": null,
"enabled": true,
"id": "8",
"manageable": false,
"name": "Checking References",
"translatedName": "Checking References"
},
{
"code": "OFFER",
"description": null,
"enabled": false,
"id": "9",
"manageable": false,
"name": "Made an Offer",
"translatedName": "Made an Offer"
},
{
"code": "NOFIT",
"description": null,
"enabled": true,
"id": "10",
"manageable": false,
"name": "Not a Fit",
"translatedName": "Not a Fit"
},
{
"code": "DECLINED",
"description": null,
"enabled": true,
"id": "11",
"manageable": false,
"name": "Declined Offer",
"translatedName": "Declined Offer"
},
{
"code": "NOQUAL",
"description": null,
"enabled": true,
"id": "12",
"manageable": false,
"name": "Not Qualified",
"translatedName": "Not Qualified"
},
{
"code": "OVERQUAL",
"description": null,
"enabled": true,
"id": "13",
"manageable": false,
"name": "Over Qualified",
"translatedName": "Over Qualified"
},
{
"code": "POACHED",
"description": null,
"enabled": true,
"id": "14",
"manageable": false,
"name": "Hired Elsewhere",
"translatedName": "Hired Elsewhere"
},
{
"code": "HIRED",
"description": null,
"enabled": true,
"id": "15",
"manageable": false,
"name": "Hired",
"translatedName": "Hired"
},
{
"code": "OLSENT",
"description": null,
"enabled": true,
"id": "16",
"manageable": false,
"name": "Offer Sent",
"translatedName": "Offer Sent"
},
{
"code": "OLSIGNED",
"description": null,
"enabled": true,
"id": "17",
"manageable": false,
"name": "Offer Signed",
"translatedName": "Offer Signed"
},
{
"code": "DELETED",
"description": null,
"enabled": false,
"id": "18",
"manageable": false,
"name": "Deleted",
"translatedName": "Deleted"
},
{
"code": "MOVED",
"description": null,
"enabled": false,
"id": "19",
"manageable": false,
"name": "Moved",
"translatedName": "Moved"
}
]
Loading

0 comments on commit 3751524

Please sign in to comment.