Skip to content

Notes 2.0

Sander edited this page Jul 9, 2017 · 20 revisions

Get all notes

  • Status: Draft
  • Method: GET
  • Route: /notes
  • Parameters:
    • group -> Filter notes by group name
    • deleted -> 1 to get deleted, 0 or omit to show normal notes.
  • Returns:
[
    {
        "id": 76,
        "created": 1376752464,
        "modified": 1376753464,
        "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


    }, // etc
]

Get a note

  • Status: Draft
  • Method: GET
  • Route: /notes/{noteId}
  • Parameters:
    • None
  • Return codes:
  • HTTP 404: If the note does not exist
  • Returns:
{
        "id": 76,
        "created": 1376752464,
        "modified": 1376753464,
        "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: /notes
  • Parameters:
{
    "title": "New note",
    "content": "New note\n and something more",
    "group": "Group 1"
}
  • Returns:
{
    "id": 76,
    "created": 1376752464,
    "modified": 1376753464,
    "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: /notes/{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",
    "modified": 1376753464,
    "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: /notes/{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: /notes/{noteId}
  • Parameters: none
  • Return codes:
  • HTTP 404: If the note does not exist
  • Returns:
{
    "success": true
}
Clone this wiki locally