RESTful API for Jobme. In addition to serving static pages from the React client build folder at the root directory, it also serves the JSON data that comprises the backend at the api directory using the following endpoints.
Type | Path (/api) | Body | Token Type | Response |
---|---|---|---|---|
GET | /employers | -- | -- | List of Employers |
POST | /employers/register | New Employer | -- | New Employer, token |
POST | /employers/login | email, password | -- | Success, Token |
GET | /employers/profile | -- | Employer | Employer |
PUT | /employers/profile | Changes | Employer | Changes |
PUT | /employers/password | oldPassword, newPassword | Employer | Employer |
POST | /exist | -- | 1 - 0 | |
GET | /jobseekers | -- | -- | List of jobseekers |
POST | /jobseekers/register | New Jobseeker | -- | New Jobseeker, token |
POST | /jobseekers/login | email, password | -- | Success, Token |
GET | /jobseekers/profile | -- | Jobseeker | Jobseeker |
PUT | /jobseekers/profile | Changes | Jobseeker | Changes |
PUT | /jobseekers/like/:seekerId | jobId, match, superLike | Employer | Match |
PUT | /jobseekers/archive/:seekerId | jobId, reverse | Employer | jobId, seekerId |
GET | /jobseekers/archived | -- | Employer | Archived Seekers |
GET | /jobs | -- | Either | Jobs |
POST | /jobs | (New Job) | Employer | New Job |
PUT | /jobs/like/:jobId | match, superLike | Seeker | Match |
PUT | /jobs/archive/:jobId | reverse | Seeker | jobId |
GET | /jobs/matches | -- | Either | Matched Jobs |
GET | /jobs/archived | -- | Seeker | Archived Jobs |
POST | /billing | total, cart, source | Either | Sucess/Error |
GET | /messages?partnerId&jobId | -- | Either | Messages |
GET | /messages/conversations | -- | Either | Messages (truncated) |
POST | /messages | toId, title, body, matchedJob | Either | Message |
Example From Client:
axios
.post("https://jobitduder/herokuapp.com/api/employers/register", {
email,
password,
companyName,
companyUrl,
description,
industry
})
.then(response => {
dispatch({ type: REGISTER_SUCCESS, employer: response.data });
})
.catch(err => {
dispath({ type: REGISTER_ERROR, message: err.data });
});
/employers/login
and /seekers/login
requires an JSON request body containing email address and a password.{ success, token }
./employers/register
takes the following string fields from a JSON document in request body (*required):
{ employer }
document to confirm success/jobseekers/register
takes the following string fields from a JSON document in request body (*required):
{ jobSeeker }
document to confirm successjobseekers/profile
and employers/profile
repectively. Password changes can be made via a [PUT] request to jobseekers/password
or employers/password
. Password changes take two fields, oldPassword
, and newPassword
. If the oldPassword matches the one on the appropriate user document, the document is returned in the response./api/billing/
with the following items
/jobs/
requires a signed JWT retrieved from successful [POST] to /employers/login.{ job }
document to confirm success/jobs/like/:jobId
requires a signed JWT retrieved from successful [POST] to /jobseekers/login.likedJobs
, matchedJobs
, and skippedJobs
, as well as aa boolean value for match
that is useful for triggering new match events on the front-end./seekers/like/:seekerId
requires a signed JWT retrieved from successful [POST] to /employers/login
.jobId
that is the ObjectId of a job associated with the authenticated employer.likedSeekers
, matchedSeekers
, and skippedSeekers
, as well as aa boolean value for match
that is useful for triggering new match events on the front-end./jobs/matches
requires a signed JWT retrieved from a successful [POST] to either /employers/login
or /seekers/login
.