Any.do API (unofficial)
This API allows to list and add tasks and also get auth token
Installation
npm install anydo-api
Example
const Api = ; const api = 'your_email' 'your_password'; const tasks = title: 'from api today' title: 'from api tomorrow' dueDate: 'tomorrow' title: 'from api upcoming' dueDate: 'upcoming' title: 'from api someday' dueDate: null title: 'from api to category' categoryId: 'yourCategoryId'; // create then delete tasksapi ;
Methods
Api
Kind: global class
- Api
- .login(options) ⇒
Promise
- .sync([options]) ⇒
Promise
- .setToken(token) ⇒
Promise
- .addTask(options) ⇒
Promise
- .addTasks(tasks) ⇒
Promise
- .deleteTask(object) ⇒
Promise
- .login(options) ⇒
Promise
api.login(options) ⇒ Get auth token
Kind: instance method of Api
Param | Type |
---|---|
options | object |
options.email | string |
options.password | string |
Promise
api.sync([options]) ⇒ Sync tasks If it is invoked without options, it just returns all undone and not deleted tasks
Kind: instance method of Api
Param | Type |
---|---|
[options] | object |
[options.updateSince] | number |
[options.includeDone] | boolean |
[options.includeDeleted] | boolean |
[options.models] | object |
Promise
api.setToken(token) ⇒ Set token for current API instance
Kind: instance method of Api
Param | Type |
---|---|
token | object |
token.token | string |
Promise
~~
api.addTask(options) ⇒ Deprecated
Add new task
Kind: instance method of Api
Param | Type |
---|---|
options | object |
options.title | string |
[options.dueDate] | number |
[options.categoryId] | string |
Promise
api.addTasks(tasks) ⇒ Add several tasks at once
Kind: instance method of Api
Param | Type |
---|---|
tasks | Array.<object> |
tasks[].title | string |
[tasks[].dueDate] | number |
[tasks[].categoryId] | string |
Promise
api.deleteTask(object) ⇒ Delete task
Kind: instance method of Api
Param | Type |
---|---|
object | object |
object.taskId | string |