개요

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

서버에 오류가 발생함

리소스

시험 관리

Question Service는 자격증 시험 문제 관리, 답안 제출, 북마크 기능을 제공합니다.

자격증 목록 조회

시스템에서 지원하는 자격증 목록을 조회합니다.

HTTP request

GET /exam HTTP/1.1
Content-Type: application/json;charset=UTF-8
Accept: application/json
Host: docs.api.com

HTTP response

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

[ {
  "certificationId" : 1,
  "certificationName" : "정보처리기사"
}, {
  "certificationId" : 2,
  "certificationName" : "컴활1급"
} ]

Response fields

Path Type Description

[].certificationId

Number

자격증 ID

[].certificationName

String

자격증 이름

자격증 연도/회차 정보 조회

특정 자격증의 연도별 회차 정보를 조회합니다.

Path parameters

Table 1. /exam/certification/{certificationId}/year-session
Parameter Description

certificationId

자격증 ID

HTTP request

GET /exam/certification/1/year-session HTTP/1.1
Content-Type: application/json;charset=UTF-8
Accept: application/json
Host: docs.api.com

HTTP response

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

[ {
  "year" : 2023,
  "session" : 1
}, {
  "year" : 2023,
  "session" : 2
} ]

Response fields

Path Type Description

[].year

Number

시험 연도

[].session

Number

시험 회차

자격증별 과목 목록 조회

특정 자격증의 과목 목록을 조회합니다.

Path parameters

Table 1. /exam/certification/{certificationId}
Parameter Description

certificationId

자격증 ID

HTTP request

GET /exam/certification/1 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Accept: application/json
Host: docs.api.com

HTTP response

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

[ {
  "subjectId" : 1,
  "subjectName" : "소프트웨어 설계"
}, {
  "subjectId" : 2,
  "subjectName" : "프로그래밍 언어 활용"
} ]

Response fields

Path Type Description

[].subjectId

Number

과목 ID

[].subjectName

String

과목 이름

문제 조회

과목별 단일 문제 조회

과목별로 특정 문제를 조회합니다 (Deprecated).

Path parameters
Table 1. /exam/subject/{subjectId}/question
Parameter Description

subjectId

과목 ID

Query parameters
Parameter Description

questionId

문제 ID (기본값: 0)

HTTP request
GET /exam/subject/1/question?questionId=1 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Accept: application/json
Host: docs.api.com
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 98

{
  "questionId" : 1,
  "content" : "문제 내용",
  "answer" : "4",
  "explantion" : "해설"
}
Response fields
Path Type Description

questionId

Number

문제 ID

content

String

문제 내용

answer

String

정답

explantion

String

문제 해설

과목별 랜덤 문제 조회

공부 모드에서 사용할 과목별 랜덤 문제를 조회합니다.

Path parameters
Table 1. /exam/subject/{subjectId}/random
Parameter Description

subjectId

과목 ID

HTTP request
GET /exam/subject/1/random HTTP/1.1
Content-Type: application/json;charset=UTF-8
Accept: application/json
Host: docs.api.com
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 102

[ {
  "questionId" : 1,
  "content" : "문제 내용",
  "answer" : "4",
  "explantion" : "해설"
} ]
Response fields
Path Type Description

[].questionId

Number

문제 ID

[].content

String

문제 내용

[].answer

String

정답

[].explantion

String

문제 해설

과목별 기출 문제 조회

시험 모드에서 사용할 과목별 연도/회차 기출 문제를 조회합니다.

Path parameters
Table 1. /exam/subject/{subjectId}/year/{year}/session/{session}
Parameter Description

subjectId

과목 ID

year

시험 연도

session

시험 회차

HTTP request
GET /exam/subject/1/year/2023/session/1 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Accept: application/json
Host: docs.api.com
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 102

[ {
  "questionId" : 1,
  "content" : "문제 내용",
  "answer" : "4",
  "explantion" : "해설"
} ]
Response fields
Path Type Description

[].questionId

Number

문제 ID

[].content

String

문제 내용

[].answer

String

정답

[].explantion

String

문제 해설

틀린 문제 조회

사용자가 틀린 문제 목록을 조회합니다 (퀵 모드).

