Skip to content

hengji-liu/restful-assignment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RESTfulAssignment

SOA Course Assignment, RESTful API

Team Anonymous:

  • Hengji Liu, z5043667
  • Igit Soeriasaputra, z5022437

Security-Key : i-am-foundit Short-Key : app-manager/app-candidate/app-reviewer


Job Services

posting

{
  "jobId": "3",
  "companyName": "Amazing Co.",
  "descriptions": "yo",
  "positionType": "full time",
  "salaryRate": "600000",
  "location": "sydney cbd",
  "status": "1"
}

status:
created = 0
open = 1
in review = 2
processed = 3
sent invitation = 4

Method URL Comment
GET /postings/{id} gives back xml/json
BAD REQUEST if wrong syntax
OK with xml/json if successful
NOT FOUND if item doesn't exist
GET /postings?keyword=x&status=x gives back json
param optional, no or empty param means search for all
status must be valid if given
BAD REQUEST if wrong syntax
INTERNAL SERVER ERROR if search fail
OK with json if successful
POST /postings accepts xml/json
jobId must be null or empty
status can only be null or empty or number 0(created)/1(open)
other fields must NOT be null
BAD REQUEST if wrong syntax or not valid status
INTERNAL SERVER ERROR if insert fail
CREATED with URI in the header if successful
PUT /postings/{id} accepts xml/json
jobId must be null or empty
status must be null or empty
at least one of the other fields is NOT null
BAD REQUEST if wrong syntax or nothing to update or item already has application
NOT FOUND if item doesn't exist
INTERNAL SERVER ERROR if update fail
NO CONTENT if successful
PUT /postings/open/{id}
BAD REQUEST if wrong syntax or status move backward
NOT FOUND if item doesn't exist
INTERNAL SERVER ERROR if update fail
NO CONTENT if successful
PUT /postings/in_review/{id}
BAD REQUEST if wrong syntax or status move backward
NOT FOUND if item doesn't exist
INTERNAL SERVER ERROR if update fail
NO CONTENT if successful
PUT /postings/processed/{id}
BAD REQUEST if wrong syntax or status move backward
NOT FOUND if item doesn't exist
INTERNAL SERVER ERROR if update fail
NO CONTENT if successful
PUT /postings/sent_invitations/{id}
BAD REQUEST if wrong syntax or status move backward
NOT FOUND if item doesn't exist
INTERNAL SERVER ERROR if update fail
NO CONTENT if successful
DELETE /postings/{id} BAD REQUEST if wrong syntax or item already has application
NOT FOUND if item doesn't exist
INTERNAL SERVER ERROR if insert fail
NO CONTENT if successful

appliaction

{
  "status": "3",
  "appId": "1",
  "jobId": "3",
  "candidateDetails": "details here",
  "coverLetter": "this is a cover letter"
}

status: received = 0
in review = 1
accepted = 2
rejected = 3

Method URL Comment
GET /applications/{appId} gives back xml/json
BAD REQUEST if wrong syntax or type
OK with xml/json if successful
NOT FOUND if item doesn't exist
GET /applications gives back json
BAD REQUEST if wrong syntax or accept type
INTERNAL SERVER ERROR if search fail
OK with json if successful
GET /postings/{jobId}/applications gives back json
BAD REQUEST if wrong syntax or accept type
INTERNAL SERVER ERROR if search fail
OK with json if successful
POST /applications accepts xml/json
appId and status must be null or empty
jobId must be an int
other fields must NOT be null
associated posting must be status open
BAD REQUEST if wrong yntax or posting status no open
INTERNAL SERVER ERROR if insert fail
CREATED with URI in the header if successful
PUT /applications/{id} accepts xml/json
appId must be null or empty
status must be null or empty
at least one of the other fields is NOT null
BAD REQUEST if wrong syntax or nothing to update
NOT FOUND if item doesn't exist
INTERNAL SERVER ERROR if update fail
NO CONTENT if successful
PUT /applications/in_review/{id}
BAD REQUEST if wrong syntax
NOT FOUND if item doesn't exist
INTERNAL SERVER ERROR if update fail
NO CONTENT if successful
PUT /applications/rejected/{id}
BAD REQUEST if wrong syntax or old status not in_review
NOT FOUND if item doesn't exist
INTERNAL SERVER ERROR if update fail
NO CONTENT if successful
PUT /applications/accpeted/{id}
BAD REQUEST if wrong syntax or old status not in_review
NOT FOUND if item doesn't exist
INTERNAL SERVER ERROR if update fail
NO CONTENT if successful

