개요

HTTP 동사

본 REST API에서 사용하는 HTTP 동사(verbs)는 가능한 한 표준 HTTP와 REST 규약을 따릅니다.

동사 용례

GET

리소스를 가져올 때 사용

POST

새 리소스를 만들거나 인증 요청할 때 사용

PUT

기존 리소스를 수정할 때 사용

PATCH

기존 리소스의 일부를 수정할 때 사용

DELETE

기존 리소스를 삭제할 때 사용

HTTP 상태 코드

본 REST API에서 사용하는 HTTP 상태 코드는 가능한 한 표준 HTTP와 REST 규약을 따릅니다.

상태 코드 용례

200 OK

요청을 성공적으로 처리함

201 Created

새 리소스를 성공적으로 생성함

204 No Content

기존 리소스를 성공적으로 수정함

400 Bad Request

잘못된 요청

401 Unauthorized

인증되지 않은 요청

403 Forbidden

권한이 없는 요청

404 Not Found

요청한 리소스가 존재하지 않음

409 Conflict

요청이 현재 서버 상태와 충돌함

500 Internal Server Error

서버에 오류가 발생함

리소스

사용자

User Service는 사용자 인증 및 계정 관리 기능을 제공합니다.

카카오 OAuth 콜백

카카오 OAuth 인증 프로세스의 콜백을 처리합니다.

Request fields

Path Type Description

code

String

카카오 인증 코드

state

String

상태 값

HTTP request

POST /oauth/callback/kakao?_csrf=7vSMRD6zT2T5aHPdVt-NQMwWRis8L1UQLCqhuoH8c0bjOoAK18bqIQeBfVDUCUTuM_K5dqkna0oIHmM9FRuZ2-TLRnCFA-Vv HTTP/1.1
Content-Type: application/json
Content-Length: 66
Host: localhost:8080

{
  "code" : "test_authorization_code",
  "state" : "test_state"
}

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 101

{
  "nickname" : "test_user",
  "accessToken" : "test_access_token",
  "email" : "test@example.com"
}

Response fields

Path Type Description

accessToken

String

액세스 토큰

nickname

String

사용자 닉네임

email

String

사용자 이메일

구글 OAuth 콜백

구글 OAuth 인증 프로세스의 콜백을 처리합니다.

Request fields

Path Type Description

code

String

구글 인증 코드

state

String

상태 값

HTTP request

POST /oauth/callback/google?_csrf=me9Zng4yyAgwl6-HkvfjX0gbJl-B1K757TbF3adxM6WwpNZYqt5hqjcCqTAd8cm0ptrXZy0sCz6w45nU1APx754XAp2Dlec8 HTTP/1.1
Content-Type: application/json
Content-Length: 64
Host: localhost:8080

{
  "code" : "test_google_auth_code",
  "state" : "test_state"
}

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 122

{
  "nickname" : "test_google_user",
  "accessToken" : "test_google_access_token",
  "email" : "test.google@example.com"
}

Response fields

Path Type Description

accessToken

String

액세스 토큰

nickname

String

사용자 닉네임

email

String

사용자 이메일

토큰 갱신

리프레시 토큰을 사용하여 새로운 액세스 토큰을 발급받습니다.

Request fields

Path Type Description

username

String

사용자 이름

HTTP request

POST /refresh?_csrf=2c2t3ue8YBLRYi-dHzOQG_0SPpJVbgk3vPAYT1yYbv_6etDAvamc7N7aBCr8BE6oLR6kL8tzE_A0CDka2ZYvdj2oWcefG-fw HTTP/1.1
Content-Type: application/json
Content-Length: 29
Host: localhost:8080

{
  "username" : "testUser"
}

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 40

{
  "accessToken" : "new_access_token"
}

Response fields

Path Type Description

accessToken

String

새로운 액세스 토큰

로그아웃

사용자를 로그아웃 처리합니다. 인증된 사용자만 접근 가능합니다.

HTTP request

POST /user/logout HTTP/1.1
Content-Type: application/json
Host: localhost:8080

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 79

{
  "status" : "success",
  "message" : "로그아웃 처리되었습니다."
}

Response fields

Path Type Description

status

String

처리 상태

message

String

처리 메시지

회원탈퇴

사용자 계정을 삭제합니다. 인증된 사용자만 접근 가능합니다.

HTTP request

DELETE /user HTTP/1.1
Content-Type: application/json
Host: localhost:8080

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
X-XSS-Protection: 0
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: 0
X-Frame-Options: DENY
Content-Length: 81

{
  "status" : "success",
  "message" : "회원탈퇴가 완료되었습니다"
}

Response fields

Path Type Description

status

String

처리 상태

message

String

처리 메시지