-
Notifications
You must be signed in to change notification settings - Fork 2
API Specifications
YeonJeong edited this page Oct 6, 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 key of Message Description 201None Successfully created 400missing input value, blank input, invalid email format, length error(✅len<=50), already taken 400passwordmissing input value, blank input, length error(✅len>=8) 400nicknamemissing input value, blank input, length error(✅len<=15)
POST /user/login/ (creates new authorization tokens)
Key Value Description None None N/A
{ "email": "string", "password": "string" }
{ "access": "string", "refresh": "string" }
Code key of Message Description 200None OK 400missing input value, blank input, invalid email format, no such user w/ the email 400passwordmissing input value, blank input, wrong password
POST /user/refresh/ (refreshes user's authorization tokens)
Key Value Description None None N/A
{ "refresh": "string" }
{ "access": "string" }
Code key of Message Description 200None OK 400refreshmissing input value, blank input 401detailandcoderefresh 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')
{ "refresh": "string" }
Code key of Message Description 200None OK 400refreshmissing input value, blank input 403detailno access token was sent in the header 403detail,codeandmessagesaccess token expired; user has to refresh to retrieve a new token
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": { "id": int, "email": "string", "nickname": "string", "updated_at": timestamp ... // more fields to be added later } }
Code key of Message Description 200None OK 403detailno access token was sent in the header 403detail,codeandmessagesaccess token expired; user has to refresh to retrieve a new token
PATCH /user/profile/nickname/ (changes user's nickname) 🔒
Key Value Description Authorization Bearer {access} user's access token (must be sent with the prefix 'Bearer')
{ "nickname": "string" }
Code key of Message Description 200None Successfully changed 400nicknamemissing input value, blank input, length error(✅len<=15), same as the original nickname
PATCH /user/profile/password/ (changes user's password) 🔒
Key Value Description Authorization Bearer {access} user's access token (must be sent with the prefix 'Bearer')
{ "password": "string" }
Code key of Message Description 200None Successfully changed 400passwordmissing input value, blank input, length error(✅len>=8)