Class: Cb::ApplicationApi
- Inherits:
-
Object
- Object
- Cb::ApplicationApi
- Defined in:
- lib/cb/clients/application_api.rb
Class Method Summary collapse
-
.for_job(job) ⇒ Object
Get an application for a job Takes in either a Cb::CbJob, or a string (which should contain a did).
-
.submit_app(app) ⇒ Object
Submit a job application.
-
.submit_registered_app(app) ⇒ Object
Submit a job application for a registered user.
Class Method Details
.for_job(job) ⇒ Object
Get an application for a job Takes in either a Cb::CbJob, or a string (which should contain a did)
For detailed information around this API please visit: http://api.careerbuilder.com/ApplicationInfo.aspx
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/cb/clients/application_api.rb', line 12 def self.for_job(job) job.is_a?(Cb::CbJob) ? did = job.did : did = job my_api = Cb::Utils::Api.new() cb_response = my_api.cb_get(Cb.configuration.uri_application, :query => {:JobDID => did}) json_hash = JSON.parse(cb_response.response.body) app = Cb::CbApplicationSchema.new(json_hash['ResponseBlankApplication']['BlankApplication']) my_api.append_api_responses(app, json_hash['ResponseBlankApplication']) return app end |
.submit_app(app) ⇒ Object
Submit a job application
For detailed information around this API please visit: http://api.careerbuilder.com/ApplicationInfo.aspx
53 54 55 56 57 58 59 60 61 |
# File 'lib/cb/clients/application_api.rb', line 53 def self.submit_app(app) raise Cb::IncomingParamIsWrongTypeException unless app.is_a?(Cb::CbApplication) my_api = Cb::Utils::Api.new() xml_hash = my_api.cb_post(Cb.configuration.uri_application_submit, :body => app.to_xml) my_api.append_api_responses(app, xml_hash['ResponseApplication']) return app end |
.submit_registered_app(app) ⇒ Object
Submit a job application for a registered user
For detailed information around this API please visit: http://api.careerbuilder.com/ApplicationInfo.aspx
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/cb/clients/application_api.rb', line 31 def self.submit_registered_app(app) raise Cb::IncomingParamIsWrongTypeException unless app.is_a?(Cb::CbApplication) my_api = Cb::Utils::Api.new() cb_response = my_api.cb_post(Cb.configuration.uri_application_registered, :body => app.to_xml) json_hash = JSON.parse(cb_response.response.body) begin status = json_hash['ResponseApplication']['ApplicationStatus'] == 'Complete (Test)' unless json_hash.empty? rescue status = false end return status end |