-
Notifications
You must be signed in to change notification settings - Fork 2
API Specifications
YeonJeong edited this page Oct 4, 2023
·
28 revisions
- Template adopted from: https://gist.github.com/azagniotov/a4b16faf0febd12efbc6c3d7370383a6
POST /user/signup/ (creates new user by signing up)
Key Value Description None None N/A
{ "email": "string", "password": "string", "nickname": "string" }
Code Message Description 201None N/A 400wrong input(one or more input fields are missing or given with the wrong type) 400password unavailable(the length of the password doesn't meet the requirements) 400email address unavailable(email address is already taken)
POST /user/login/ (creates new authorization tokens)
Key Value Description None None N/A
{ "email": "string", "password": "string" }
{ "access": "string", "refresh": "string" }
Code Message Description 200None OK 400wrong email address(there is no user signed up with this email address) 400wrong password(the password doesn't match that of the user with this email address)
POST /user/refresh/ (refreshes user's authorization tokens)
Key Value Description None None N/A
{ "refresh": "string" }
{ "access": "string" }
Code Message Description 200None OK 400wrong input(one or more input fields are missing or given with the wrong type) 401refresh token expired(refresh token expired; user has to attempt a new login)
POST /user/logout/ (deletes user's authorization tokens) 🔒
Key Value Description Authorization Bearer {access} user's access token (must be sent with the prefix 'Bearer')
Code Message Description 200None OK 403no access token(no access token was sent in the header) 403access token expired(access token expired; user has to refresh to retrieve a new token)
GET /user/checkemail/ (checks for email address duplicates)
Key Value Description None None N/A
{ "email": "string" }
Code Message Description 200None OK 400wrong input(one or more input fields are missing or given with the wrong type) 400email address unavailable(email address is already taken)
GET /user/profile (gets user's profile) 🔒
Key Value Description Authorization Bearer {access} user's access token (must be sent with the prefix 'Bearer')
{ "user": { "email": "string", "nickname": "string", ... // more fields to be added later } }
Code Message Description 200None OK 400no access token(no access token was sent in the header) 401access token expired(access token expired; user has to refresh to retrieve a new token)
POST /user/changepw/ (To be modified) # ### (changes password) 🔒
Key Value Description Authorization Bearer {access} user's access token (must be sent with the prefix 'Bearer')
{ "password": "string" }
Code Message Description 200None OK 400wrong input(one or more input fields are missing or given with the wrong type) 400password unavailable(the length of the password doesn't meet the requirements) 400no access token(no access token was sent in the header) 401access token expired(access token expired; user has to refresh to retrieve a new token)