콘텐츠로 이동

게시판

게시글 조회는 공개 API로 사용할 수 있고, 글 작성/수정/삭제와 댓글 작성/수정/삭제는 사용자 토큰이 필요합니다.

메서드 경로 설명 사용자 토큰
GET/boards게시판 목록 조회필요 없음
GET/boards/{boardId}게시판 상세 조회필요 없음
GET/posts게시글 목록 조회필요 없음
GET/posts/product-info게시글 상품 정보 조회필요 없음
GET/posts/{postId}게시글 상세 조회필요 없음
GET/posts/{postId}/attachments/{fileId}첨부파일 다운로드필요 없음
GET/posts/{postId}/comments댓글 목록 조회필요 없음
메서드 경로 설명 사용자 토큰
POST/posts게시글 작성필수
GET/posts/{postId}/edit게시글 수정 화면 데이터필수
PUT/posts/{postId}게시글 수정필수
DELETE/posts/{postId}게시글 삭제필수
POST/comments댓글 작성필수
PUT/comments/{commentId}댓글 수정필수
DELETE/comments/{commentId}댓글 삭제필수
POST/posts/images게시글 이미지 업로드필수
POST/posts/attachments게시글 첨부파일 업로드필수
DELETE/posts/attachments/{fileId}임시 첨부파일 삭제필수
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());
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({
post_id: 123,
content: '문의드립니다.',
}),
});