1. 회원

1.1. 회원가입

1.1.1. 성공

HTTP request
POST /api/v1/member HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 63
Host: localhost:8080

{
  "username" : "Hong-Gildong",
  "password" : "password"
}
HTTP response
HTTP/1.1 201 Created
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Location: http://localhost:8080/api/v1/member/1
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 362

{
  "msg" : "회원 가입이 완료되었습니다.",
  "id" : 1,
  "username" : "Hong-Gildong",
  "password" : "password",
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/v1/member",
      "type" : "POST"
    },
    "login" : {
      "href" : "http://localhost:8080/api/v1/member/login",
      "type" : "POST"
    }
  }
}
Request fields
Request Fields
필드명 타입 설명

username

String

회원가입을 위한 회원 ID

password

String

회원가입을 위한 회원 Password

Response fields
Response Fields
필드명 타입 설명

msg

String

응답 메시지

id

Number

회원가입이 완료된 회원 ID

username

String

회원가입이 완료된 회원 username

password

String

회원가입이 완료된 회원 Encoding Password

_links

Object

Hyper Links

_links.self

Object

Hyper Link 이름

_links.self.href

String

Self Hyper Link

_links.self.type

String

Self Hyper Link Type

_links.login

Object

Hyper Link 이름

_links.login.href

String

Login Hyper Link

_links.login.type

String

Login Hyper Link Type

1.1.2. 실패

중복된 회원의 username일 경우
HTTP request
POST /api/v1/member HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 63
Host: localhost:8080

{
  "username" : "Hong-Gildong",
  "password" : "password"
}
HTTP response
HTTP/1.1 409 Conflict
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json;charset=UTF-8
Content-Length: 165

{
  "timeStamp" : "2023-10-16T07:23:09.776+00:00",
  "httpStatus" : "CONFLICT",
  "errorCode" : 409,
  "msg" : "Hong-Gildong회원님은 이미 있습니다."
}
Response fields
Response Fields
필드명 타입 설명

timeStamp

String

API 요청 시간

httpStatus

String

HTTP 상태 메시지

errorCode

Number

HTTP 에러 코드

msg

String

응답 메시지

1.2. 로그인

1.2.1. 성공

HTTP request
POST /api/v1/member/login HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 63
Host: localhost:8080

{
  "username" : "Hong-Gildong",
  "password" : "password"
}
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 136

{
  "msg" : "로그인이 완료되었습니다.",
  "accessToken" : "eyJhbGciOiJIUzI1NiJ9.eyJ1c2VybmNhQ5uHZELuMKK_1O_Wcd9lx0aggkg"
}
Request fields
Request Fields
필드명 타입 설명

username

String

로그인을 위한 회원 ID

password

String

로그인을 위한 회원 Password

Response fields
Response Fields
필드명 타입 설명

msg

String

응답 메시지

accessToken

String

회원의 AccessToken

1.2.2. 실패

password가 회원가입 정보와 맞지 않을경우
HTTP request
POST /api/v1/member/login HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 63
Host: localhost:8080

{
  "username" : "Hong-Gildong",
  "password" : "password"
}
HTTP response
HTTP/1.1 401 Unauthorized
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json;charset=UTF-8
Content-Length: 166

{
  "timeStamp" : "2023-10-16T07:23:09.698+00:00",
  "httpStatus" : "UNAUTHORIZED",
  "errorCode" : 401,
  "msg" : "패스워드를 잘못 입력했습니다."
}
Response fields
Response Fields
필드명 타입 설명

timeStamp

String

API 요청 시간

httpStatus

String

HTTP 상태 메시지

errorCode

Number

HTTP 에러 코드

msg

String

응답 메시지

회원가입을한 username이 아닐 경우
HTTP request
POST /api/v1/member/login HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 63
Host: localhost:8080

{
  "username" : "Hong-Gildong",
  "password" : "password"
}
HTTP response
HTTP/1.1 400 Bad Request
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json;charset=UTF-8
Content-Length: 163

{
  "timeStamp" : "2023-10-16T07:23:09.674+00:00",
  "httpStatus" : "BAD_REQUEST",
  "errorCode" : 400,
  "msg" : "Hong-Gildong회원이(가) 없습니다."
}
Response fields
Response Fields
필드명 타입 설명

timeStamp

String

API 요청 시간

httpStatus

String

HTTP 상태 메시지

errorCode

Number

HTTP 에러 코드

msg

String

응답 메시지

1.3. 회원조회(ID)

1.3.1. 성공

