MyPath is dedicated to helping high school students and young adults plan for the future. This is the repository for MyPath's back-end. It was built using Java and Spring Boot with a PostgreSQL database.
BASE URL https://samirlilienfeld-mypath.herokuapp.com
| Links | Endpoints |
|---|---|
| POST Registration | /createnewuser |
| POST Login | /login |
| Links | Endpoints |
|---|---|
| GET Logout | /logout |
| GET User's Info | /users/getuserinfo |
| GET Details By Id | /details/details/:detailsid |
| GET Details By User Id | /details/user/:userid |
| PUT Details | /data/details/:detailsid |
| DELETE Details | /data/details/:detailsid |
Payload: an object with the following credentials:
Required:
username,password, &primaryemail
{
"username": "myUsername",
"password": "myPassword",
"primaryemail": "myemail@gmail.com",
}Request Structure: the username and password with an authorization header containing the CLIENTID and CLIENTSECRET
axios.post('https://samirlilienfeld-mypath.herokuapp.com/login',
`grant_type=password&username=${USERNAME}&password=${PASSWORD}`,
{
headers: { Authorization: `Basic ${btoa('my-client-id:my-client-secret')}`,
'Content-Type': 'application/x-www-form-urlencoded'
},
})Return: An access token will be returned. Save this token to local storage (or similar). This token will be required for all HTTP requests below (protected endpoints).
{
"access_token": "2fgce453-63gh-33cd-5ff5-g56dcft55555",
"token_type": "bearer",
"expires_in": 3600,
"scope": "read trust write"
}Return: Removes token from token store and returns nothing.