Public
Documentation Settings

PurpleBook

auth

POSTFacebook login

https://purplebook-i3b.onrender.com/api/auth/facebook?access_token={{accessToken}}
PARAMS
access_token

{{accessToken}}

Example Request
curl
curl --location -g --request POST 'https://purplebook-i3b.onrender.com/api/auth/facebook?access_token={{accessToken}}'
Example Response
No response body
This request doesn't return any response body
No response headers
This request doesn't return any response headers

POSTsignup

https://purplebook-i3b.onrender.com/api/auth/signup

returns 201 with the user id
or 400 with errors array

Bodyformdata
firstName

john

should be in english and not more than 20 characters

lastName

smith

should be in english and not more than 20 characters

email

example@mail.com

should be a valid email format and not used before

password

12345678

between 8 and 32 characters

profilePicture

should be an image

Example Request
curl
curl --location 'https://purplebook-i3b.onrender.com/api/auth/signup' \
--form 'firstName="john"' \
--form 'lastName="smith"' \
--form 'email="example@mail.com"' \
--form 'password="12345678"' \
--form 'profilePicture=@"/path/to/file"'
Example Response
No response body
This request doesn't return any response body
No response headers
This request doesn't return any response headers

POSTlogin

https://purplebook-i3b.onrender.com/api/auth/login

return 200 with user id, token, and would return isAdmin: true if the user is an admin

or 400 with errros array

Bodyurlencoded
email

example@mail.com

should be an existing email

password

12345678

should be a valid password

Example Request
curl
curl --location 'https://purplebook-i3b.onrender.com/api/auth/login' \
--data-urlencode 'email=example@mail.com' \
--data-urlencode 'password=12345678'
Example Response
No response body
This request doesn't return any response body
No response headers
This request doesn't return any response headers

users

AUTHORIZATIONBearer Token
Token