HTTP request
GET /api/v1/member/1 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 63
Host: localhost:8080

{
  "username" : "Hong-Gildong",
  "password" : "password"
}
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 269

{
  "msg" : "검색한 회원의 정보는 다음과 같습니다.",
  "id" : 1,
  "username" : "Hong-Gildong",
  "memberMyWordList" : [ ],
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/v1/member/1",
      "type" : "GET"
    }
  }
}
Request fields
Request Fields
필드명 타입 설명

username

String

회원가입을 위한 회원 ID

password

String

회원가입을 위한 회원 Password

Response fields
Response Fields
필드명 타입 설명

msg

String

응답 메시지

id

Number

검색한 회원의 ID

username

String

검색한 회원의 username

memberMyWordList

Array

회원이 저장한 단어의 정보

_links

Object

Hyper Links

_links.self

Object

Hyper Link 이름

_links.self.href

String

Self Hyper Link

_links.self.type

String

Self Hyper Link Type

2. 단어사전

2.1. 한국어대사전 기반 검색

2.1.1. 성공

HTTP request
GET /api/v1/dictionary/word?q=%EC%82%AC%EB%9E%91 HTTP/1.1
Host: localhost:8080
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 734

{
  "msg" : "표준 한국어 대사전 Open API를 통해 단어 하늘의 검색결과는 다음과 같습니다.",
  "datum" : [ {
    "targetCode" : 20311,
    "word" : "하늘",
    "pronunciation" : "하늘",
    "pos" : "명사",
    "wordSenceList" : [ {
      "senseOrder" : 1,
      "definition" : "땅 위로 펼쳐진 무한히 넓은 공간."
    }, {
      "senseOrder" : 2,
      "definition" : "절대적인 존재, 하느님."
    } ]
  } ],
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/v1/dictionary/word?q=%EC%82%AC%EB%9E%91",
      "type" : "GET"
    },
    "add-myWord" : {
      "href" : "http://localhost:8080/api/v1/myWord",
      "type" : "POST"
    }
  }
}
Request parameters
Parameter Description

q

찾고자 하는 단어

Response fields
Response Fields
필드명 타입 설명

msg

String

응답 메시지

datum

Array

한국어 대사전으로 찾은 동음 이의어들의 집합

datum[].targetCode

Number

찾고자 하는 단어의 한국어 대사전 TargetCode

datum[].word

String

찾고자 하는 단어

datum[].pronunciation

String

찾고자 하는 단어의 발음

datum[].pos

String

찾고자 하는 단어의 품사

datum[].wordSenceList[]

Array

해당 단어의 뜻

datum[].wordSenceList[].senseOrder

Number

해당 단어의 뜻 순서

datum[].wordSenceList[].definition

String

해당 단어의 뜻

_links

Object

Hyper Links

_links.self

Object

Hyper Link 이름

_links.self.href

String

Self Hyper Link

_links.self.type

String

Self Hyper Link Type

_links.add-myWord

Object

Hyper Link 이름

_links.add-myWord.href

String

Add-MyWord Hyper Link

_links.add-myWord.type

String

Add-MyWord Hyper Link Type

2.1.2. 실패

파라미터가 누락 되었을 경우

operation::Dictionary-word-5xxsnippets='http-request,http-response,response-fields']

3. 나만의 단어장

3.1. 나만의 단어장에 추가

3.1.1. 성공

HTTP request
POST /api/v1/myWord HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1c2VybmNhQ5uHZELuMKK_1O_Wcd9lx0aggkg
Content-Length: 73
Host: localhost:8080

{
  "name" : "단어",
  "morpheme" : "품사",
  "mean" : "의미"
}
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 548

{
  "msg" : "단어이름 단어 추가가 성공하였습니다.",
  "data" : {
    "wordId" : 1,
    "name" : "단어",
    "morpheme" : "품사",
    "mean" : "의미"
  },
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/v1/myWord",
      "type" : "POST"
    },
    "delete-myWord" : {
      "href" : "http://localhost:8080/api/v1/myWord/1",
      "type" : "DELETE"
    },
    "search-myWord" : {
      "href" : "http://localhost:8080/api/v1/myWord?page=0&count=10",
      "type" : "GET"
    }
  }
}
Request headers
Name Description

Authorization

JWT Access 토큰

Request fields
Request Fields
필드명 타입 설명

name

String

저장을 요청한 단어

morpheme

String

저장을 요청한 단어의 품사

mean

String

저장을 요청한 단어의 의미

