개요
Http 동사
본 REST API에서 사용하는 HTTP 동사(verbs)는 가능한 표준 HTTP 와 REST 규약을 따릅니다.
동사 | 용례 |
---|---|
|
리소스를 가져올 때 사용 |
|
새 리소스를 만들 때 사용 |
|
기존 리소스를 수정할 때 사용 |
|
기존 리소스의 일부를 수정할 때 사용 |
|
기존 리소스를 삭제할 떄 사용 |
HTTP 상태 코드
본 REST API에서 사용하는 HTTP 상태 코드는 가능한 표준 HTTP와 REST 규약을 따릅니다.
상태 코드 | 용례 |
---|---|
|
요청을 성공적으로 처리함 |
|
새 리소스를 성공적으로 생성함. 응답의 |
|
기존 리소스를 성공적으로 수정함. |
|
잘못된 요청을 보낸 경우. 응답 본문에 더 오류에 대한 정보가 담겨있다. |
|
요청한 리소스가 없음. |
|
클라이언트의 요청이 서버의 상태와 충돌이 발생한 경우. |
게시물 관리
관리자 회원만 사용가능합니다.
게시물 목록 조회
요청
GET /admin/posts?searchKeyword=title&searchCondition=TITLE&page=0&size=10 HTTP/1.1
Host: jeeoklog.jeeok.com
Parameter | Description |
---|---|
|
검색 조건 |
|
검색 키워드 |
|
검색 페이지 |
|
검색 사이즈 |
응답
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 635
{"transaction_time":"2022-11-10T15:40:41.2680476","code":"SUCCESS","message":null,"errors":null,"data":[{"postId":null,"postTitle":"title0","postContent":"content","hits":0,"createdDate":null,"createdBy":null},{"postId":null,"postTitle":"title1","postContent":"content","hits":0,"createdDate":null,"createdBy":null},{"postId":null,"postTitle":"title2","postContent":"content","hits":0,"createdDate":null,"createdBy":null},{"postId":null,"postTitle":"title3","postContent":"content","hits":0,"createdDate":null,"createdBy":null},{"postId":null,"postTitle":"title4","postContent":"content","hits":0,"createdDate":null,"createdBy":null}]}
Path | Type | Description |
---|---|---|
|
|
api 요청 시간 |
|
|
SUCCESS or ERROR |
|
|
메시지 |
|
|
에러 |
|
|
게시물 고유번호 |
|
|
게시물 제목 |
|
|
게시물 내용 |
|
|
조회수 |
|
|
등록일 |
|
|
등록자 |
게시물 단건 조회
요청
GET /admin/posts/0 HTTP/1.1
Host: jeeoklog.jeeok.com
Parameter | Description |
---|---|
|
게시물 고유번호 |
응답
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 208
{"transaction_time":"2022-11-10T15:40:41.1980509","code":"SUCCESS","message":null,"errors":null,"data":{"postId":null,"postTitle":"title","postContent":"content","hits":0,"createdDate":null,"createdBy":null}}
Path | Type | Description |
---|---|---|
|
|
api 요청 시간 |
|
|
SUCCESS or ERROR |
|
|
메시지 |
|
|
에러 |
|
|
게시물 고유번호 |
|
|
게시물 제목 |
|
|
게시물 내용 |
|
|
조회수 |
|
|
등록일 |
|
|
등록자 |
게시물 저장
요청
POST /admin/posts HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 45
Host: jeeoklog.jeeok.com
{"postTitle":"title","postContent":"content"}
Path | Type | Description |
---|---|---|
|
|
게시물 제목 |
|
|
게시물 내용 |
응답
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 124
{"transaction_time":"2022-11-10T15:40:41.0910483","code":"SUCCESS","message":null,"errors":null,"data":{"savedPostId":null}}
Path | Type | Description |
---|---|---|
|
|
api 요청 시간 |
|
|
SUCCESS or ERROR |
|
|
메시지 |
|
|
에러 |
|
|
저장된 게시물 고유번호 |
게시물 수정
요청
PUT /admin/posts/0 HTTP/1.1
Content-Type: application/json;charset=UTF-8
Content-Length: 59
Host: jeeoklog.jeeok.com
{"postTitle":"update_title","postContent":"update_content"}
Parameter | Description |
---|---|
|
게시물 고유번호 |
Path | Type | Description |
---|---|---|
|
|
게시물 제목 |
|
|
게시물 내용 |
응답
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 126
{"transaction_time":"2022-11-10T15:40:41.2280475","code":"SUCCESS","message":null,"errors":null,"data":{"updatedPostId":null}}
Path | Type | Description |
---|---|---|
|
|
api 요청 시간 |
|
|
SUCCESS or ERROR |
|
|
메시지 |
|
|
에러 |
|
|
수정된 게시물 고유번호 |
게시물 삭제
요청
DELETE /admin/posts/0 HTTP/1.1
Host: jeeoklog.jeeok.com
Parameter | Description |
---|---|
|
게시물 고유번호 |
응답
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 106
{"transaction_time":"2022-11-10T15:40:41.30305","code":"SUCCESS","message":null,"errors":null,"data":null}
Path | Type | Description |
---|---|---|
|
|
api 요청 시간 |
|
|
SUCCESS or ERROR |
|
|
메시지 |
|
|
에러 |
|
|
데이터 |