-
Notifications
You must be signed in to change notification settings - Fork 3
REST API
Andrew McLees edited this page Nov 17, 2017
·
5 revisions
- Assume no parameters unless specified
- No parameters are optional unless specified
- All REST API calls require the user to be authenticated with passport beforehand.
- When an object is returned it is returned as JSON in the response body
The following codes will apply to all endpoints.
| Code | Meaning |
|---|---|
| 200 (OK) | The request completed successfully |
| 201 (CREATED) | The entity was created successfully |
| 204 (NO CONTENT) | The request completed but returned no content |
| 304 (NOT MODIFIED) | The resource was not modified |
| 400 (BAD REQUEST) | There is something wrong with the request data |
| 401 (UNAUTHORIZED) | The request has no or invalid authentication data |
| 403 (FORBIDDEN) | The request's authorized user does not have access to the resource |
| 404 (NOT FOUND) | The resource at the location specified does not exist |
| 405 (METHOD NOT ALLOWED) | The HTTP method used is not valid for the location specified |
| 5xx (SERVER ERROR) | The server had an error processing the request |
Where possible, endpoints will also respond with JSON errors according to the format below.
{
"code": <specific code>,
"message": "<human readable message>"
}
Sample Object
{
"id": "8858d7a5c8d39c20163317fa5",
"program": "5858d7a5c8d39c20163317fa5",
"startDate": "2017-09-01",
"endDate": "2018-05-01",
"documents": ["8248d7a5c8d39c20163317fa5", "8498d7a5c8d39c20163317fa5"]
}Creates a new review.
All JSON parameters are optional except program.
{
"program": "5858d7a5c8d39c20163317fa5",
"startDate": "2017-09-01",
"endDate": "2018-05-01"
}- Administrators
Gets a review by id. Returns a Review object.
- Dean of the college of the review
- Chair of the department of the review
- All PRS members
- Administrators
Gets the header information all reviews that the user would have permission to get by specifying its review id.
{
"reviews": [
{
"id": "8858d7a5c8d39c20163317fa5",
"program": "5858d7a5c8d39c20163317fa5",
"startYear": "2017",
"endYear": "2018"
}
]
}- All authenticated users except external reviewers
Adds a new non-standard document to the review.
- Administrators
- Lead reviewers
Deletes a review by id.
- Administrators