API GUIDE
Creation of a Jobseeker/employer
1. A jobseeker or employer must be created. This is done using a POST request to api/employers or api/jobseekers that look like this: (for jobseeker){ name: "Example User", email: "[email protected]", location: "London" } (for employer) { name: "Example Employer", description: "We are an example", industry: "Making examples", website: "www.examplewebsite.com"} 2. Skills. These must be added separately, and one by one, unfortunately. For each skill you would like to add, access the api/skills endpoint and post: {jobseeker_id: 2, skill: "Example Skill"} This will then join the skill to the jobseeker.
Creation of a job
A job can be created with the following end point: /api/jobs Using the following format: {title: 'A job', description: 'A description of a job', start_date: 13/09/2015, duration: '2 months', hours: 48, location: 'London', wage: 8.00} Then create skills using the end point: /api/skills in the format: {jobseeker_id: jobseeker.id.to_s, skill: 'Maths'}
The three swipe possibilities
Swipe left - reject This should call the following api call to api/offers {job_id: 3, job_seeker_id: 5, accepted: false} Swipe right - Do nothing This is the equivalent of 'shortlisting' as it does nothing but the jobseeker will still be in the list next time it is called Offer job - accepted This will be a button and should send a post request to api/offers {job_id: 3, job_seeker_id: 5, accepted: true}
Endpoints
The API end points are as follows:
###GET
/api/employers
#### returns all employers
/api/jobs
#### returns all jobs
/api/jobs/:id
#### returns a single job, accessed by ID
/api/jobseekers
#### returns all jobseekers
/api/jobseekers/:id
####returns a single jobseeker, accessed by ID
### POST
/api/jobs
#### request The request requires the following parameters: string "title" string "description" date "start_date" string "duration" string "hours" string "location" decimal "wage" #### returns {status: 'success'} if a job was successfully saved {status: 'failed', error: 'error message'} if the job was not successfully saved
### DELETE
/api/jobs/:id Send an empty DELETE request to the end point to delete that job #### returns {status: 'successfully deleted'} if a job was successfully deleted {status: 'deletion failed', error: 'error message'} if the job was not successfully deleted