METHOD: POST
1. request
request body (json)
{
"username": username(7elog상 @뒤에붙는 unique한 유저네임:string),
"email": email(string),
"password1": password1(string),
"password2": password2(string),
"name": name(이름:string)
"profile_image": profile_image(file 업로드),
"introduction": introduction(string)
}
2. response
이메일 인증의 경우
status code 201 CREATED
response body (json)
{
"detail": "Verification e-mail sent."
}
이후 이메일에 온 주소 통해 account-confirm-email로 key를 인식하는데 성공시 회원가입 자동완료
또한 이메일 인증 경우 초기회원가입시 profile_image가 무조건 null로 생성되는 문제존재
이메일 인증안한 보통 경우(참고용, 이메일 인증 서버연동 실패시 이처럼 구현할수도)
status code 201 CREATED
response body (json)
{
"access_token": access_token(string),
"refresh_token": refresh_token(string),
"user": {
"username": username(7elog상 @뒤에붙는 unique한 유저네임:string),
"email": email(string),
"name": name(이름:string)
"profile_image": profile_image(string),
"introduction": introduction(string),
"velog_name": velog_name(string),
"mail": mail(string),
"github": github(string),
"twitter": twitter(string),
"facebook": facebook(string),
"homepage": homepage(string),
"about": about(string)
}
}
METHOD: POST
1. request
CSRF 토큰 필요
pm.environment.set("xsrf-token", decodeURIComponent(pm.cookies.get("XSFR-TOKEN")));
X-CSRFToken : {{csrftoken}}
<https://codong.tistory.com/28> 참고
request body (json)
{
"email": email(string),
"password": password(string)
}
2. response
status code 201 CREATED
response body (json)
{
"access_token": access_token(string),
"refresh_token": refresh_token(string),
"user": {
"username": username(7elog상 @뒤에붙는 unique한 유저네임:string),
"email": email(string),
"name": name(이름:string)
"profile_image": profile_image(string),
"introduction": introduction(string),
"velog_name": velog_name(string),
"mail": mail(string),
"github": github(string),
"twitter": twitter(string),
"facebook": facebook(string),
"homepage": homepage(string),
"about": about(string)
}
}
METHOD: POST
1. request
request header
X-CSRFToken : {{csrftoken}}
request body (json)
{
"refresh": refresh_token(string)
}
2. response
status code 200 OK
response body (json)
{
"detail": "Successfully logged out."
}
METHOD: GET
1. request
request header
Authorization: Bearer Token {access Token}
2. response
status code 200 OK
response body (json)
{
"username": username(7elog상 @뒤에붙는 unique한 유저네임:string),
"email": email(string),
"name": name(이름:string)
"profile_image": profile_image(string),
"introduction": introduction(string),
"velog_name": velog_name(string),
"mail": mail(string),
"github": github(string),
"twitter": twitter(string),
"facebook": facebook(string),
"homepage": homepage(string),
"about": about(string)
}
METHOD: PUT, PATCH(PUT은 전부 수정, PATCH는 일부 수정)
1. request
request header
Authorization: Bearer Token {access Token}
request body (json)
{
"username": username(7elog상 @뒤에붙는 unique한 유저네임:string),
"name": name(이름:string),
"profile_image": profile_image(file 업로드),
"introduction": introduction(string),
"velog_name": velog_name(string),
"mail": mail(string),
"github": github(string),
"twitter": twitter(string),
"facebook": facebook(string),
"homepage": homepage(string),
"about": about(string)
}
2. response
status code 200 OK
response body (json)
{
"username": username(7elog상 @뒤에붙는 unique한 유저네임:string),
"email": email(string),
"name": name(이름:string)
"profile_image": profile_image(string),
"introduction": introduction(string),
"velog_name": velog_name(string),
"mail": mail(string),
"github": github(string),
"twitter": twitter(string),
"facebook": facebook(string),
"homepage": homepage(string),
"about": about(string)
}
(2) /api/v1/accounts/user/@username:str (username 통해 유저 정보 얻어오기 가능)
METHOD: GET
1. request
AllowAny(아무나 조회는 접근 가능)
2. response
status code 200 OK
response body (json)
{
"username": username(7elog상 @뒤에붙는 unique한 유저네임:string),
"email": email(string),
"name": name(이름:string)
"profile_image": profile_image(string),
"introduction": introduction(string),
"velog_name": velog_name(string),
"mail": mail(string),
"github": github(string),
"twitter": twitter(string),
"facebook": facebook(string),
"homepage": homepage(string),
"about": about(string)
}
(3) /api/v1/accounts/user/delete/@username:str user 삭제
user가 author인 posts, comments, series, tags 제거후 user도 제거하기에 주의해서 사용
대략적으로만 테스트해도 무방할듯
METHOD: DELETE
1. request
해당유저거나 admin만 허용
2. response
status code 204 NO CONTENT
response body (json)
{}
※ 소셜로그인 공통사항 (현재는 구글만 쓴 상태)
두 개의 소셜 계정이 만일 같은 이메일을 공유한다면 먼저 처음 이메일로 가입 후 다른 소셜 계정으로 로그인하려한다면 이미 이 유저가 다른 소셜 계정으로 가입되었다고 에러메시지 보냄.