-
Notifications
You must be signed in to change notification settings - Fork 19
Notes 2.0
Sander edited this page Apr 3, 2018
·
20 revisions
- Status: Draft
- Method: GET
- Route: /note
-
Parameters:
- group -> Filter notes by group name
- 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,
"group": "Group 1",
"owner": {
"display_name": "brantje",
"uid": "brantje",
"avatar": null
},
"deleted": 0
}, // etc
]
- 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
}
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
}
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
}
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
}
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
}