API 목록

이메일 회원가입 API

Curl request

$ curl 'http://localhost:8080/api/v2/auth/email/signup' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '{
  "email" : "test@example.com",
  "password" : "12345678",
  "nickName" : "닉네임"
}'

HTTP request

POST /api/v2/auth/email/signup HTTP/1.1
Content-Type: application/json
Content-Length: 89
Host: localhost:8080

{
  "email" : "test@example.com",
  "password" : "12345678",
  "nickName" : "닉네임"
}

HTTP response

HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 79

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : true
}

HTTPie request

$ echo '{
  "email" : "test@example.com",
  "password" : "12345678",
  "nickName" : "닉네임"
}' | http POST 'http://localhost:8080/api/v2/auth/email/signup' \
    'Content-Type:application/json'

Request body

{
  "email" : "test@example.com",
  "password" : "12345678",
  "nickName" : "닉네임"
}

Request fields

Path Type Description

email

String

이메일

password

String

비밀번호

nickName

String

닉네임

Response body

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : true
}

Response fields

Path Type Description

success

Boolean

성공 여부

code

String

결과 코드

message

String

메시지

data

Boolean

생성 여부

이메일 로그인 API

Curl request

$ curl 'http://localhost:8080/api/v2/auth/email/login' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '{
  "email" : "test@example.com",
  "password" : "12345678"
}'

HTTP request

POST /api/v2/auth/email/login HTTP/1.1
Content-Type: application/json
Content-Length: 61
Host: localhost:8080

{
  "email" : "test@example.com",
  "password" : "12345678"
}

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 165

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : {
    "accessToken" : "<< access token >>",
    "refreshToken" : "<< refresh token >>"
  }
}

HTTPie request

$ echo '{
  "email" : "test@example.com",
  "password" : "12345678"
}' | http POST 'http://localhost:8080/api/v2/auth/email/login' \
    'Content-Type:application/json'

Request body

{
  "email" : "test@example.com",
  "password" : "12345678"
}

Request fields

Path Type Description

email

String

이메일

password

String

패스워드

Response body

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : {
    "accessToken" : "<< access token >>",
    "refreshToken" : "<< refresh token >>"
  }
}

Response fields

Path Type Description

success

Boolean

성공 여부

code

String

결과 코드

message

String

메시지

data.accessToken

String

액세스 토큰

data.refreshToken

String

리프레시 토큰


OAuth2 로그인 혹은 회원가입 요청 API (로그인)

Curl request

$ curl 'http://localhost:8080/api/v2/auth/oauth2/authorize' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '{
  "token" : "<< OAuth2 token >>",
  "type" : "google",
  "state" : "ZTdjMGU5NjgtMDRkZS0xMWVlLWJlNTYtMDI0MmFjMTIwMDAy"
}'

HTTP request

POST /api/v2/auth/oauth2/authorize HTTP/1.1
Content-Type: application/json
Content-Length: 121
Host: localhost:8080

{
  "token" : "<< OAuth2 token >>",
  "type" : "google",
  "state" : "ZTdjMGU5NjgtMDRkZS0xMWVlLWJlNTYtMDI0MmFjMTIwMDAy"
}

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 187

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : {
    "isLogin" : true,
    "accessToken" : "<< access token >>",
    "refreshToken" : "<< refresh token >>"
  }
}

HTTPie request

$ echo '{
  "token" : "<< OAuth2 token >>",
  "type" : "google",
  "state" : "ZTdjMGU5NjgtMDRkZS0xMWVlLWJlNTYtMDI0MmFjMTIwMDAy"
}' | http POST 'http://localhost:8080/api/v2/auth/oauth2/authorize' \
    'Content-Type:application/json'

Request body

{
  "token" : "<< OAuth2 token >>",
  "type" : "google",
  "state" : "ZTdjMGU5NjgtMDRkZS0xMWVlLWJlNTYtMDI0MmFjMTIwMDAy"
}

Request fields

Path Type Description

token

String

OAuth2 인증 토큰

type

String

OAuth2 로그인 타입 ex) GOOGLE, NAVER, KAKAO

state

String

상태 코드 (회원가입 시 사용되며 회원가입이 완료될 때 까지 동일한 코드를 사용해야 함)

Response body

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : {
    "isLogin" : true,
    "accessToken" : "<< access token >>",
    "refreshToken" : "<< refresh token >>"
  }
}

Response fields

Path Type Description

success

Boolean

성공 여부

code

String

결과 코드

message

String

메시지

data.isLogin

Boolean

로그인 성공 여부

data.accessToken

String

액세스 토큰

data.refreshToken

String

리프레시 토큰


OAuth2 로그인 혹은 회원가입 요청 API (회원가입 요청)

Curl request

$ curl 'http://localhost:8080/api/v2/auth/oauth2/authorize' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '{
  "token" : "<< OAuth2 token >>",
  "type" : "google",
  "state" : "ZTdjMGU5NjgtMDRkZS0xMWVlLWJlNTYtMDI0MmFjMTIwMDAy"
}'

HTTP request

POST /api/v2/auth/oauth2/authorize HTTP/1.1
Content-Type: application/json
Content-Length: 121
Host: localhost:8080

{
  "token" : "<< OAuth2 token >>",
  "type" : "google",
  "state" : "ZTdjMGU5NjgtMDRkZS0xMWVlLWJlNTYtMDI0MmFjMTIwMDAy"
}

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 149

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : {
    "isLogin" : false,
    "tempUserToken" : "<< temp user token >>"
  }
}

HTTPie request

$ echo '{
  "token" : "<< OAuth2 token >>",
  "type" : "google",
  "state" : "ZTdjMGU5NjgtMDRkZS0xMWVlLWJlNTYtMDI0MmFjMTIwMDAy"
}' | http POST 'http://localhost:8080/api/v2/auth/oauth2/authorize' \
    'Content-Type:application/json'

Request body

{
  "token" : "<< OAuth2 token >>",
  "type" : "google",
  "state" : "ZTdjMGU5NjgtMDRkZS0xMWVlLWJlNTYtMDI0MmFjMTIwMDAy"
}

Request fields

Path Type Description

token

String

OAuth2 인증 토큰

type

String

OAuth2 로그인 타입 ex) GOOGLE, NAVER, KAKAO

state

String

상태 코드 (회원가입 시 사용되며 회원가입이 완료될 때 까지 동일한 코드를 사용해야 함)

Response body

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : {
    "isLogin" : false,
    "tempUserToken" : "<< temp user token >>"
  }
}

Response fields

Path Type Description

success

Boolean

성공 여부

code

String

결과 코드

message

String

메시지

data.isLogin

Boolean

로그인 성공 여부

data.tempUserToken

String

임시 회원 토큰 (추가 회원정보를 입력하기 전에 발급되는 임시 토큰)


OAuth2 추가 회원 정보 입력 및 회원가입 완료 API

Curl request

$ curl 'http://localhost:8080/api/v2/auth/oauth2/signup' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '{
  "state" : "ZTdjMGU5NjgtMDRkZS0xMWVlLWJlNTYtMDI0MmFjMTIwMDAy",
  "tempUserToken" : "<< temp user token >>",
  "nickName" : "닉네임"
}'

HTTP request

POST /api/v2/auth/oauth2/signup HTTP/1.1
Content-Type: application/json
Content-Length: 139
Host: localhost:8080

{
  "state" : "ZTdjMGU5NjgtMDRkZS0xMWVlLWJlNTYtMDI0MmFjMTIwMDAy",
  "tempUserToken" : "<< temp user token >>",
  "nickName" : "닉네임"
}

HTTP response

HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 165

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : {
    "accessToken" : "<< access token >>",
    "refreshToken" : "<< refresh token >>"
  }
}

HTTPie request

$ echo '{
  "state" : "ZTdjMGU5NjgtMDRkZS0xMWVlLWJlNTYtMDI0MmFjMTIwMDAy",
  "tempUserToken" : "<< temp user token >>",
  "nickName" : "닉네임"
}' | http POST 'http://localhost:8080/api/v2/auth/oauth2/signup' \
    'Content-Type:application/json'

Request body

{
  "state" : "ZTdjMGU5NjgtMDRkZS0xMWVlLWJlNTYtMDI0MmFjMTIwMDAy",
  "tempUserToken" : "<< temp user token >>",
  "nickName" : "닉네임"
}

Request fields

Path Type Description

state

String

상태 코드 (회원가입 시 사용되며 회원가입이 완료될 때 까지 동일한 코드를 사용해야 함)

tempUserToken

String

회원가입 요청 시 발급된 임시 회원 토큰

nickName

String

사용하려는 닉네임

Response body

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : {
    "accessToken" : "<< access token >>",
    "refreshToken" : "<< refresh token >>"
  }
}

Response fields

Path Type Description

success

Boolean

성공 여부

code

String

결과 코드

message

String

메시지

data.accessToken

String

액세스 토큰

data.refreshToken

String

리프레시 토큰


OAuth2 계정 연동 API

Curl request

$ curl 'http://localhost:8080/api/v2/auth/oauth2/link' -i -X PUT \
    -H 'Content-Type: application/json' \
    -H 'X-USER-ID: 1' \
    -d '{
  "token" : "<< OAuth2 token >>",
  "type" : "google"
}'

HTTP request

PUT /api/v2/auth/oauth2/link HTTP/1.1
Content-Type: application/json
X-USER-ID: 1
Content-Length: 57
Host: localhost:8080

{
  "token" : "<< OAuth2 token >>",
  "type" : "google"
}

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 79

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : true
}

HTTPie request

$ echo '{
  "token" : "<< OAuth2 token >>",
  "type" : "google"
}' | http PUT 'http://localhost:8080/api/v2/auth/oauth2/link' \
    'Content-Type:application/json' \
    'X-USER-ID:1'

Request body

{
  "token" : "<< OAuth2 token >>",
  "type" : "google"
}

Request fields

Path Type Description

token

String

OAuth2 인증 토큰

type

String

OAuth2 로그인 타입 ex) GOOGLE, NAVER, KAKAO

Request headers

Name Description

x-user-id

로그인한 유저 id

Response body

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : true
}

Response fields

Path Type Description

success

Boolean

성공 여부

code

String

결과 코드

message

String

메시지

data

Boolean

연동 성공 여부


OAuth2 계정 연동 해제 API

Curl request

$ curl 'http://localhost:8080/api/v2/auth/oauth2/link' -i -X DELETE \
    -H 'X-USER-ID: 1' \
    -d 'type=google'

Form parameters

Parameter Description

type

OAuth2 로그인 타입 ex) GOOGLE, NAVER, KAKAO

HTTP request

DELETE /api/v2/auth/oauth2/link HTTP/1.1
X-USER-ID: 1
Content-Type: application/x-www-form-urlencoded
Host: localhost:8080
Content-Length: 11

type=google

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 79

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : true
}

HTTPie request

$ http --form DELETE 'http://localhost:8080/api/v2/auth/oauth2/link' \
    'X-USER-ID:1' \
    'type=google'

Request body

type=google

Request headers

Name Description

x-user-id

로그인한 유저 id

Response body

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : true
}

Response fields

Path Type Description

success

Boolean

성공 여부

code

String

결과 코드

message

String

메시지

data

Boolean

연동 해제 성공 여부


로그인 토큰 갱신 API

Curl request

$ curl 'http://localhost:8080/api/v2/auth/token' -i -X POST \
    -H 'Content-Type: application/json' \
    -d '{
  "accessToken" : "<< access token >>",
  "refreshToken" : "<< refresh token >>"
}'

HTTP request

POST /api/v2/auth/token HTTP/1.1
Content-Type: application/json
Content-Length: 84
Host: localhost:8080

{
  "accessToken" : "<< access token >>",
  "refreshToken" : "<< refresh token >>"
}

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 173

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : {
    "accessToken" : "<< new access token >>",
    "refreshToken" : "<< new refresh token >>"
  }
}

HTTPie request

$ echo '{
  "accessToken" : "<< access token >>",
  "refreshToken" : "<< refresh token >>"
}' | http POST 'http://localhost:8080/api/v2/auth/token' \
    'Content-Type:application/json'

Request body

{
  "accessToken" : "<< access token >>",
  "refreshToken" : "<< refresh token >>"
}

Request fields

Path Type Description

accessToken

String

액세스 토큰

refreshToken

String

리프레시 토큰

Response body

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : {
    "accessToken" : "<< new access token >>",
    "refreshToken" : "<< new refresh token >>"
  }
}

Response fields

Path Type Description

success

Boolean

성공 여부

code

String

결과 코드

message

String

메시지

data.accessToken

String

갱신된 액세스 토큰

data.refreshToken

String

갱신된 리프레시 토큰


회원 정보 조회 API

Curl request

$ curl 'http://localhost:8080/api/v2/users/me' -i -X GET \
    -H 'X-USER-ID: 1'

HTTP request

GET /api/v2/users/me HTTP/1.1
X-USER-ID: 1
Host: localhost:8080

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 239

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : {
    "email" : "test@example.com",
    "nickName" : "닉네임",
    "thumbnail" : "https://example.com/thumbnail.png",
    "providers" : [ "EMAIL", "GOOGLE" ]
  }
}

HTTPie request

$ http GET 'http://localhost:8080/api/v2/users/me' \
    'X-USER-ID:1'

Request body

Request headers

Name Description

x-user-id

로그인한 유저 id

Response body

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : {
    "email" : "test@example.com",
    "nickName" : "닉네임",
    "thumbnail" : "https://example.com/thumbnail.png",
    "providers" : [ "EMAIL", "GOOGLE" ]
  }
}

Response fields

Path Type Description

success

Boolean

성공 여부

code

String

결과 코드

message

String

메시지

data.email

String

이메일

data.nickName

String

닉네임

data.thumbnail

String

썸네일

data.providers

Array

연동 계정


회원 정보 수정 API

Curl request

$ curl 'http://localhost:8080/api/v2/users/me' -i -X PUT \
    -H 'Content-Type: application/json' \
    -H 'X-USER-ID: 1' \
    -d '{
  "nickName" : "수정된닉네임"
}'

HTTP request

PUT /api/v2/users/me HTTP/1.1
Content-Type: application/json
X-USER-ID: 1
Content-Length: 39
Host: localhost:8080

{
  "nickName" : "수정된닉네임"
}

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 79

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : true
}

HTTPie request

$ echo '{
  "nickName" : "수정된닉네임"
}' | http PUT 'http://localhost:8080/api/v2/users/me' \
    'Content-Type:application/json' \
    'X-USER-ID:1'

Request body

{
  "nickName" : "수정된닉네임"
}

Request fields

Path Type Description

nickName

String

닉네임

Request headers

Name Description

x-user-id

로그인한 유저 id

Response body

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : true
}

Response fields

Path Type Description

success

Boolean

성공 여부

code

String

결과 코드

message

String

메시지

data

Boolean

수정 성공 여부


회원 썸네일 이미지 수정 API

Curl request

$ curl 'http://localhost:8080/api/v2/users/me/thumbnail' -i -X PATCH \
    -H 'Content-Type: multipart/form-data' \
    -H 'X-USER-ID: 1' \
    -F 'thumbnail=@test.png;type=image/png'

HTTP request

PATCH /api/v2/users/me/thumbnail HTTP/1.1
Content-Type: multipart/form-data; boundary=6o2knFse3p53ty9dmcQvWAIx1zInP11uCfbm
X-USER-ID: 1
Host: localhost:8080

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 117

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : "http://localhost:8080/thumbnail/test.png"
}

HTTPie request

$ http --multipart PATCH 'http://localhost:8080/api/v2/users/me/thumbnail' \
    'X-USER-ID:1' \
    'thumbnail'@'test.png'

Request body

Request headers

Name Description

x-user-id

로그인한 유저 id

Request parts

Part Description

thumbnail

업로드할 이미지

Response body

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : "http://localhost:8080/thumbnail/test.png"
}

Response fields

Path Type Description

success

Boolean

성공 여부

code

String

결과 코드

message

String

메시지

data

String

변경된 썸네일 이미지 url


회원 탈퇴 API

Curl request

$ curl 'http://localhost:8080/api/v2/users/me' -i -X DELETE \
    -H 'X-USER-ID: 1'

HTTP request

DELETE /api/v2/users/me HTTP/1.1
X-USER-ID: 1
Host: localhost:8080

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 80

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : false
}

HTTPie request

$ http DELETE 'http://localhost:8080/api/v2/users/me' \
    'X-USER-ID:1'

Request body

Request headers

Name Description

x-user-id

로그인한 유저 id

Response body

{
  "success" : true,
  "code" : "SUCCESS",
  "message" : "",
  "data" : false
}

Response fields

Path Type Description

success

Boolean

성공 여부

code

String

결과 코드

message

String

메시지

data

Boolean

탈퇴 성공 여부


회원 정보 조회 API (내부용)

Curl request

$ curl 'http://localhost:8080/api/internal/v1/users/1' -i -X GET

HTTP request

GET /api/internal/v1/users/1 HTTP/1.1
Host: localhost:8080

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 226

{
  "userId" : 1,
  "uuid" : "2a100bfd-8278-46ec-8c4d-8c5b6b19d2e4",
  "email" : "test@example.com",
  "nickName" : "닉네임",
  "thumbnail" : "https://example.com/thumbnail/test.png",
  "providers" : [ "EMAIL", "GOOGLE" ]
}

HTTPie request

$ http GET 'http://localhost:8080/api/internal/v1/users/1'

Request body

Response body

{
  "userId" : 1,
  "uuid" : "2a100bfd-8278-46ec-8c4d-8c5b6b19d2e4",
  "email" : "test@example.com",
  "nickName" : "닉네임",
  "thumbnail" : "https://example.com/thumbnail/test.png",
  "providers" : [ "EMAIL", "GOOGLE" ]
}

Response fields

Path Type Description

userId

Number

유저 아이디

uuid

String

유저 UUID

email

String

이메일

nickName

String

닉네임

thumbnail

String

썸네일 이미지

providers

Array

연동 계정


회원 정보 목록 조회 API (내부용)

Curl request

$ curl 'http://localhost:8080/api/internal/v1/users?id=1&id=2' -i -X GET

HTTP request

GET /api/internal/v1/users?id=1&id=2 HTTP/1.1
Host: localhost:8080

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 318

[ {
  "userId" : 1,
  "uuid" : "29bcf191-33cd-4fa9-b58e-1b7401244df7",
  "nickName" : "닉네임1",
  "thumbnail" : "https://example.com/thumbnail/test.png"
}, {
  "userId" : 2,
  "uuid" : "bbc69b1c-24cc-4fc2-9ce3-e814cbf98bba",
  "nickName" : "닉네임2",
  "thumbnail" : "https://example.com/thumbnail/test.png"
} ]

HTTPie request

$ http GET 'http://localhost:8080/api/internal/v1/users?id=1&id=2'

Query parameters

Parameter Description

id

유저 아이디 목록

Request body

Response body

[ {
  "userId" : 1,
  "uuid" : "29bcf191-33cd-4fa9-b58e-1b7401244df7",
  "nickName" : "닉네임1",
  "thumbnail" : "https://example.com/thumbnail/test.png"
}, {
  "userId" : 2,
  "uuid" : "bbc69b1c-24cc-4fc2-9ce3-e814cbf98bba",
  "nickName" : "닉네임2",
  "thumbnail" : "https://example.com/thumbnail/test.png"
} ]

Response fields

Path Type Description

[].userId

Number

유저 아이디

[].uuid

String

유저 UUID

[].nickName

String

닉네임

[].thumbnail

String

썸네일 이미지

에러 응답

인증 실패

HTTP response

HTTP/1.1 401 Unauthorized
Content-Type: application/json
Content-Length: 115

{
  "success" : false,
  "code" : "REQUIRE_LOGIN",
  "message" : "로그인이 필요합니다.",
  "data" : null
}

로그인한 유저를 찾을 수 없음

HTTP response

HTTP/1.1 401 Unauthorized
Content-Type: application/json
Content-Length: 140

{
  "success" : false,
  "code" : "NOT_FOUND_LOGIN_USER",
  "message" : "로그인한 유저를 찾을 수 없습니다.",
  "data" : null
}

잘못된 요청

HTTP response

HTTP/1.1 400 Bad Request
Content-Type: application/json
Content-Length: 97

{
  "success" : false,
  "code" : "BAD_REQUEST",
  "message" : "<< message >>",
  "data" : null
}

알 수 없는 에러

HTTP response

HTTP/1.1 500 Internal Server Error
Content-Type: application/json
Content-Length: 133

{
  "success" : false,
  "code" : "UNKNOWN_ERROR",
  "message" : "알 수 없는 에러가 발생하였습니다.",
  "data" : null
}