For each request you should send the username and the password.
A json object will be returned you should parse it and extract the needed data.
{
"username": user,
"password": password
}
To list all tasks:
send a post request to
/api/get/?action=all
the post data should contain the username and the password.
To list only uncompleted tasks:
send a post request to
/api/get/?action=ls
the post data should contain the username and the password.
To add a task:
send a post request to
/api/set/?action=add
the post data should contain the username and the password and an object called text which represents the task text.
To done or undone:
send a post request to
/api/set/?action=done&index=num
the post data should contain the username and the password.
change num to the task index, to undone just change the action parameter to undone.
To remove a task:
the same for done and undone but only with changing the action to remove
To search:
send a post request to:
/api/get/?action=search&tag=food
and as always the post data contains the username and the password.
A python example using requests
import requests
login = {
"username": "mohamed",
"password": "root"
}
req = requests.post('http://localhost:5000/api/set/?action=add', data=login)
print req.text
I used https://stackedit.io/ to convert my markdown into html.