-
Notifications
You must be signed in to change notification settings - Fork 2
Backend API Endpoints
adamr5000 edited this page Mar 9, 2016
·
3 revisions
Endpoint: /generalUser/:userId
Method: GET
Example Response:
- if error then status
401
{
"Error": false,
"Message": "Success",
"User": [
{
"EmailAddress": "hello@apache.org",
"FirstName": "John",
"LastName": "Doe",
"UserType": "Student"
}
]
}
Endpoint: /login
Method: POST
Body Fields:
emailaddresspassword
Example Body:
{
"emailaddress": "hello@apache.org",
"password": "hello1"
}
Example Response:
- if error then status
401
{
"Error": false,
"Message": "Success",
"UserID": [
{
"UserID": 1
}
]
}
Endpoint: /update/password
Method: PUT
Body Fields:
passworduseridoldpassword
Example Body:
{
"userid": 1,
"password": "wow",
"oldpassword": "hello1"
}
Response:
- status
401if it is an invalid password - status
200if it was successfully changed
Endpoint: /update/email
Method: PUT
Body Fields:
-
email: the new email useridpassword
Example Body:
{
"userid": 1,
"password": "wow",
"email": "jonh@gmail.com"
}
Example Response:
- if error then status
401
{
"Error": false,
"Message": "Success",
"EmailAddress": "jonh@gmail.com"
}
Endpoint: /update/name
Method: PUT
Body Fields:
firstnamelastnameuserid
Example Body:
{
"userid": 1,
"firstname": "Holly",
"lastname": "George"
}
Example Response:
{
"Error": false,
"Message": "Success",
"Name": {
"fieldCount": 0,
"affectedRows": 1,
"insertId": 0,
"serverStatus": 2,
"warningCount": 0,
"message": "(Rows matched: 1 Changed: 1 Warnings: 0",
"protocol41": true,
"changedRows": 1
}
}
Endpoint: /CreateSemester
Method: POST
Body Fields:
semesterNamestartDateendDate
Example Body:
add an example here
Example Response:
{
"SemesterID": 1
}