Response fields
Response Fields
필드명 타입 설명

msg

String

응답 메시지

data

Object

저장을 요청한 단어의 정보

data.wordId

Number

저장을 요청한 단어의 ID

data.name

String

저장을 요청한 단어

data.morpheme

String

저장을 요청한 단어의 품사

data.mean

String

저장을 요청한 단어의 의미

_links

Object

Hyper Links

_links.self

Object

Hyper Link 이름

_links.self.href

String

Self Hyper Link

_links.self.type

String

Self Hyper Link Type

_links.delete-myWord

Object

Hyper Link 이름

_links.delete-myWord.href

String

Delete-MyWord Hyper Link

_links.delete-myWord.type

String

Delete-MyWord Hyper Link Type

_links.search-myWord

Object

Hyper Link 이름

_links.search-myWord.href

String

Search-MyWord Hyper Link

_links.search-myWord.type

String

Search-MyWord Hyper Link Type

3.1.2. 실패

한 회원이 중복된 단어를 저장했을 경우
HTTP request
POST /api/v1/myWord HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1c2VybmNhQ5uHZELuMKK_1O_Wcd9lx0aggkg
Content-Length: 73
Host: localhost:8080

{
  "name" : "단어",
  "morpheme" : "품사",
  "mean" : "의미"
}
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 564

{
  "msg" : " 단어 추가가 실패하였습니다.(이미 단어장에 존재)",
  "data" : {
    "wordId" : 1,
    "name" : "단어",
    "morpheme" : "품사",
    "mean" : "의미"
  },
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/v1/myWord",
      "type" : "POST"
    },
    "delete-myWord" : {
      "href" : "http://localhost:8080/api/v1/myWord/1",
      "type" : "DELETE"
    },
    "search-myWord" : {
      "href" : "http://localhost:8080/api/v1/myWord?page=0&count=10",
      "type" : "GET"
    }
  }
}
Response fields
Response Fields
필드명 타입 설명

msg

String

응답 메시지

data

Object

저장을 요청한 단어의 정보

data.wordId

Number

저장을 요청한 단어의 ID

data.name

String

저장을 요청한 단어

data.morpheme

String

저장을 요청한 단어의 품사

data.mean

String

저장을 요청한 단어의 의미

_links

Object

Hyper Links

_links.self

Object

Hyper Link 이름

_links.self.href

String

Self Hyper Link

_links.self.type

String

Self Hyper Link Type

_links.delete-myWord

Object

Hyper Link 이름

_links.delete-myWord.href

String

Delete-MyWord Hyper Link

_links.delete-myWord.type

String

Delete-MyWord Hyper Link Type

_links.search-myWord

Object

Hyper Link 이름

_links.search-myWord.href

String

Search-MyWord Hyper Link

_links.search-myWord.type

String

Search-MyWord Hyper Link Type

Header에 AccessToken을 넣지 않았을 경우
HTTP request
POST /api/v1/myWord HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 73
Host: localhost:8080

{
  "name" : "단어",
  "morpheme" : "품사",
  "mean" : "의미"
}
HTTP response
HTTP/1.1 400 Bad Request
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json;charset=UTF-8
Content-Length: 170

{
  "timeStamp" : "2023-10-16T07:23:09.919+00:00",
  "httpStatus" : "BAD_REQUEST",
  "errorCode" : 400,
  "msg" : "올바른 요청 Header 형식이 아닙니다."
}
Response fields
Response Fields
필드명 타입 설명

timeStamp

String

API 요청 시간

httpStatus

String

HTTP 상태 메시지

errorCode

Number

HTTP 에러 코드

msg

String

응답 메시지

3.2. 나만의 단어장에서 삭제

3.2.1. 성공

HTTP request
DELETE /api/v1/myWord/1 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1c2VybmNhQ5uHZELuMKK_1O_Wcd9lx0aggkg
Host: localhost:8080
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 432

{
  "msg" : "1번의 단어 삭제를 성공하였습니다.",
  "data" : {
    "wordId" : 1,
    "name" : "단어",
    "morpheme" : "품사",
    "mean" : "의미"
  },
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/v1/myWord/1",
      "type" : "DELETE"
    },
    "search-myWord" : {
      "href" : "http://localhost:8080/api/v1/myWord?page=0&count=10",
      "type" : "GET"
    }
  }
}
Request headers
Name Description

Authorization

JWT Access 토큰

Response fields
Response Fields
필드명 타입 설명

msg

String

응답 메시지

data

Object

삭제를 요청한 단어의 정보

