- Front-end Development (Google Maps Integration, APIs)
- Admin
- Front-end Development (Ionic Framework, Ionic UI)
- Floormap Image Creation
- Back-end Development
- Google Maps Overlay Tiles Generation
- Database
- Back-end Development
- Database
- Get all categories
- Get locations by category
- Facebook authentication
- Facebook authentication callback
- Logout
- Get user profile
- Get user’s bookmarks
- Create new bookmark
- Delete bookmark
- Get locations by location id
- Add new locations to the map
- Update existing location
- Delete location
-
URL
GET
/api/category -
URL Params
-
Data Params
-
Success Response:
-
Code: 200
Content:
{ venues: [{ name: 'Lecture Theatre', catid: '1' }, { name: 'Tutorial Room', catid: '2' }, { name: 'Laboratory', catid: '3' }], utilities: [{ name: 'Vending Machine', catid: '31' }, { name: 'Water Cooler', catid: '32' }, { name: 'Toilet', catid: '33' }, { name: 'ATM', catid: '34' }] };
-
-
Error Response:
-
Code: 400
Content: ``
-
-
Sample Call:
-
URL
GET
/api/category/:catid -
URL Params
Required:
catid=[integer]
Optional:
-
Data Params
-
Success Response:
-
Code: 200
Content:
[ { "id": int, "name": string, "catid": int, "position": { "lat": float, "lng": float } }, ... ]
-
-
Error Response:
-
Code: 400
Content: ``
-
-
Sample Call:
-
URL
GET
/auth/facebook -
URL Params
-
Data Params
-
Success Response:
-
Code: 302
Content:
redirect to /auth/facebook/callback
-
-
Error Response:
-
Code: 400
Content: ``
-
-
Sample Call:
-
URL
GET
/auth/facebook -
URL Params
Facebook login params
-
Data Params
-
Success Response:
-
Code: 302
Content:
login success
-
-
Error Response:
-
Code: 400
Content: ``
-
-
Sample Call:
-
URL
GET
/auth/logout -
URL Params
-
Data Params
-
Success Response:
-
Code: 302
Content:
logout success and redirect to homepage
-
-
Error Response:
-
Code: 400
Content:
error
-
-
Sample Call:
-
URL
GET
/api/user/profile -
URL Params
-
Data Params
-
Success Response:
-
Code: 200
Content:
{ "id":[int], "name":[string], "facebook_token":[string], "createdAt":[date], "updatedAt":[date] }
-
-
Error Response:
-
Code: 401
Content:
auth error
-
-
Sample Call:
-
URL
GET
/api/user/bookmarks -
URL Params
-
Data Params
-
Success Response:
-
Code: 200
Content:
[ { "id":[int], "note":[string], "createdAt":[date], "updatedAt":[date], "UserId":[integer], "LocationId":[integer], "Location":{ "id": [int], "name": [string], "catid": [int], "lat": [float], "lng": [float], "imageUrl": [string], "createdAt":[date], "updatedAt":[date] } }, ... ]
-
-
Error Response:
-
Code: 400
Content:
error
-
Code: 401
Content:
auth error
-
-
Sample Call:
-
Error Response:
-
Code: 400
Content: ``
-
Code: 401
Content:
auth error
-
-
Sample Call:
curl -XGET localhost:3000/api/location?id=7
-
URL
POST
/api/bookmark -
URL Params
-
Data Params
Required:
locationId=[integer]
note=[string]
-
Success Response:
- Code: 200
Content:
- Code: 200
-
Error Response:
-
Code: 400
Content: ``
-
Code: 401
Content:
auth error
-
-
Sample Call:
curl -XPOST localhost:3000/api/bookmark -d
{ "locationId": 7, "note": "cs3216 lecture room" }
-
URL
DELETE
/api/bookmark/:id -
URL Params
Required:
id=[integer]
-
Data Params
-
Success Response:
- Code: 200
Content:
Number of bookmark affected (which is always 1)
- Code: 200
-
Error Response:
-
Code: 400
Content:
Bookmark does not exist or not belong to the user
-
Code: 401
Content:
auth error
-
-
Sample Call:
curl -XDELETE localhost:3000/api/bookmark/32
-
URL
GET
/api/location -
URL Params
Required:
Optional:
-
Query string
Required:
id=[integer]
-
Success Response:
-
Code: 200
Content:
{ "id": int, "name": string, "catid": int, "position": { "lat": float, "lng": float } }
-
-
URL
POST
/api/location -
Data Params
[ { "name": string, "catid": int, "lat": float, "lng": float }, ... ]
-
Query string
-
Success Response:
-
Code: 200
Content:
{ "id": int, "name": string, "catid": int, "position": { "lat": float, "lng": float }, "imageUrl": string }
-
-
Error Response:
-
Code: 400
Content:
-
-
Sample Call:
curl -XPOST localhost:3000/api/location -d
[{ "name": "test 1", "lat": 1.29493, "lng": 103.77254, "catid": 34 }, { "name": "test 2", "lat": 1.29487, "lng": 103.77256, "catid": 34 }, { "name": "test 3", "lat": 1.29487, "lng": 103.77375, "catid": 32 }]
-
URL
PUT
/api/location -
Data Params
[ { "id": int, "name": string, "catid": int, "lat": float, "lng": float }, ... ]
-
Query string
-
Success Response:
-
Code: 200
Content:
-
-
Error Response:
-
Code: 400
Content:
Error
-
-
Sample Call:
curl -XPUT localhost:3000/api/location -d
{ "name": "test 1", "lat": 1.29493, "lng": 103.77254, "catid": 34 }
-
URL
DELETE
/api/location -
Data Params
{ "id": int }
-
Query string
-
Success Response:
-
Code: 200
Content: ``
-
-
Error Response:
-
Code: 400
Content:
Error
-
-
Sample Call:
curl -XDELETE localhost:3000/api/location -d
{ "name": "test 1" }