This the backend cloud code for BuieConnect app
- Environment variables:
- DATABASE_URI = <Sqlalchemy format database uri>
- GCM_API_KEY = <Google Cloud Messaging api key>
- CLIENT_ID = <Google OAuth client id to get details of users>
- SECRET_KEY = <Key used to encrypt tokens>
- FIREBASE_SECRET = <Firebase app secret>
- Base url: /api/v1
- User operation urls
-
"/user" :
- Request methods allowed GET, PUT
- Require headers: Auth token
- Returns
- GET: get details of the current user identified by the token
- PUT: modifies the current user identified by the token
- Example:
{ "gcm_reg_id": "gcm registration id", "current_semester": 2, "lastName": "Last Name", "email": "email@mail.com", "admission_year": 2000, "is_admin": true, "reg_date": "2016-04-06T11:35:51.146837+00:00", "google_sub": "34234234234", "is_alumnus": false, "url": "http://<site_url>/api/v1/users/1", "univ_roll": 2013, "passout_year": 2016, "firstName": "First Name", "department_name": "CSE", "verified": false, "id": 1 }
-
"/users/<id>" :
- Request methods allowed GET, PUT
- Require headers: Auth token of admin or the user
- Returns
- GET: without id, returns array of users
- GET: with id, get details of the current user identified by id
- PUT: modifies the user identified by id
- Example:
[ { "gcm_reg_id": "gcm registration id", "current_semester": 2, "lastName": "Last Name", "email": "email@mail.com", "admission_year": 2000, "is_admin": true, "reg_date": "2016-04-06T11:35:51.146837+00:00", "google_sub": "34234234234", "is_alumnus": false, "url": "http://<site_url>/api/v1/users/1", "univ_roll": 2013, "passout_year": 2016, "firstName": "First Name", "department_name": "CSE", "verified": false, "id": 1 } [
-
"/notices/<id>" :
- Request methods allowed GET
- Require headers: None
- Returns
- GET: without id, returns array of notices
- GET: with id, returns details of the notice identified by id
- Example:
{ "id": 4, "message": "Notice Message", "title": "Notice title", "url": "http://<site url>/api/v1/notices/4" }
-
{
"code": 404,
"errors": [], // additional errors
"message": "Error message"
}