data.wordId

Number

삭제를 요청한 단어의 ID

data.name

String

삭제를 요청한 단어

data.morpheme

String

삭제를 요청한 단어의 품사

_links

Object

Hyper Links

_links.self

Object

Hyper Link 이름

_links.self.href

String

Self Hyper Link

_links.self.type

String

Self Hyper Link Type

_links.search-myWord

Object

Hyper Link 이름

_links.search-myWord.href

String

Search-MyWord Hyper Link

_links.search-myWord.type

String

Search-MyWord Hyper Link Type

3.2.2. 실패

삭제를 요청하는 단어의 ID가 단어장에 없을 경우
HTTP request

Snippet http-request not found for operation::MyWord-delete-fail

HTTP response

Snippet http-response not found for operation::MyWord-delete-fail

Response fields

Snippet response-fields not found for operation::MyWord-delete-fail

3.3. 나만의 단어장에서 검색

3.3.1. 성공

HTTP request
GET /api/v1/myWord?page=0&count=10 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1c2VybmNhQ5uHZELuMKK_1O_Wcd9lx0aggkg
Content-Length: 41
Host: localhost:8080

{
  "name" : "2",
  "morpheme" : "2"
}
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 670

{
  "msg" : "나만의 단어 검색 결과는 다음과 같습니다.",
  "datum" : {
    "content" : [ {
      "wordId" : 1,
      "name" : "단어",
      "morpheme" : "품사",
      "mean" : "의미"
    } ],
    "pageable" : "INSTANCE",
    "totalElements" : 1,
    "last" : true,
    "totalPages" : 1,
    "size" : 1,
    "number" : 0,
    "sort" : {
      "empty" : true,
      "sorted" : false,
      "unsorted" : true
    },
    "first" : true,
    "numberOfElements" : 1,
    "empty" : false
  },
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/v1/myWord?page=0&count=10",
      "type" : "GET"
    }
  }
}
Request headers
Name Description

Authorization

JWT Access 토큰

Request parameters
Parameter Description

page

0부터 시작하는 페이지 index

count

페이지당 데이터의 수

Request fields
Request Fields
필드명 타입 설명

name

String

검색을 요청한 단어

morpheme

String

검색 요청한 단어의 품사

Response fields
Response Fields
필드명 타입 설명

msg

String

응답 메시지

datum

Object

조회 결과 데이터

datum.content

Array

조회된 단어 리스트

datum.content[].wordId

Number

검색된 단어의 ID

datum.content[].name

String

검색된 단어의 이름

datum.content[].morpheme

String

검색된 단어의 형태소

datum.content[].mean

String

검색된 단어의 의미

_links

Object

Hyper Links

_links.self

Object

Hyper Link 이름

_links.self.href

String

Self Hyper Link

_links.self.type

String

Self Hyper Link Type

4. 퀴즈

4.1. 퀴즈 목록 생성

4.1.1. 성공

HTTP request
GET /api/v1/quiz HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: localhost:8080
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 1623

{
  "msg" : "나만의 단어장을 기반으로 생성된 퀴즈입니다.",
  "datum" : [ {
    "question" : "의미4",
    "answerIndex" : 1,
    "choices" : [ "단어4", "단어5", "단어6", "단어7" ]
  }, {
    "question" : "의미8",
    "answerIndex" : 1,
    "choices" : [ "단어8", "단어9", "단어10", "단어11" ]
  }, {
    "question" : "의미12",
    "answerIndex" : 1,
    "choices" : [ "단어12", "단어13", "단어14", "단어15" ]
  }, {
    "question" : "의미16",
    "answerIndex" : 1,
    "choices" : [ "단어16", "단어17", "단어18", "단어19" ]
  }, {
    "question" : "의미20",
    "answerIndex" : 1,
    "choices" : [ "단어20", "단어21", "단어22", "단어23" ]
  }, {
    "question" : "의미24",
    "answerIndex" : 1,
    "choices" : [ "단어24", "단어25", "단어26", "단어27" ]
  }, {
    "question" : "의미28",
    "answerIndex" : 1,
    "choices" : [ "단어28", "단어29", "단어30", "단어31" ]
  }, {
    "question" : "의미32",
    "answerIndex" : 1,
    "choices" : [ "단어32", "단어33", "단어34", "단어35" ]
  }, {
    "question" : "의미36",
    "answerIndex" : 1,
    "choices" : [ "단어36", "단어37", "단어38", "단어39" ]
  }, {
    "question" : "의미40",
    "answerIndex" : 1,
    "choices" : [ "단어40", "단어41", "단어42", "단어43" ]
  } ],
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/v1/quiz",
      "type" : "GET"
    },
    "apply-quiz-result" : {
      "href" : "http://localhost:8080/api/v1/quiz",
      "type" : "PATCH"
    }
  }
}
Response fields
Response Fields
필드명 타입 설명

