📕 Wunderlist in a simple way.
[sudo] npm install --save wunderlist-api
- 1.0.0 - ES6 MODULES! You can use Wunderlist-api with new sintax based in ES6, based in Class and features ES6!
- 0.2.2 - The names of some methods have changed from version 0.2.x, please see the new names from the need.
There are some parameters that are needed to operate certain methods, among all, some are rather odd, such as the revision
, that is the amount of change that this task note, user, list, comment, subtask, in short, anything was modified, by default, it comes with the value 1
. When required this parameter, you must enter the value of the current revision
and not the following number. For example, to delete a user from the list that was newly created, I pass the current value of revision in case the value 1
.
For more information on types of parameters or any other matter, please visit the official site Wunderlist.
To access the information have 2 data, the first the access token and the Client ID, this information is available here.
- accessToken - string
- clientId - string
'use strict';
import Wunderlist from 'wunderlist-api';
const wunderlist = new Wunderlist({
clientId: 'Your Client ID',
accessToken: 'Your Access Token'
})
// => authenticated
All the following methods may be accessed in the same way, only changing the parameter when it becomes necessary, show only an example that can be repeated after any other. The method is based on the concept of promises.
Universal Exampler: for all methods is REQUIRED use .then()
for get response!
// authentication
wunderlist.method(parameters)
.then( response => {
// response
})
.catch( error => {
// handle error
});
wunderlist.user()
- userId: integer
- size: integer (optional)
- fallback: boolean (optional)
wunderlist.avatar(userId, size, fallback)
wunderlist.getLists()
- listId: integer
wunderlist.getList(listId)
- listId: integer
- revision: integer
- public: boolean
wunderlist.avatar(listId, revision, public)
- title: string
wunderlist.createList(title)
- listId: integer
- revision: integer
- title: string
wunderlist.updateList(listId, revision, title)
- listId: integer
- revision: integer
wunderlist.deleteList(listId, revision)
- listId: integer
wunderlist.listUsers(listId)
- listId: integer
wunderlist.notesList(listId)
- taskId: integer
wunderlist.notesTask(taskId)
- taskId: integer
- content: string
wunderlist.createNote(taskId, content)
- noteId: integer
- revision: integer
wunderlist.deleteNote(noteId, revision)
- listId: integer
wunderlist.getTasks(listId)
- listId: integer
- state: boolean (completed or incompleted)
wunderlist.getTasksForState(listId, state)
- taskId: integer
wunderlist.getTask(taskId)
- listId: integer
- title: string
- state: boolean
- starred: boolean
wunderlist.createTask(listId, title, state, starred)
- taskId: integer
- revision: integer
wunderlist.deleteTask(taskId, revision)
- taskId: integer
wunderlist.subtaskList(taskId)
- listId: integer
- completed: boolean
wunderlist.subtaskListState(listId, completed)
- taskId: integer
wunderlist.subtaskComment(taskId)
- taskId: integer
- completed: boolean
wunderlist.subtaskCommentState(taskId, completed)
- taskId: integer
- title: string
- completed: boolean
wunderlist.createSubstask(taskId, title, completed)
- subtaskId: integer
- revision: integer
wunderlist.deleteSubtask(subtaskId, revision)
- taskId: integer
wunderlist.commentsTaks(taskId)
- listId: integer
wunderlist.commentsList(listId)
- taskId: integer
- text: string
wunderlist.createComment(taskId, text)
wunderlist.getMembership()
- user_id: integer
- listId: string
- muted: boolean
wunderlist.addMember(user_id, listId, muted)
- user_id: integer
- revision: integer
wunderlist.removeMember(user_id, revision)
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am "Add some feature"
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
For more information on types of parameters or any other matter, please visit the official site Wunderlist.
License MIT @ 2016 Felipe Sousa