This is a user manual for an MetPlus Resume cruncher project.
Introduction
This API can is used to upload/download Resumes from the Mongo Database
Authentication
Authentication Success
Request
POST /api/v1/authenticate HTTP/1.1
Accept: application/json
X-Auth-Username: backend_admin
X-Auth-Password: backendpassword
Host: localhost:8080
Name | Description |
---|---|
|
Username user to authenticate the client |
|
Password for the user to authenticate the client |
Response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 49
{"token": "aa777f45-4b6c-4bc4-b67d-b6829e8fece4"}
Parameters on response
Path | Type | Description |
---|---|---|
|
|
Token that should be used in subsequent requests |
Authentication error
Request
POST /api/v1/authenticate HTTP/1.1
Accept: application/json
X-Auth-Username: backend_admin1
X-Auth-Password: backendpassword
Host: localhost:8080
Name | Description |
---|---|
|
Username user to authenticate the client |
|
Password for the user to authenticate the client |
Response
HTTP/1.1 401 Unauthorized
Resume Operations
Upload Resume
Request
POST /api/v1/resume/upload HTTP/1.1
Content-Type: multipart/form-data
Accept: application/json
Headers
Name | Description |
---|---|
|
Authentication token retrieved from the authentication |
Parameters
Parameter | Description |
---|---|
|
Identifier of the resume |
|
Name of the resume file |
Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 63
{"resultCode":"SUCCESS","message":"File uploaded successfully"}
Parameters on response
Path | Type | Description |
---|---|---|
|
|
Result code |
|
|
Message associated with the result code |
Download Resume
Request
GET /api/v1/resume/asdasdasd HTTP/1.1
X-Auth-Token: c26018d8-4157-487e-ad1b-1d145bb34754
Host: localhost:8080
Headers
Name | Description |
---|---|
|
Authentication token retrieved from the authentication |
Success response
Response
HTTP/1.1 200 OK
Content-Type: application/octet-stream
Content-Disposition: inline; filename="line_with_bold.pdf"
Example: Cannot find resume Resume
Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 82
{"resultCode":"RESUME_NOT_FOUND","message":"Unable to find the user: 'asdasdasd'"}
Parameters on response
Path | Type | Description |
---|---|---|
|
|
Result code |
|
|
Message associated with the result code |
Match Resumes with job identifier
API Version 1
Example: Job Cannot be found
Request
GET /api/v1/resume/match/1 HTTP/1.1
X-Auth-Token: c26018d8-4157-487e-ad1b-1d145bb34754
Accept: application/json
Host: localhost:8080
Headers
Name | Description |
---|---|
|
Authentication token retrieved from the authentication |
Parameters ./api/v1/resume/match/{jobId}
Parameter | Description |
---|---|
|
Job Identifier to retrieve the Resumes that match the job |
Response
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8
Content-Length: 60
{"resultCode":"JOB_NOT_FOUND","message":"No job with id: 1"}
Parameters on response
Path | Type | Description |
---|---|---|
|
|
Result code |
|
|
Message associated with the result code |
Example: No Resumes found
Request
GET /api/v1/resume/match/1 HTTP/1.1
X-Auth-Token: c26018d8-4157-487e-ad1b-1d145bb34754
Accept: application/json
Host: localhost:8080
Headers
Name | Description |
---|---|
|
Authentication token retrieved from the authentication |
Parameters ./api/v1/resume/match/{jobId}
Parameter | Description |
---|---|
|
Job Identifier to retrieve the Resumes that match the job |
Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 57
{"resultCode":"SUCCESS","message":"Success","resumes":{}}
Parameters on response
Path | Type | Description |
---|---|---|
|
|
Result code |
|
|
Message associated with the result code |
|
|
Hash with the identifiers of the resumes matched for each cruncher |
Example: 3 Resumes found
Request
GET /api/v1/resume/match/1 HTTP/1.1
X-Auth-Token: c26018d8-4157-487e-ad1b-1d145bb34754
Accept: application/json
Host: localhost:8080
Headers
Name | Description |
---|---|
|
Authentication token retrieved from the authentication |
Parameters ./api/v1/resume/match/{jobId}
Parameter | Description |
---|---|
|
Job Identifier to retrieve the Resumes that match the job |
Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 98
{"resultCode":"SUCCESS","message":"Success","resumes":{"matcher2":["3","2"],"matcher1":["1","2"]}}
Parameters on response
Path | Type | Description |
---|---|---|
|
|
Result code |
|
|
Message associated with the result code |
|
|
List with the identifiers of the resumes matched for each cruncher |
API Version 2
Example: Job Cannot be found
Request
GET /api/v2/resume/match/1 HTTP/1.1
X-Auth-Token: c26018d8-4157-487e-ad1b-1d145bb34754
Accept: application/json
Host: localhost:8080
Headers
Name | Description |
---|---|
|
Authentication token retrieved from the authentication |
Parameters ./api/v2/resume/match/{jobId}
Parameter | Description |
---|---|
|
Job Identifier to retrieve the Resumes that match the job |
Response
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8
Content-Length: 60
{"resultCode":"JOB_NOT_FOUND","message":"No job with id: 1"}
Parameters on response
Path | Type | Description |
---|---|---|
|
|
Result code |
|
|
Message associated with the result code |
Example: No Resumes found
Request
GET /api/v2/resume/match/1 HTTP/1.1
X-Auth-Token: c26018d8-4157-487e-ad1b-1d145bb34754
Accept: application/json
Host: localhost:8080
Headers
Name | Description |
---|---|
|
Authentication token retrieved from the authentication |
Parameters ./api/v2/resume/match/{jobId}
Parameter | Description |
---|---|
|
Job Identifier to retrieve the Resumes that match the job |
Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 57
{"resultCode":"SUCCESS","message":"Success","resumes":{}}
Parameters on response
Path | Type | Description |
---|---|---|
|
|
Result code |
|
|
Message associated with the result code |
|
|
Empty Hash |
Example: 3 Resumes found
Request
GET /api/v2/resume/match/1 HTTP/1.1
X-Auth-Token: c26018d8-4157-487e-ad1b-1d145bb34754
Accept: application/json
Host: localhost:8080
Headers
Name | Description |
---|---|
|
Authentication token retrieved from the authentication |
Parameters ./api/v2/resume/match/{jobId}
Parameter | Description |
---|---|
|
Job Identifier to retrieve the Resumes that match the job |
Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 198
{"resultCode":"SUCCESS","message":"Success","resumes":{"matcher2":[{"resumeId":"3","stars":5.0},{"resumeId":"2","stars":1.2}],"matcher1":[{"resumeId":"1","stars":4.2},{"resumeId":"2","stars":3.2}]}}
Parameters on response
Path | Type | Description |
---|---|---|
|
|
Result code |
|
|
Message associated with the result code |
|
|
Hash with the identifiers of the resumes and the star rating matched for each cruncher |
Compare a Resume against a Job
API Version 1
Not Supported
API Version 2
Example: No Resume found
Request
GET /api/v2/resume/12/compare/13 HTTP/1.1
X-Auth-Token: c26018d8-4157-487e-ad1b-1d145bb34754
Accept: application/json
Host: localhost:8080
Headers
Name | Description |
---|---|
|
Authentication token retrieved from the authentication |
Parameters ./api/v2/resume/{resumeId}/compare/{jobId}
Parameter | Description |
---|---|
|
Resume Identifier to compare against the Job |
|
Job Identifier compare against the Resume |
Response
HTTP/1.1 404 Not Found
Content-Type: application/json;charset=UTF-8
Content-Length: 73
{"resultCode":"RESUME_NOT_FOUND","message":"No resume found with id: 12"}
Parameters on response
Path | Type | Description |
---|---|---|
|
|
Result code |
|
|
Message associated with the result code |
Example: No Job found
Request
GET /api/v2/resume/12/compare/13 HTTP/1.1
X-Auth-Token: c26018d8-4157-487e-ad1b-1d145bb34754
Accept: application/json
Host: localhost:8080
Headers
Name | Description |
---|---|
|
Authentication token retrieved from the authentication |
Parameters ./api/v2/resume/{resumeId}/compare/{jobId}
Parameter | Description |
---|---|
|
Resume Identifier to compare against the Job |
|
Job Identifier compare against the Resume |
Response
HTTP/1.1 404 Not Found
Content-Type: application/json;charset=UTF-8
Content-Length: 67
{"resultCode":"JOB_NOT_FOUND","message":"No job found with id: 13"}
Parameters on response
Path | Type | Description |
---|---|---|
|
|
Result code |
|
|
Message associated with the result code |
Example: Match available
Request
GET /api/v2/resume/12/compare/13 HTTP/1.1
X-Auth-Token: c26018d8-4157-487e-ad1b-1d145bb34754
Accept: application/json
Host: localhost:8080
Headers
Name | Description |
---|---|
|
Authentication token retrieved from the authentication |
Parameters ./api/v2/resume/{resumeId}/compare/{jobId}
Parameter | Description |
---|---|
|
Resume Identifier to compare against the Job |
|
Job Identifier compare against the Resume |
Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 84
{"resultCode":"SUCCESS","message":"Success","stars":{"matcher2":4.1,"matcher1":3.2}}
Parameters on response
Path | Type | Description |
---|---|---|
|
|
Result code |
|
|
Message associated with the result code |
|
|
Hash with the star rating per cruncher |
Jobs Operations
Create a new job
HTTP Request
Request
POST /api/v1/job/create HTTP/1.1
Content-Type: multipart/form-data
Accept: application/json
X-Auth-Token: 08620315-60bc-4f19-b417-58eb9a59d15d
Host: localhost:8080
jobId=1&title=Job+title&description=My+awsome+job+description
Headers
Name | Description |
---|---|
|
Authentication token retrieved from the authentication |
Parameters
Parameter | Description |
---|---|
|
Job Identifier to create |
|
Title of the job |
|
Description of the job |
HTTP Answers
Success
Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 59
{"resultCode":"SUCCESS","message":"Job added successfully"}
Parameters on response
Path | Type | Description |
---|---|---|
|
|
Result code |
|
|
Message associated with the result code |
Create job with ID that already exists
Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 83
{"resultCode":"JOB_ID_EXISTS","message":"Trying to create job that already exists"}
Parameters on response
Path | Type | Description |
---|---|---|
|
|
Result code |
|
|
Message associated with the result code |
Update a job
HTTP Request
Request
PATCH /api/v1/job/1/update HTTP/1.1
Content-Type: multipart/form-data
Accept: application/json
X-Auth-Token: 08620315-60bc-4f19-b417-58eb9a59d15d
Host: localhost:8080
Headers
Name | Description |
---|---|
|
Authentication token retrieved from the authentication |
Parameters ./api/v1/job/{jobId}/update
Parameter | Description |
---|---|
|
Job Identifier to create |
Parameters
Parameter | Description |
---|---|
|
Title of the job(Optional) |
|
Description of the job(Optional) |
HTTP Answers
Example: Update the Job Successfully
Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 61
{"resultCode":"SUCCESS","message":"Job updated successfully"}
Parameters on response
Path | Type | Description |
---|---|---|
|
|
Result code |
|
|
Message associated with the result code |
Example: Update job that do not exist
Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 56
{"resultCode":"JOB_NOT_FOUND","message":"Job not found"}
Parameters on response
Path | Type | Description |
---|---|---|
|
|
Result code |
|
|
Message associated with the result code |
Match jobs with resume
API Version 1
HTTP Request
Request
GET /api/v1/job/match/1 HTTP/1.1
Content-Type: multipart/form-data
Accept: application/json
X-Auth-Token: 08620315-60bc-4f19-b417-58eb9a59d15d
Host: localhost:8080
Headers
Name | Description |
---|---|
|
Authentication token retrieved from the authentication |
Path Parameters ./api/v1/job/match/{resumeId}
Parameter | Description |
---|---|
|
User identifier of the resume |
HTTP Answers
Success
Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 95
{"resultCode":"SUCCESS","message":"Success","jobs":{"matcher2":["3","2"],"matcher1":["1","2"]}}
Parameters on response
Path | Type | Description |
---|---|---|
|
|
Result code |
|
|
Message associated with the result code |
|
|
Hash with a list of job IDs matched by each cruncher |
Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 68
{"resultCode":"RESUME_NOT_FOUND","message":"Cannot find the resume"}
Parameters on response
Path | Type | Description |
---|---|---|
|
|
Result code |
|
|
Message associated with the result code |
Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 54
{"resultCode":"SUCCESS","message":"Success","jobs":{}}
Parameters on response
Path | Type | Description |
---|---|---|
|
|
Result code |
|
|
Message associated with the result code |
|
|
Hash with a list of job ids matched by each cruncher |
API Version 2
HTTP Request
Request
GET /api/v2/job/match/1 HTTP/1.1
Content-Type: multipart/form-data
Accept: application/json
X-Auth-Token: 39306709-69bf-4f4a-9982-42d5c5d316f3
Host: localhost:8080
Headers
Name | Description |
---|---|
|
Authentication token retrieved from the authentication |
Path Parameters ./api/v2/job/match/{resumeId}
Parameter | Description |
---|---|
|
User identifier of the resume |
HTTP Answers
Success
Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 183
{"resultCode":"SUCCESS","message":"Success","jobs":{"matcher2":[{"jobId":"3","stars":3.0},{"jobId":"2","stars":0.5}],"matcher1":[{"jobId":"1","stars":4.2},{"jobId":"2","stars":1.0}]}}
Parameters on response
Path | Type | Description |
---|---|---|
|
|
Result code |
|
|
Message associated with the result code |
|
|
Hash with a list of job IDs and the star rating matched by each cruncher |
Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 68
{"resultCode":"RESUME_NOT_FOUND","message":"Cannot find the resume"}
Parameters on response
Path | Type | Description |
---|---|---|
|
|
Result code |
|
|
Message associated with the result code |
Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
Content-Length: 54
{"resultCode":"SUCCESS","message":"Success","jobs":{}}
Parameters on response
Path | Type | Description |
---|---|---|
|
|
Result code |
|
|
Message associated with the result code |
|
|
Hash with a list of job names matched by each cruncher |