Skip to content

Latest commit

 

History

History
276 lines (210 loc) · 5.61 KB

File metadata and controls

276 lines (210 loc) · 5.61 KB

API

api/v1/folders

GET request

  • Description: get all folders
  • Success status code: 200 OK

api/v1/folders/{folderId}

GET request

PATCH request

Example payload:

{
  "updateType": "RENAME_FOLDER",
  "newName": "Python"
}
{
  "updateType": "MOVE_FOLDER",
  "toParentId": 2
}

DELETE request

api/v1/folders/{folderId}/subFolders

GET request

  • Description: get all sub-folders under the folder by id 'folderId'
  • Success status code: 200 OK
  • Exceptions:

POST request

Example payload:

{
  "name": "c++"
}

api/v1/folders/{folderId}/notes

GET request

  • Description: get all notes under the folder by id 'folderId'
  • Success status code: 200 OK
  • Exceptions:

POST request

Example payload:

{
  "name": "spring"
}

api/v1/notes

GET request

  • Description: get all notes
  • Success status code: 200 OK

api/v1/notes/{noteId}

GET request

PATCH request

Example payload:

{
  "updateType": "RENAME_NOTE",
  "newName": "lalaland"
}
{
  "updateType": "MODIFY_CONTENT",
  "newContent": "Hello, World!"
}
{
  "updateType": "MOVE_NOTE",
  "toFolderId": 2
}
{
  "updateType": "ADD_TAG",
  "tagName": "pl"
}
{
  "updateType": "REMOVE_TAG",
  "tagName": "pl"
}

DELETE request

  • Description: delete the note by id 'noteId'
  • Success status code: 204 NO CONTENT
  • Exceptions:

api/v1/notes/{noteId}/tags

GET request

  • Description: get all tags attached to the note by id 'noteId'
  • Success status code: 200 OK

api/v1/tags

GET request

  • Description: get all tags
  • Success status code: 200 OK

POST request

Example payload:

{
  "name": "pl"
}

api/v1/tags/{tagId}

GET request

  • Description: get the tag by id 'tagId'
  • Success status code: 200 OK
  • Exceptions:

PATCH request

Example payload:

{
  "newName": "ProgrammingLanguage"
}

DELETE request

  • Description: delete the tag by id 'tagId'
  • Success status code: 204 NO CONTENT
  • Exceptions:

api/v1/tags/{tagId}/notes

GET request

  • Description: get all notes by tag id 'tagId'
  • Succcess status code: 200 OK