This repository contains the backend only. The HTTP request endpoints and the command line allow you to interact with the server in lieu of a front end application. To access the repository for the frontend part of the project (Android app), go to https://github.com/CSC207-UofT/cupet-frontend.
Subject to change.
- URL:
/auth/login
- Requires Authenication
No
- Method
POST
- Request Body Format
{ email: <String>, password: <String> }
- Response
{ isSuccess: <boolean>, message: <String>, data: { jwt: <String> } }
- URL:
/users/create
- Requires Authenication
Yes, requires header key-value pair: Authorization: Bearer <JWT Token>
- Method
POST
- Request Body Format
{ firstName: <String>, lastName: <String>, currentAddress: <String>, currentCity: <String>, password: <String>, emailAddress: <String> }
- Response
{ isSuccess: <boolean>, message: <String>, data: { userId: <String>, firstName: <String>, lastName: <String>, currentAddress: <String>, currentCity: <String>, email: <String> } }
- URL:
/users/account?userId=[userId]
- Method
GET
- Requires Authenication
Yes, requires header key-value pair: Authorization: Bearer <JWT Token>
- Request Body Format
N/A
- Response
{ isSuccess: <boolean>, message: <String>, data: { firstName: <String>, lastName: <String>, currentAddress: <String>, currentCity: <String>, email: <String> } }
- URL:
/users/editprofile
- Method
POST
- Requires Authenication
Yes, requires header key-value pair: Authorization: Bearer <JWT Token>
- Request Body Format
{ userId: <Integer>, newBiography: <String>, newPhoneNumber: <String>, newInstagram: <String>, newFacebook: <String> }
- Response
{ isSuccess: <boolean>, message: <String>, data: { userId: <Integer>, newBiography: <String>, newPhoneNumber: <String>, newInstagram: <String>, newFacebook: <String> } }
- URL:
/users/editaccount
- Method
POST
- Requires Authenication
Yes, requires header key-value pair: Authorization: Bearer <JWT Token>
- Request Body Format
{ userId: <Integer>, newFirstName: <String>, newLastName: <String>, newAddress: <String>, newCity: <String>, newPassword: <String>, newEmail: <String> }
- Response
{ isSuccess: <boolean>, message: <String>, data: { userId: <Integer>, newFirstName: <String>, newLastName: <String>, newCurrentAddress: <String>, newCurrentCity: <String>, newEmail: <String> } }
- URL:
/users/profile?userId=[userId]
- Method
GET
- Requires Authenication
No
- Request Body Format
N/A
- Response
{ isSuccess: <boolean>, message: <String>, data: { firstName: <Integer>, lastName: <String>, biography: <String>, phoneNumber: <String>, email: <String>, instagram: <String>, facebook: <String>, profileImgUrl: <String> (empty string if non-existant) } }
- URL:
/pets/create
- Requires Authenication
Yes, requires header key-value pair: Authorization: Bearer <JWT Token>
- Method
POST
- Request Body Format
{ userId: <String>, name: <String>, age: <String>, breed: <String>, biography: <String> }
- Response
{ isSuccess: <boolean>, message: <String>, data: { userId: <String>, petId: <String>, name: <String>, age: <String>, breed: <String>, biography: <String> } }
- URL:
/pets/profile?petId=[petId]
- Requires Authenication
No
- Method
GET
- Request Body Format
N/A
- Response
{ isSuccess: <boolean>, message: <String>, data: { name: <String>, age: <String>, breed: <String>, biography: <String>, profileImgUrl: <String> (empty string if non-existant) } }
- URL:
/pets/editprofile
- Requires Authenication
Yes, requires header key-value pair: Authorization: Bearer <JWT Token>
- Method
POST
- Request Body Format
{ userId: <String>, petId: <String>, newName: <String>, newAge: <String>, newBreed: <String>, newBiography: <String> }
- Response
{ isSuccess: <boolean>, message: <String>, data: { petId: <String>, name: <String>, age: <String>, breed: <String>, biography: <String> } }
- URL:
/pets/swipe
- Requires Authenication
Yes, requires header key-value pair: Authorization: Bearer <JWT Token>
- Method
POST
- Request Body Format
{ pet1Id: <Integer>, pet2Id: <Integer> }
- Response
{ isSuccess: <boolean>, message: <String> }
- URL:
/pets/unswipe
- Requires Authenication
Yes, requires header key-value pair: Authorization: Bearer <JWT Token>
- Method
POST
- Request Body Format
{ pet1Id: <Integer>, pet2Id: <Integer> }
- Response
{ isSuccess: <boolean>, message: <String> }
- URL:
/pets/reject
- Requires Authenication
Yes, requires header key-value pair: Authorization: Bearer <JWT Token>
- Method
POST
- Request Body Format
{ pet1Id: <Integer>, pet2Id: <Integer> }
- Response
{ isSuccess: <boolean>, message: <String> }
- URL:
/pets/unmatch
- Requires Authenication
Yes, requires header key-value pair: Authorization: Bearer <JWT Token>
- Method
POST
- Request Body Format
{ pet1Id: <Integer>, pet2Id: <Integer> }
- Response
{ isSuccess: <boolean>, message: <String> }
- URL:
/pets/fetchswipes?petId=[petId]
- Requires Authenication
Yes, requires header key-value pair: Authorization: Bearer <JWT Token>
- Method
GET
- Request Body Format
N/A
- Response
{ isSuccess: <boolean>, message: <String>, data: { petIds: [<Integer>] } }
- URL:
/pets/fetchmatches?petId=[petId]
- Requires Authenication
Yes, requires header key-value pair: Authorization: Bearer <JWT Token>
- Method
GET
- Request Body Format
N/A
- Response
{ isSuccess: <boolean>, message: <String>, data: { petIds: [<Integer>] } }
- URL:
/users/fetchpets?userId=[userId]
- Requires Authenication
Yes, requires header key-value pair: Authorization: Bearer <JWT Token>
- Method
GET
- Request Body Format
N/A
- Response
{ isSuccess: <boolean>, message: <String>, data: { petIds: [<Integer>] } }
- URL:
/pets/generatepotentialmatches?petId=[petId]
- Requires Authenication
Yes, requires header key-value pair: Authorization: Bearer <JWT Token>
- Method
GET
- Request Body Format
N/A
- Response
{ isSuccess: <boolean>, message: <String>, data: { petIds: [<Integer>] } }
- URL:
/users/setprofileimage
- Requires Authentiction
Yes, requires header key-value pair: Authorization: Bearer <JWT Token>
- Method
POST
- Request Body Format
{ base64Encoded: <String> }
- Response
{ isSuccess: <boolean>, message: <String>, data: { url: <String> } }
- URL:
/pets/setprofileimage
- Requires Authentiction
Yes, requires header key-value pair: Authorization: Bearer <JWT Token>
- Method
POST
- Request Body Format
{ petId: <String>, base64Encoded: <String> }
- Response
{ isSuccess: <boolean>, message: <String>, data: { url: <String>, assetId: <String> } }