HiringThing API gem
This gem allows you to access your HiringThing account via the HiringThing API.
This is the READ_ONLY version. For write access, please contact [email protected]
Installation
This is a rubygem based on ActiveResource, and designed for Ruby 1.9.3 and greater. Install with this command:
$ gem install hiringthing_api
Configuration
For ruby projects, require the gem:
require 'hiringthing_api'
In rails, you can include in your Gemfile:
gem 'hiringthing_api'
Once you've obtained an api_key and password from your HiringThing account, you can set up the gem as follows:
HiringThing.configure do |h|
h.api_key = "key"
h.api_password = "pass"
h.subdomain = "yoururl" # from http://yoururl.hiringthing.com
end
If you're using Rails, this should go in a new file called RAILS_ROOT/config/initializers/hiringthing.rb.
Be sure that your api is enabled in the "Account Details" section of your HiringThing account.
Usage
# get all your jobs
myjobs = HiringThing::Jobs.all
# get a specific job
myjob = HiringThing::Jobs.find(111)
# get active jobs
myjobs = HiringThing::Jobs.active
# get hidden jobs
myjobs = HiringThing::Jobs.hidden
# get archived jobs
myjobs = HiringThing::Jobs.archived
# access applications on a specific job
myjob = HiringThing::Jobs.find(111)
myjob.applications.all
# get all applications with no rating for this job
myjob.applications.unrated
# get all applications with a rating for this job
myjob.applications.rated
# get all archived applications for this job
myjob.applications.archived
# get a specific application
myjob = HiringThing::Applications.find(111)
# get all applications
myapplications = HiringThing::Applications.all
# get all applications with a rating
myapplications = HiringThing::Applications.rated
# get all applications with no rating
myapplications = HiringThing::Applications.unrated
# get all archived applications
myapplications = HiringThing::Applications.archived
Application objects have the following attributes:
# Application objects
myapplication.id # app id
myapplication.job # job title
myapplication.job_id
myapplication.status
myapplication.first_name
myapplication.last_name
myapplication.phone
myapplication.email
myapplication.
myapplication.applied_at
myapplication.source # where the applicant came from
myapplication.archived # 1 for archived, 0 for active
Job objects have these attributes:
# Job objects
myjob.id # job id
myjob.company # company name
myjob.job_code
myjob.title
myjob.abstract
myjob.description
myjob.city
myjob.state
myjob.country
myjob.archived # 1 for archived, 0 for active
myjob.url # short url
myjob.created_at
More documentation is available on the HiringThing website.