Board API

    Board API로 게시판과 게시글, 댓글을 관리할 수 있다.

    Board API를 호출하려면 구성원 계정 또는 서비스 계정으로 인증하여 얻은 Access Token이 필요하다. API Scope는 board, board.read이다.

    게시판 관리

    다음 API로 게시판을 관리할 수 있다.

    HTTP Request Description
    POST /boards 게시판 생성
    GET /boards 게시판 목록 조회
    GET /boards/{boardId} 게시판 조회
    PUT /boards/{boardId} 게시판 수정
    DELETE /boards/{boardId} 게시판 삭제

    게시판은 카테고리나 순서, 권한, 타입 등을 설정할 수 있지만, Board API로는 게시판의 제목(boardName)과 설명(description)만 관리할 수 있다.

    {
       "boardName": "게시판 제목",
       "description": "게시판 설명"
    }
    

    게시글 관리

    게시판에 게시글을 등록한다. 다음 API로 게시글을 관리할 수 있다. API를 호출할 때 게시판 ID(boardId)를 지정한다.

    HTTP Request Description
    POST /boards/{boardId}/posts 게시글 작성
    GET /boards/{boardId}/posts 게시글 목록 조회
    GET /boards/{boardId}/posts/{postId} 게시글 조회
    PUT /boards/{boardId}/posts/{postId} 게시글 수정
    DELETE /boards/{boardId}/posts/{postId} 게시글 삭제
    GET /boards/{boardId}/posts/{postId}/readers 게시글 읽은 멤버 목록 조회

    모든 게시판에서 특정 조건의 게시글을 조회할 수 있다.

    HTTP Request Description
    GET /boards/recent/posts 최신글 목록 조회
    GET /boards/my/posts 내 게시글 목록 조회
    GET /boards/must/posts 필독 게시글 목록 조회

    게시글은 제목(title)과 내용(body)을 지정해 등록한다. 내용(body)에는 HTML 태그를 기재할 수 있다. 또한 댓글 사용 여부(enableComment), 게시글 생성 알림 발송 여부(sendNotifications), 필독 종료일(mustReadEndDate)을 지정할 수 있다.

    {
       "title": "게시글 제목",
       "body": "<h1>게시글</h1>본문",
       "enableComment": true,
       "sendNotifications": true,
       "mustReadEndDate": "2023-07-20"
    }
    

    첨부 파일 관리

    게시글에는 파일을 여러 개 첨부할 수 있다.

    HTTP Request Description
    POST /boards/{boardId}/posts/{postId}/attachments 게시글 첨부 파일 추가
    GET /boards/{boardId}/posts/{postId}/attachments 게시글 첨부 파일 목록 조회
    GET /boards/{boardId}/posts/{postId}/attachments/{attachmentId} 게시글 첨부 파일 조회
    DELETE /boards/{boardId}/posts/{postId}/attachments/{attachmentId} 게시글 첨부 파일 삭제

    첨부 파일의 조회 방법은 파일 업로드/다운로드를 참고한다.

    댓글 관리

    게시글에 댓글을 달 수 있다. 다음 API로 댓글을 관리한다. API를 호출할 때 게시판 ID(boardId)와 게시글 ID(postId)를 지정한다.

    HTTP Request Description
    POST /boards/{boardId}/posts/{postId}/comments 댓글 작성
    GET /boards/{boardId}/posts/{postId}/comments 댓글 목록 조회
    GET /boards/{boardId}/posts/{postId}/comments/{commentId} 댓글 조회
    PUT /boards/{boardId}/posts/{postId}/comments/{commentId} 댓글 수정
    DELETE /boards/{boardId}/posts/{postId}/comments/{commentId} 댓글 삭제

    댓글은 내용(content)을 지정해 등록한다.

    {
       "content": "댓글입니다"
    }
    

    댓글 첨부 파일 관리

    댓글에는 파일을 여러 개 첨부할 수 있다.

    HTTP Request Description
    GET /boards/{boardId}/posts/{postId}/comments/{commentId}/attachments 댓글 첨부 파일 목록 조회
    POST /boards/{boardId}/posts/{postId}/comments/{commentId}/attachments 댓글 첨부 파일 추가
    GET /boards/{boardId}/posts/{postId}/comments/{commentId}/attachments/{attachmentId} 댓글 첨부 파일 조회
    DELETE /boards/{boardId}/posts/{postId}/comments/{commentId}/attachments/{attachmentId} 댓글 첨부 파일 삭제

    첨부 파일의 추가, 조회 방법은 파일 업로드/다운로드를 참고한다.