msg

String

응답 메시지

datum

Array

10개의 4지선다 단어 퀴즈

datum[].question

String

퀴즈 문제

datum[].answerIndex

Number

퀴즈의 정답 Index (1~4)

datum[].choices[]

Array

퀴즈의 선택지

_links

Object

Hyper Links

_links.self

Object

Hyper Link 이름

_links.self.href

String

Self Hyper Link

_links.self.type

String

Self Hyper Link Type

_links.apply-quiz-result

Object

Hyper Link 이름

_links.apply-quiz-result.href

String

Apply-Quiz-Result Hyper Link

_links.apply-quiz-result.type

String

Apply-Quiz-Result Hyper Link Type

4.1.2. 실패

퀴즈를 만들기에 충분한 나만의 단어가 DB에 없을경우 (최소 40개)
HTTP request
GET /api/v1/quiz HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: localhost:8080
HTTP response
HTTP/1.1 500 Internal Server Error
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json;charset=UTF-8
Content-Length: 189

{
  "timeStamp" : "2023-10-16T07:23:10.008+00:00",
  "httpStatus" : "INTERNAL_SERVER_ERROR",
  "errorCode" : 500,
  "msg" : "퀴즈를 만들기에 충분한 단어가 없습니다."
}
Response fields
Response Fields
필드명 타입 설명

timeStamp

String

API 요청 시간

httpStatus

String

HTTP 상태 메시지

errorCode

Number

HTTP 에러 코드

msg

String

응답 메시지

4.2. 퀴즈 결과 반영

4.2.1. 성공

HTTP request
PATCH /api/v1/quiz HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1c2VybmNhQ5uHZELuMKK_1O_Wcd9lx0aggkg
Content-Length: 19
Host: localhost:8080

{
  "score" : 5
}
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 332

{
  "msg" : "퀴즈 결과가 반영되었습니다.",
  "ranking" : 1,
  "score" : 5,
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/v1/quiz",
      "type" : "PATCH"
    },
    "get-quiz-ranking" : {
      "href" : "http://localhost:8080/api/v1/quiz/ranking",
      "type" : "GET"
    }
  }
}
Request headers
Name Description

Authorization

JWT Access 토큰

Request fields
Request Fields
필드명 타입 설명

score

Number

퀴즈 결과 점수

Response fields
Response Fields
필드명 타입 설명

msg

String

응답 메시지

ranking

Number

점수가 적용된 회원의 랭킹

score

Number

회원의 최종 점수

_links

Object

Hyper Links

_links.self

Object

Hyper Link 이름

_links.self.href

String

Self Hyper Link

_links.self.type

String

Self Hyper Link Type

_links.get-quiz-ranking

Object

Hyper Link 이름

_links.get-quiz-ranking.href

String

Get-Quiz-Ranking Hyper Link

_links.get-quiz-ranking.type

String

Get-Quiz-Ranking Hyper Link Type

4.2.2. 실패

body의 형식이 문자형일 경우
HTTP request
PATCH /api/v1/quiz HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1c2VybmNhQ5uHZELuMKK_1O_Wcd9lx0aggkg
Content-Length: 23
Host: localhost:8080

{
  "score" : "asd"
}
HTTP response
HTTP/1.1 500 Internal Server Error
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json;charset=UTF-8
Content-Length: 175

{
  "timeStamp" : "2023-10-16T07:23:10.075+00:00",
  "httpStatus" : "INTERNAL_SERVER_ERROR",
  "errorCode" : 500,
  "msg" : "서버에서 에러가 발생했습니다."
}
Response fields
Response Fields
필드명 타입 설명

timeStamp

String

API 요청 시간

httpStatus

String

HTTP 상태 메시지

errorCode

Number

HTTP 에러 코드

msg

String

응답 메시지

5. 랭킹

5.1. 퀴즈 랭킹 출력 (비회원)

5.1.1. 성공

HTTP request
GET /api/v1/quiz/ranking/nonMember HTTP/1.1
Content-Type: application/json;charset=UTF-8
Host: localhost:8080
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 526

