Server-side of a group expense manger application which automatically merge multiple group liabilities into one transaction per person.
Create a new user with user-name, email and password. Cannot have duplicate email but accepts duplicate user-name.
Request Body:
{ "name": String, //user name
"email": String, //user email
"password": String //user password}
Response:
{"success": true/false,
"user": {
"name": String, //User Name
"email": String, //User Email
"ifImg": Boolean, //If User uploads profile Img
"groups": [Strings], //uuids of the groups the user belongs to
"notifications": [Strings], //uuids of notifications related to liabilities
}
}
Error:
1. Validatioin Fail (Info Miss OR User Duplicate)
Sign in to get the token used in exchange for user-related information
Request Body:
{ "email": String, //User Email
"password": Boolean, //Password encryped in SHA256
}
Response:
{ "token": String, //Auto-generated session token }
Error:
1. User not found
2. Password Unmatched
Get detailed information about a user using the token id. Request Body:
{"token": String, //user token obtained by signin
"id": String, //uuid that marks user in database OPTIONAL
}
Reponse:
{
"user": {
"name": String, //User Name
"email": String, //User Email
"ifImg": Boolean, //If User uploads profile Img
"groups": [Strings], //uuids of the groups the user belongs to
"notifications": [Strings], //uuids of notifications related to liabilities
}
}
Error:
1. Invalid Token
Used to search people and add friend Request:
{ "email": String //Email of a user }
Response:
{ "email": String, //email of the searched user
"name": String, //user name of the searched user
"id": String //id of searched user
}
Error:
1. Invalid Token
2. User not found
Update/Create the profile image of a user Request body:
{ "token": String, //user token id
"name": String //Picture encoded in base64
}
Error:
1. Invalid token
Response:
{ "Reponse": "Image Uploaded Successfully" }
Error:
1. Invalid Token
Update general user information including username, Transfer info Request body:
{ "token": String, //user token id,
"name": String, //new user name, (OPTIONAL)
"type": String, //Bank Account Type, (VISA/MASTER/PAYPAL)
"num": String, //Account Routine Number
}
Error:
1. Invalid Token
Create a new travel group
{ "token": String, //user token id,
"title": String, //title displayed for the group (OPTIONAL)
"startDate": Stringified Date Type, //(OPTIONAL)
"endDate": Stringified Data type, //(OPTIONAL)
}
Error
1. Invalid Token
2. Invalid Date Object
Get Group info through id
{ "token": String, //user token id,
"id": String, //Group Id
}
Error
1. Invalid token
2. Group not found
Update Group Image
{ "token": String, //user token id,
"groupId": String, //Group Id,
"img": String, //Group Image encoded in base64 (OPTIONAL)
}
Error:
1. Invalid token
2. Group not found
Update general group info
{ "token": String, //user token id,
"groupId": String, //Group Id,
"title": String, //Updated group title
"startDate": Stringified Date Type, //(OPTIONAL)
"endDate": Stringified Data type, //(OPTIONAL)
}
Erro:
1. Invalid token
2. Group not found
Add a person into potential group member and send notification to that person
{ "token": String, //user token id
"groupId": String, //group id
"target": String //id of the person to be added (First search using searchUserByEmail)
}
Error:
- User not Found
- Group not Found
- Invalid Token
Create a bill information created during the group travel, where the user who initiates this bill is automatically regarded as the payer for this bill for everyone who participates in the activity. Then, notifications are sent to participants
{ "token": String, //user token id,
"participants": String[], //Arrays of user id of participants
"group": String, //group id
"amount": Integer, //amount of the bill
"type": Integer //type of the bill
}
Error:
1. Invalid token
2. User not found
3. Group not found
Type Parameter:
- airplane
- Tea
- Breakfast
- Transportation
- Hotel
- Undefined
Reply to a group invitation
{ token: String, //user token id
id : String, //id of the notifications the users are responding to
response: Int // 0 -Accpet, 1 - Decline
}
Error:
- Invalid token
- Invalid response
- Notification not found
Return all suspended group invitation and unread bill notifications related to a user
{ "token": String //user token id }
Error:
1. Invalid token