Skip to content

Latest commit

 

History

History
208 lines (105 loc) · 4.13 KB

File metadata and controls

208 lines (105 loc) · 4.13 KB

API Documentation

Link to API: https://qmap-platform.herokuapp.com/

Endpoints

/api/campuses

/api/degrees

/api/course

/api/map

List Campuses

Get a list of campuses in CUNY.

URL : /api/campuses/

Method : GET

Successful Response:

List Degrees

Get a list of degrees offered at particular campus.

URL : /api/degrees/{institute_id} where "institute_id" can be obtained from "/api/campuses"

Method : GET

Successful Response:

Error Response

Condition : If provided institute_id parameter is not correct.

Code : 404 NOT FOUND

Content : {}

Course

Get a course by course ID

URL : /api/course/{crse_id}

Method : GET

Successful Response:

Error Response

Condition : If crse_id is not found.

Code : 404 NOT FOUND

Content : {}

Search Courses

There are two ways to search courses; by name or description of the course.

URL : /api/course?q={search_string}&id={institute_id}&major={major}

Method : GET

Successful Response:

Error Response

Condition : If q, or major, or id are mispelled or not provided.

Code : 400 BAD REQUEST

Content : {'message' : 'invalid query parameter'}

Condition : If no matches are found.

Code : 200 OK

Content : { "message": "No matching courses found" }

Map

Get a map by map_id

URL : /api/map/{map_id}

Method : GET

Successful Response:

Error Response

Condition : If map_id is not found.

Code : 404 NOT FOUND

Content : { 'message' : 'map_id does not exist' }

Get the latest map available by specifying Institution, Major, and Start Year

URL : /api/map/?id={institute_id}&major={major}&start_year{start_year}

Method : GET

Successful Response:

Error Response

Condition : If no maps are found.

Code : 404 NOT FOUND

Content : { 'message' : 'No maps found' }

Condition : If search parameters are invalid.

Code : 400 BAD REQUEST

Content : { 'message' : 'malformed query' }

Get all maps available for a major in a particular institution

URL : /api/map/?id={institute_id}&major={major}

Method : GET

Successful Response:

Error Response

Condition : If no maps are found.

Code : 404 NOT FOUND

Content : { 'message' : 'No maps found' }

Condition : If search parameters are invalid.

Code : 400 BAD REQUEST

Content : { 'message' : 'malformed query' }

Delete a map by map_id

URL : /api/map/{map_id}

Method : DELETE

Successful Response:

  • Code : 204 NO CONTENT

Error Response

Condition : If map_id is not found.

Code : 404 NOT FOUND

Content : { 'message' : 'map_id does not exist' }

Create a map

URL : /api/map/

Method : POST

Successful Response:

  • Code : 201 CREATED

  • Content : { 'message' : 'map successfully created' }

  • example request