{
  "msg" : "퀴즈 랭킹 결과입니다.",
  "topMemberRanking" : [ {
    "ranking" : 1,
    "username" : "1번 사람",
    "score" : 9
  }, {
    "ranking" : 2,
    "username" : "2번 사람",
    "score" : 8
  }, {
    "ranking" : 3,
    "username" : "3번 사람",
    "score" : 7
  }, {
    "ranking" : 4,
    "username" : "4번 사람",
    "score" : 6
  } ],
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/v1/quiz/ranking/nonMember",
      "type" : "GET"
    }
  }
}
Response fields
Response Fields
필드명 타입 설명

msg

String

응답 메시지

topMemberRanking

Array

퀴즈 점수 상위 랭커 10명의 정보 (같은 점수라면 가입 순으로 정렬)

topMemberRanking[].ranking

Number

랭커의 순위

topMemberRanking[].username

String

랭커의 이름

topMemberRanking[].score

Number

랭커의 점수

_links

Object

Hyper Links

_links.self

Object

Hyper Link 이름

_links.self.href

String

Self Hyper Link

_links.self.type

String

Self Hyper Link Type

5.2. 퀴즈 랭킹 출력 (회원)

5.2.1. 성공

HTTP request
GET /api/v1/quiz/ranking HTTP/1.1
Content-Type: application/json;charset=UTF-8
Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1c2VybmNhQ5uHZELuMKK_1O_Wcd9lx0aggkg
Host: localhost:8080
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/hal+json;charset=UTF-8
Content-Length: 589

{
  "msg" : "퀴즈 랭킹 결과입니다.",
  "userRanking" : 1,
  "username" : "1번 사람",
  "userScore" : 9,
  "topMemberRanking" : [ {
    "ranking" : 1,
    "username" : "1번 사람",
    "score" : 9
  }, {
    "ranking" : 2,
    "username" : "2번 사람",
    "score" : 8
  }, {
    "ranking" : 3,
    "username" : "3번 사람",
    "score" : 7
  }, {
    "ranking" : 4,
    "username" : "4번 사람",
    "score" : 6
  } ],
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/v1/quiz/ranking",
      "type" : "GET"
    }
  }
}
Request headers
Name Description

Authorization

JWT Access 토큰

Response fields
Response Fields
필드명 타입 설명

msg

String

응답 메시지

userRanking

Number

로그인한 회원의 랭킹

username

String

로그인한 회원의 이름

userScore

Number

로그인한 회원의 점수

topMemberRanking

Array

퀴즈 점수 상위 랭커 10명의 정보 (같은 점수라면 가입 순으로 정렬)

topMemberRanking[].ranking

Number

랭커의 순위

topMemberRanking[].username

String

랭커의 이름

topMemberRanking[].score

Number

랭커의 점수

_links

Object

Hyper Links

_links.self

Object

Hyper Link 이름

_links.self.href

String

Self Hyper Link

_links.self.type

String

Self Hyper Link Type

6. 오늘의 단어

6.1. 오늘의 단어 출력

6.1.1. 성공

HTTP request
GET /api/v1/todayWord HTTP/1.1
Content-Type: application/json;charset=UTF-8
Accept: application/json
Host: localhost:8080
HTTP response
HTTP/1.1 200 OK
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Content-Type: application/json;charset=UTF-8
Content-Length: 497

{
  "msg" : "오늘의 단어 목록입니다.",
  "datum" : [ {
    "name" : "1번 단어",
    "morpheme" : "1번 품사",
    "mean" : "1번 의미"
  }, {
    "name" : "2번 단어",
    "morpheme" : "2번 품사",
    "mean" : "2번 의미"
  } ],
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/v1/todayWord",
      "type" : "GET"
    },
    "add-myWord" : {
      "href" : "http://localhost:8080/api/v1/myWord",
      "type" : "POST"
    }
  }
}
Response fields
Response Fields
필드명 타입 설명

msg

String

응답 메시지

datum

Array

나만의 단어장을 기반으로 생성된 오늘의 단어 (24시, 자정 초기화)

datum[].name

String

오늘의 단어

datum[].morpheme

String

오늘의 단어 품사

datum[].mean

String

오늘의 단어 의미

_links

Object

Hyper Links

_links.self

Object

Hyper Link 이름

_links.self.href

String

Self Hyper Link

_links.self.type

String

Self Hyper Link Type

_links.add-myWord

Object

Hyper Link 이름

_links.add-myWord.href

String

Add-MyWord Hyper Link

_links.add-myWord.type

String

Add-MyWord Hyper Link Type