기본 사용 방법

기본적으로 모든 API에는 headers에 아래의 값을 넣어야 합니다.

'x-username': '다른 사람과 겹치지 않는 고유한 이름'

header에 해당 값이 누락이 되면 API 호출에 실패합니다.


Root Documents 가져오기

전체 Document의 구조를 트리 형태로 가져옵니다.

https://kdt-api.fe.dev-cos.com/documents - GET

Response의 형태는 아래와 같습니다.

[
  {
    "id": 1, // Document id
    "title": "노션을 만들자", // Document title
    "documents": [
      {
        "id": 2,
        "title": "블라블라",
        "documents": [
          {
            "id": 3,
            "title": "함냐함냐",
            "documents": []
          }
        ]
      }
    ]
  },
  {
    "id": 4,
    "title": "hello!",
    "documents": []
  }
]

특정 Document의 content 조회하기

https://kdt-api.fe.dev-cos.com/documents/{documentId} - GET

Response의 형태는 아래와 같습니다.

{
  "id": 1,
  "title": "노션을 만들자",
  "content": "즐거운 자바스크립트의 세계!",
  "documents": [
    {
      "id": 2,
      "title": "",
      "createdAt": "",
      "updatedAt": ""
    }
  ],
  "createdAt": "",
  "updatedAt": ""
}


Document 생성하기