Request headers
Name Description

Authorization

JWT 인증 토큰

Query parameters
Parameter Description

status

문제 상태 (WRONG, CORRECT 등)

HTTP request
GET /exam/wrong-questions?status=WRONG HTTP/1.1
Authorization: Bearer jwt-token-here
Content-Type: application/json;charset=UTF-8
Accept: application/json
Host: docs.api.com
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 102

[ {
  "questionId" : 1,
  "content" : "문제 내용",
  "answer" : "4",
  "explantion" : "해설"
} ]
Response fields
Path Type Description

[].questionId

Number

문제 ID

[].content

String

문제 내용

[].answer

String

정답

[].explantion

String

문제 해설

답안 제출

일반 모드 답안 제출

공부 모드에서 단일 문제의 답안을 제출합니다.

Request headers
Name Description

Authorization

JWT 인증 토큰

Request fields
Path Type Description

questionId

Number

문제 ID

status

String

문제 상태 (CORRECT, WRONG 등)

HTTP request
POST /exam/submit/normal HTTP/1.1
Authorization: Bearer jwt-token-here
Content-Type: application/json;charset=UTF-8
Accept: application/json
Content-Length: 46
Host: docs.api.com

{
  "questionId" : 1,
  "status" : "CORRECT"
}
HTTP response
HTTP/1.1 200 OK

시험 모드 답안 제출

시험 모드에서 여러 문제의 답안을 일괄 제출합니다.

Request headers
Name Description

Authorization

JWT 인증 토큰

Request fields
Path Type Description

[].questionId

Number

문제 ID

[].answer

String

정답

[].userAnswer

String

사용자 답안

HTTP request
POST /exam/submit/test HTTP/1.1
Authorization: Bearer jwt-token-here
Content-Type: application/json;charset=UTF-8
Accept: application/json
Content-Length: 130
Host: docs.api.com

[ {
  "questionId" : 1,
  "answer" : "4",
  "userAnswer" : "4"
}, {
  "questionId" : 2,
  "answer" : "2",
  "userAnswer" : "3"
} ]
HTTP response
HTTP/1.1 200 OK

북마크 관리

북마크 생성

문제를 북마크에 추가합니다.

Request headers
Name Description

Authorization

JWT 인증 토큰

Query parameters
Parameter Description

questionId

문제 ID

HTTP request
POST /exam/book-mark?questionId=1 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Accept: application/json
Authorization: Bearer jwt-token-here
Host: docs.api.com
HTTP response
HTTP/1.1 200 OK

북마크 삭제

문제를 북마크에서 제거합니다.

Request headers
Name Description

Authorization

JWT 인증 토큰

Query parameters
Parameter Description

questionId

문제 번호

HTTP request
DELETE /exam/book-mark?questionId=1 HTTP/1.1
Authorization: Bearer jwt-token-here
Content-Type: application/json;charset=UTF-8
Accept: application/json
Host: docs.api.com
HTTP response
HTTP/1.1 200 OK

북마크된 문제 조회

사용자가 북마크한 문제 목록을 조회합니다.

Request headers
Name Description

Authorization

JWT 인증 토큰

Query parameters
Parameter Description

certificationId

자격증ID

HTTP request
GET /exam/book-mark/question?certificationId=1 HTTP/1.1
Authorization: Bearer jwt-token-here
Content-Type: application/json;charset=UTF-8
Accept: application/json
Host: docs.api.com
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 102

[ {
  "questionId" : 1,
  "content" : "문제 내용",
  "answer" : "4",
  "explantion" : "해설"
} ]
Response fields
Path Type Description

[].questionId

Number

문제 ID

[].content

String

문제 내용

[].answer

String

정답

[].explantion

String

문제 해설

북마크된 문제 번호 조회

사용자가 북마크한 문제 번호 목록을 조회합니다.

Request headers
Name Description

Authorization

JWT 인증 토큰

HTTP request
GET /exam/book-mark HTTP/1.1
Content-Type: application/json;charset=UTF-8
Accept: application/json
Authorization: Bearer jwt-token-here
Host: docs.api.com
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 26

[ {
  "questionId" : 1
} ]
Response fields
Path Type Description

[].questionId

Number

문제 ID