Time is your most valuable asset (till immortality)
| Method | URI | Action |
|---|---|---|
| GET | https://{hostname}:{port}/api/getEntries?date={date}&owner={owner} | Retrieve list of entries |
| POST | https://{hostname}:{port}/api/postEntry | Add a new entry to date, or update an existing entry |
| POST | https://{hostname}:{port}/api/deleteEntry | Delete an entry |
| GET | https://{hostname}:{port}/api/getTodos?owner={owner} | Return todos for this owner |
| POST | https://{hostname}:{port}/api/postTodo | Add a new todo to date, or update an existing todo |
| POST | https://{hostname}:{port}/api/deleteTodo | Delete a todo |
| POST | https://{hostname}:{port}/api/login | Perform login authentication |
| POST | https://{hostname}:{port}/api/errReport | Report error entry |
Note:
{some} represnets a variable called “some”
Example for an {entry} object that will be used in the following
{
"date": "1970-01-01",
"title": "test title",
"content": "test content",
"points": 1,
"_id": "5aae5d46c53c46492ce1086a"
}
Example for an {todo} object that will be used in the following
{
"date": "1970-01-01",
"title": "test title",
"content": "test content",
"priority": 3,
"check": "false",
"_id": "5aae5d46c53c46492ce1086a"
}
Example for an {reminder} object that will be used in the following
{
"createTimestamp": 1521819342901,
"title": "test title",
"content": "<p>test</p>",
"_id": "5aae5d46c53c46492ce1086a",
"cycleType": "year",
"cycleTime": "01-01", // 12-31
// "month": "month_1" "month_30" "month_31" "month_-1"
// "week": "week_1" "week_7"
// "since": YYYY-MM-DD
}
Example for an {digest} object that will be used in the following
{
"createTimestamp": 1521819342901,
"lastModified": 1521819342901,
"title": "test title",
"content": "<p>test</p>",
"tags": ["tag1", "tag2", "tag3"],
"_id": "5aae5d46c53c46492ce1086a",
}
Returns a list of entries for specified date, or empty
URL: /api/getEntries?date={date}&owner={owner}
Method: GET
date=/^\d{4}-\d{2}-\d{2}$/owner=/^[A-Za-z0-9]+$/Data Params None
{ "data" : {entry} }400{ "err" : "Missing param" }OR
400{ "err" : "Illegal param" }Adds a new entry to date, or update an existing entry
URL: /api/postEntry
Method: POST
URL Params None
owner=/^[A-Za-z0-9]+$/date=/^\d{4}-\d{2}-\d{2}$/title=[string]content=[string]points=[integer]_id{ "data" : { {entry} } }OR
{ "data" : { "n": 1, "nModified": 1, "ok": 1 } }OR
{ "data" : { "n": 1, "nModified": 0, "ok": 1 } }400{ "err" : "Missing param" }Deletes an existing entry
URL: /api/deleteEntry
Method: POST
URL Params None
owner=/^[A-Za-z0-9]+$/entry={ _id: {id} }{ "data" : { {entry} } }Returns todos for this owner
URL: /api/getTodos?date={date}&owner={owner}
Method: GET
date=/^\d{4}-\d{2}-\d{2}$/owner=/^[A-Za-z0-9]+$/Data Params None
{ "data" : {todo} }400{ "err" : "Missing param" }OR
400{ "err" : "Illegal param" }Adds a new todo to date, or update an existing todo
URL: /api/postTodo
Method: POST
URL Params None
owner=/^[A-Za-z0-9]+$/todo{ "data" : { {todo} } }OR
{ "data" : { "n": 0, "nModified": 0, "ok": 1 } }OR
{ "data" : { "n": 1, "nModified": 1, "ok": 1 } }400{ "err" : "Missing param" }Deletes an existing todo
URL: /api/deleteTodo
Method: POST
URL Params None
owner=/^[A-Za-z0-9]+$/entry={ _id: {id} }{ "data" : { {todo} } }Performs login authentication
URL: /api/login
Method: POST
URL Params None
username=[string]password=[string]{ "data" : { "user": { "username": "some username" } } }401{ "err" : "Login failure" }OR
401{ "err" : "need login" }Reports error entry
URL: /api/errReport
Method: POST
URL Params None
_id=[string]err=[string]{ "err" : { "_id": "testid", "err": "test" } }