콘텐츠로 이동

게시판

게시글 조회는 공개 API로 사용할 수 있고, 글 작성과 댓글 작성은 사용자 토큰이 필요합니다. 게시판별 쓰기/댓글 권한은 게시판 상세와 게시글 상세 응답으로 확인합니다.

메서드 경로 설명 사용자 토큰
GET/boards게시판 목록 조회필요 없음
GET/boards/{boardId}게시판 상세 조회필요 없음
GET/posts게시글 목록 조회필요 없음
GET/posts/{postId}게시글 상세 조회필요 없음
GET/posts/{postId}/comments댓글 목록 조회게시글 권한에 따라 다름
메서드 경로 설명 사용자 토큰
POST/posts게시글 작성필수
POST/comments댓글 작성필수
  • 게시판 이름은 보통 title 필드로 내려옵니다.
  • 게시글 목록은 posts가 아니라 board_contents.data로 내려올 수 있습니다.
  • 게시글 상세 응답에는 comment_mode, can_read_comment, can_write_comment가 함께 내려옵니다.
  • 댓글은 GET /posts/{postId}/comments로 별도 조회하세요.
  • 공지사항처럼 write: "0" 또는 posting_scope: "admin_only"인 게시판은 외부 storefront에서 글쓰기 UI를 노출하지 마세요.
  • 댓글이 비활성화된 게시판은 comment_mode: "disabled"입니다.

게시글 상세에서 확인할 권한 값

섹션 제목: “게시글 상세에서 확인할 권한 값”
{
"board_content": {
"ID": 1184,
"board_id": 13522,
"title": "문의 제목",
"content": "본문",
"writer_name": "런모아"
},
"comment_mode": "flat",
"can_read_comment": false,
"can_write_comment": false
}
  • can_read_comment: false면 댓글 목록 UI 대신 로그인 또는 권한 안내를 보여주세요.
  • can_write_comment: false면 댓글 입력 폼을 숨기세요.
  • comment_mode: "disabled"면 댓글 섹션 자체를 비활성화하세요.
const posts = await fetch(`${API_BASE}/posts?board_id=1&page=1`, {
headers: {
'X-Runmoa-Site-Key': STOREFRONT_KEY,
Accept: 'application/json',
},
}).then((response) => response.json());
const comments = await fetch(`${API_BASE}/posts/123/comments`, {
headers: {
'X-Runmoa-Site-Key': STOREFRONT_KEY,
Accept: 'application/json',
},
credentials: 'include',
}).then((response) => response.json());
await fetch(`${API_BASE}/comments`, {
method: 'POST',
headers: {
'X-Runmoa-Site-Key': STOREFRONT_KEY,
Authorization: `Bearer ${token}`,
'Content-Type': 'application/json',
Accept: 'application/json',
},
body: JSON.stringify({
content_id: 123,
content: '문의드립니다.',
}),
});