131 lines
2.9 KiB
Plaintext

# Group Notes
## Notes [/notes]
### Create a Note [POST]
+ Request (text/markdown; charset=UTF-8)
+ Headers
Authorization: Bearer <token>
Accept: application/json
+ Body
---
title: example
tags: ["some", "tags"]
---
# A story
- a
- b
+ Response 201 (application/json)
{
"title": "example",
"tags": [
"some",
"tags"
],
"markdown": "---\ntitle: example\ntags: [\"some\", \"tags\"]\n---\n# A story\n\n- a\n- b",
"html": "<h1>A story</h1>\n<ul><li>a</li><li>b</li></ul>\n",
"uuid": "42aa1078-130e-47ee-b82d-b1d62f3ea054",
"updatedAt": "2020-07-16T01:03:46.7766"
}
## Notes [/notes{?limit,after}]
+ Parameters
+ limit: 10 (number, optional) - The number of notes to return
+ Default: `20`
+ after: `9bd36653-6397-4c5b-b8b7-158d9de208ef` (string, optional) - The UUID of the note before the requested ones
### Get All Notes [GET]
+ Request
+ Headers
Authorization: Bearer <token>
Accept: application/json
+ Response 200 (application/json)
+ Body
[
{
"uuid": "42aa1078-130e-47ee-b82d-b1d62f3ea054",
"title": "example",
"updatedAt": "2020-07-16T01:03:46",
"tags": [
"some",
"tags"
]
},
{
"uuid": "e61271e9-ba86-4428-a788-49946d1954c5",
"title": "test",
"updatedAt": "2020-07-16T00:22:02",
"tags": [
"babar",
"fait",
"du",
"ski"
]
},
]
## Note [/notes/{uuid}]
+ Parameters
+ uuid: `123e4567-e89b-12d3-a456-426614174000` (required, string) - The note UUID.
### Get a Note [GET]
+ Request
+ Headers
Authorization: Bearer <token>
Accept: application/json
+ Response 200 (application/json)
+ Body
{
"uuid": "8ba68c64-11f1-4424-a0cb-cba54a65298f",
"title": "example",
"markdown": "---\ntitle: example\ntags: [\"some\", \"tags\"]\n---\n# A story\n\n- a\n- b",
"html": "<h1>A story</h1>\n<ul><li>a</li><li>b</li></ul>\n",
"updatedAt": "2020-07-16T01:13:37",
"tags": [
"some",
"tags"
]
}
+ Response 404
### Update a Note [PUT]
#### TODO
### Delete a Note [DELETE]
+ Request
+ Headers
Authorization: Bearer <token>
Accept: application/json
+ Response 200
+ Response 404