An article reading list manager.
click to enlarge
Parameters written in bold text are required.
Parameters written in italic text are optional.
POST JSON to /login
:
- username (string)
- password (string)
You will receive a JSON on success, as following: {"success": "ok", "token": "..."}
Send the token to every other request in a basic Authorization
header. Be careful that tokens expires after a given amount of time (default is 3600 seconds, one hour).
Note: all /articles
routes are protected, they need you to send a valid authorization header.
POST JSON to /articles/add
:
- title (string)
- url (string)
- tags (list of strings, can be empty)
Example:
(curl "http://localhost:3000/articles/add" -Method POST -H @{"Content-Type"="application/json"; "Authorization"="Basic token..."} -Body '{"title": "hello", "url": "https://google.com", "tags": []}').Content
GET JSON from /articles/:id
:
- id (integer)
(curl "http://localhost:3000/articles/0" -Method GET -H @{"Authorization"="Basic token..."}).Content
GET JSON from /articles/list
:
- URL parameter page (integer), defaults to 1
- URL parameter quantity (integer), defaults to 25
Example:
(curl "http://localhost:3000/articles/list?page=1&quantity=14" -Method GET -H @{"Authorization"="Basic token..."}).Content
DELETE /articles/:id
:
- id (integer)
Example:
(curl "http://localhost:3000/articles/0" -Method DELETE -H @{"Authorization"="Basic token..."}).Content
PATCH JSON to /articles/:id
:
- id (integer)
- title (string)
- tags (list of strings)
- read (bool)
- url (string)
- notes (string)
Note: unknown attributes are simply ignored
Example:
(curl http://localhost:3000/articles/0 -Method PATCH -H @{"Content-Type"="application/json"; "Authorization"="Basic token..."} -Body '{"not_an_attribute": "hello", "read": true}').Content
Note: all /tags
routes are protected, they need you to send a valid authorization header.
POST JSON to /tags/add
:
- name (string)
- color (string), must be a valid hexcolor
Example:
(curl "http://localhost:3000/tags/add" -Method POST -H @{"Content-Type"="application/json"; "Authorization"="Basic token..."} -Body '{"name": "foo", "color": "012345"}').Content
GET JSON from /tags/:id
:
- id (string)
(curl "http://localhost:3000/tags/0" -Method GET -H @{"Authorization"="Basic token..."}).Content
GET JSON from /tags/list
.
Example:
(curl "http://localhost:3000/tags/list" -Method GET -H @{"Authorization"="Basic token..."}).Content
DELETE /tags/:id
:
- id (string)
Example:
(curl "http://localhost:3000/tags/coffee" -Method DELETE -H @{"Authorization"="Basic token..."}).Content
PATCH JSON to /tags/:id
:
- id (string), the (old) tag name
- name (string), an optional new name (must be unique)
- color (string), must be a valid hexcolor
Note: unknown attributes are simply ignored
Example:
(curl http://localhost:3000/tags/coffee -Method PATCH -H @{"Content-Type"="application/json"; "Authorization"="Basic token..."} -Body '{"not_an_attribute": "hello", "color": "ff0000"}').Content