Skip to content

Notes 2.0

Sander edited this page Apr 10, 2018 · 20 revisions

Get all notes

  • Status: Draft
  • Method: GET
  • Route: /note
  • Parameters:
    • notebook_id -> Filter notes by notebook id
    • deleted -> 1 to get deleted, 0 or omit to show normal notes.
  • Returns:
[
    {
        "id": 76,
        "created": 1376752464,
        "mtime": 1376753464, //modified time
        "title": "New note"
        "content": "New note\n and something more",
        "shared_with": [],
        "permissions": 31,
        "notebook": 1,
        "owner": {
            "display_name": "brantje",
            "uid": "brantje",
            "avatar": null
        },
        "deleted": 0


    }, // etc
]

Get a note

  • Status: Draft
  • Method: GET
  • Route: /note/{noteId}
  • Parameters:
    • None
  • Return codes:
  • HTTP 404: If the note does not exist
  • Returns:
{
        "id": 76,
        "created": 1376752464,
        "mtime": 1376753464, //modified time
        "title": "New note"
        "content": "New note\n and something more",
        "shared_with": [],
        "permissions": 31,
        "group": "Group 1",
        "owner": {
            "display_name": "brantje",
            "uid": "brantje",
            "avatar": null
        },
        "deleted": 0
}

Create a note

Creates a new note and returns the note. The title is generated from the first line of the content. If no content is passed, a translated string New note will be returned as title

  • Status: Draft
  • Method: POST
  • Route: /note
  • Parameters:
{
    "title": "New note",
    "content": "New note\n and something more",
    "group": "Group 1"
}
  • Returns:
{
    "id": 76,
    "created": 1376752464,
    "mtime": 1376753464, //modified time
    "title": "New note"
    "content": "New note\n and something more",
    "shared_with": [

    ],
    "permissions": 31,
    "group": "Group 1",
    "owner": {
        "display_name": "brantje",
        "uid": "brantje",
        "avatar": null
    },
    "deleted": 0
}

Update a note

Updates a note with the id noteId. Always update your app with the returned title because the title can be renamed if there are collisions on the server.

  • Status: Draft
  • Method: PUT
  • Route: /note/{noteId}
  • Parameters:
{
    "title": "Note title"
    "content": "New content",
    "group": "Group 1"
}
  • Return codes:
  • HTTP 404: If the note does not exist
  • Returns:
{
    "id": 76,
    "content": "New content",
    "mtime": 1376753464, //modified time
    "group": "Group 1",
    "title": "New title",
    "permissions": 31,
    "owner": {
        "display_name": "brantje",
        "uid": "brantje",
        "avatar": null
    },
    "shared_with": [],
    "deleted": 0
}

Delete a note but keep the entity in db

Deletes a note with the id noteId

  • Status: Draft
  • Method: PUT
  • Route: /note/{noteId}
  • Parameters:
{
   "deleted": 1
}
  • Return codes:
  • HTTP 404: If the note does not exist
  • Returns:
{
    "success": true
}

Delete a note

Deletes a note with the id noteId. Entity will be removed from database.

  • Status: Draft
  • Method: DELETE
  • Route: /note/{noteId}
  • Parameters: none
  • Return codes:
  • HTTP 404: If the note does not exist
  • Returns:
{
    "success": true
}
Clone this wiki locally