review

{
  "appId": "1",
  "decision": "1",
  "reviewId": "1",
  "comments": "komenz",
  "reviewerDetails": "review dtails"
}

decision:
not recommend = 0
recommend = 1

Method URL Comment
POST /reviews accepts xml/json
reviewId must be null or empty
appId must be an int
decision must be 0 or 1
other fields must NOT be null
associated posting must be status in_review
BAD REQUEST if wrong syntax or posting status not in_review
INTERNAL SERVER ERROR if insert fail
CREATED with URI in the header if successful
GET /reviews/{rId} gives back xml/json
BAD REQUEST if wrong syntax
OK with xml/json if successful
NOT FOUND if item doesn't exist
GET /reviews gives back json
INTERNAL SERVER ERROR if search fail
OK with json if successful
GET /applications/{appID}/reviews gives back json
BAD REQUEST if wrong syntax
INTERNAL SERVER ERROR if search fail
OK with json if successful
PUT /reviews/{id} accepts xml/json
reviewId in the payload must be null or empty
at least one of the other fields is NOT null
BAD REQUEST if wrong syntax or nothing to update
NOT FOUND if item doesn't exist
INTERNAL SERVER ERROR if update fail
NO CONTENT if successful

Polling Services

  • If Security-Key param in the header not match it will return FORBIDDEN.
  • If Short-Key param in the header not match it will return UNAUTHORIZED.

Polls

Method URI HTTP_RESPONSE CONSUME
POST /polls INTERNAL SERVER ERROR if insert fail
BAD REQUEST if any of form parameters, except for comments and finalChoice is empty
CREATED with URI in the header (location) if successful
APPLICATION_FORM_URLENCODED
title
description
optionsType either "GENERIC" or "DATE"
options date/string separated by semicolon(;)
comments can be left empty
finalChoice can be left empty
GET /polls/{id} gives back xml/json
INTERNAL SERVER ERROR if fetch fail
NO CONTENT if item doesn't exist
OK with xml/json if successful
GET /polls?queryParams gives back json
INTERNAL SERVER ERROR if search fail
NO CONTENT if item doesn't exist
OK with json if successful
param is optional, no or empty param means search for all
title
description
DELETE /polls/{id} INTERNAL SERVER ERROR if delete fail
NOT ACCEPTABLE if the operation violates the rule or item not found
OK if successful
PUT /polls/{id} INTERNAL SERVER ERROR if update fail
BAD REQUEST if any of form parameters, except for comments is empty
NO CONTENT if item doesn't exist
OK if successful
APPLICATION_FORM_URLENCODED
title
description
optionsType either "GENERIC" or "DATE"
options date/string separated by semicolon(;)
comments can be left empty
finalChoice can be left empty
PUT /polls/finalise/{id} INTERNAL SERVER ERROR if finalise fail
BAD REQUEST if any of form parameters, except for comments is empty
NO CONTENT if item doesn't exist
OK if successful
APPLICATION_FORM_URLENCODED
title
description
optionsType either "GENERIC" or "DATE"
options date/string separated by semicolon(;)
comments can be left empty
finalChoice can be left empty

Votes

Method URI HTTP_RESPONSE CONSUME
POST /polls/{pollId}/votes INTERNAL SERVER ERROR if insert fail
BAD REQUEST if any of form parameters is empty
CREATED with URI in the header (location) if successful
APPLICATION_FORM_URLENCODED
participantName
chosenOption
GET /polls/{pollId}/votes/{id} gives back xml/json
INTERNAL SERVER ERROR if fetch fail
NO CONTENT if item doesn't exist
OK with xml/json if successful
PUT /polls/{pollId}/votes/{id} INTERNAL SERVER ERROR if update fail
BAD REQUEST if any of form parameters, except for comments is empty
NO CONTENT if item doesn't exist
OK if successful
APPLICATION_FORM_URLENCODED
participantName
chosenOption

About

Team Anonymous, SOA Course Assignment RESTful API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages