REST API Reference

REST API 사용에 필요한 공통 규칙, 응답 모델, 엔드포인트별 예제를 제공합니다.

1. Overview

1.1. 공통 헤더 정보

Header Description Mandatory Example

Authorization

인증 토큰

N

Bearer 4B561A51-7773-4CA4-8E67-851EF4E85145

Request-Id

요청 식별 ID

N

c64af254-d067-475c-b4ce-15a6f0a73f99

1.2. API 응답 모델

1.2.1. Success

Path Type Mandatory Description

ok

Boolean

Y

성공(true), 실패(false)

result

Object

N

API 결과

Success Example
HTTP/1.1 200 OK
Content-Type: application/json

{
  "ok": true,
  "result": {
    "key": "value"
  }
}

1.2.2. Error

Path Type Mandatory Description

ok

Boolean

Y

성공(true), 실패(false)

error

Object

Y

에러 정보

error.code

String

Y

에러 코드 (에러 코드 문서 참고)

error.details

Array<Object>

N

에러 상세 목록 (디버그용)

error.details[].field

String

Y

필드명

error.details[].reason

String

Y

에러 설명

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

{
  "ok": false,
  "error": {
    "code": "internal_error"
  }
}
Invalid Arguments
HTTP/1.1 400 Bad Request
Content-Type: application/json

{
  "ok": false,
  "error": {
    "code": "invalid_arguments",
    "details": [
      {
        "field": "title",
        "reason": "Title must not be blank"
      },
      {
        "field": "content",
        "reason": "Content size must be between 0 and 500"
      }
    ]
  }
}

1.3. 공통 에러 코드

모든 API에서 공통적으로 발생할 수 있는 에러 목록입니다.
각 API별로 발생할 수 있는 에러 정보는 각 API의 에러 코드 문서를 참고해주세요.

Status Code Error Code Description

400

invalid_arguments

필수 파라미터가 없거나, 파라미터가 유효하지 않는 경우

405

method_not_allowed

허용하지 않는 HTTP Method인 경우

500

internal_error

서버 내부적으로 문제 발생 시

503

service_unavailable

현재 서비스를 이용할 수 없는 경우

2. APIs

2.1. Health

서버 헬스 체크 상태를 확인하는 API입니다.

2.1.1. Readiness Health Check

GET /api/health/readiness

Response Fields
Path Type Mandatory Description Etc

ok

Boolean

true

API 처리 성공 여부

Examples
HTTP Request
GET /api/health/readiness HTTP/1.1
Host: localhost:8000
HTTP Response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 11

{"ok":true}
Curl
$ curl 'http://localhost:8000/api/health/readiness' -i -X GET
Error Codes

공통 에러 코드는 공통 에러 코드를 참고해 주세요.

HTTP Status Code 설명

503

service_unavailable

서비스 상태가 아닌 경우 발생합니다