Skip to content
홍석현 edited this page Mar 25, 2023 · 2 revisions

InterVook API

Auth

  • 회원가입

    • URL: POST /api/auth/join
    • Header: Content-Type: application/x-www-form-urlencoded
    • param: email=이메일@이메일.com&password=비밀번호&nickname=닉네임
  • 로그인

    • URL: POST /api/auth/login
    • Header: None
    • Param: email=이메일@이메일.com&password=비밀번호
  • 로그아웃

    • URL: POST /api/auth/logout
    • Header: None
    • Param: None
  • 소셜 로그인

    • URL: POST /api/auth/social/{kakao|naver}
    • Header: None
    • Param: None

User

  • 내 정보

    • URL: GET /api/user
    • Header: None
    • Param: None
    • Cookie: access-token 필요
  • 닉네임 중복 체크

    • URL: GET /api/user/nickname
    • Header: Content-Type: application/x-www-form-urlencoded
    • Param: nickname=닉네임

Post (게시글)

❗️ 존재하지 않는 게시글의 ID를 넣는 경우 ITEM_NOT_FOUND 에러가 발생합니다.

  • 게시글 목록

    • URL: GET /api/post
    • Header: Content-Type: application/x-www-form-urlencoded
    • Param: page=1
      • page: 1 이상 자연수
  • 게시글 상세 보기

    • URL: GET /api/post/{postId}
    • Header: None
    • Path Variable: postId
      • postId: 게시글의 고유 ID
  • 마지막으로 작성한 내 임시 게시글 가져오기

    • URL: GET /api/post/temp
    • Header: None
  • 게시글 임시 저장 (최초 호출)

    • URL: POST /api/post/temp/write
    • Header: Content-Type: multipart/form-data
    • Form Data: body: application/json, image_list 파일
body에 들어갈 json

{
  "title": "title",              // required
  "sub_title": "subTitle",       // optional
  "link": "https://github.com",  // optional
  "tag_list": [                  // optional
    "html"
  ]
}
  • 게시글 임시 업데이트 (임시 저장 호출 이후 게시글 ID를 body에 추가. HTTP Method PUT 주의!)
    • URL: PUT /api/post/temp/update
    • Header: Content-Type: multipart/form-data
    • Form Data: body: application/json, image_list 파일
body에 들어갈 json

{
  "id": 1,                       // required (게시글 임시 저장 호출 이후 ID 값을 넣야함.)
  "title": "title",              // required
  "sub_title": "subTitle",       // optional
  "link": "https://github.com",  // optional
  "tag_list": [                  // optional
    "html"
  ]
}
  • 게시글 publish (게시글을 public 단계로 외부에도 노출)
    • URL: POST /api/post/publish
    • Header: Content-Type: multipart/form-data
    • Form Data: body: application/json, image_list 파일
body에 들어갈 json

{
  "id": 1,                       // optional (게시글 임시 저장에서 받은 ID를 넣거나, 생략한다. 만약 ID를 넣었다면 임시 저장 단계여야한다.)
  "title": "title",              // required
  "sub_title": "subTitle",       // optional
  "link": "https://github.com",  // optional
  "tag_list": [                  // optional
    "html"
  ]
}
  • 게시글 update (public 게시글 업데이트. HTTP Method PUT 주의!)
    • URL: PUT /api/post/update
    • Header: Content-Type: multipart/form-data
    • Form Data: body: application/json, image_list 파일
body에 들어갈 json

{
  "id": 1,                       // required (게시글 publish에서 받은 ID를 넣는다.)
  "title": "title",              // required
  "sub_title": "subTitle",       // optional
  "link": "https://github.com",  // optional
  "tag_list": [                  // optional
    "html"
  ]
}

Quiz (퀴즈)

  • 퀴즈 목록

    • URL: GET /api/quiz
    • Header: Content-Type: application/x-www-form-urlencoded
    • Param: page=1&category=CS&type=SHORT_ANSWER
      • page: 1 이상 자연수
      • category: (optional) CS 카테고리 문자열
      • type: SHORT_ANSWER | LONG_ANSWER | CHOICE_ANSWER (대소문자 주의)
  • 퀴즈 make

    • URL: POST /api/post/make
    • Header: Content-Type: application/json
{
  "title": "퀴즈 제목",                                   // required
  "description": "문제 설명",                             // required
  "answer": "정답",                                      // required
  "category": "CS",                                     // required
  "type": SHORT_ANSWER | LONG_ANSWER | CHOICE_ANSWER    // required
}
  • 퀴즈 update
    • URL: PUT /api/post/update (HTTP Method PUT 주의!)
    • Header: Content-Type: application/json

❗️ 존재하지 않는 퀴즈 ID를 넣는 경우 ITEM_NOT_FOUND 에러가 발생합니다.

{
  "id": 1                                               // required
  "title": "퀴즈 제목",                                   // required
  "description": "문제 설명",                             // required
  "answer": "정답",                                      // required
  "category": "CS",                                     // required
  "type": SHORT_ANSWER | LONG_ANSWER | CHOICE_ANSWER    // required
}

Clone this wiki locally