diary

Time is your most valuable asset (till immortality)

View the Project on GitHub boyangwang/diary

Back

The REST API endpoints

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",
}

Document for each REST API

getEntries

Returns a list of entries for specified date, or empty

postEntry

Adds a new entry to date, or update an existing entry

deleteEntry

Deletes an existing entry

getTodos

Returns todos for this owner

postTodo

Adds a new todo to date, or update an existing todo

deleteTodo

Deletes an existing todo

login

Performs login authentication

errReport

Reports error entry