Skip to content

ArneCL/wunderlist-api

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wunderlist-api

📕 Wunderlist in a simple way.


NPM version Dependency Status devDependency Status

Installation

[sudo] npm install --save wunderlist-api

Changelog

  • 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.

Docs

Concepts

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.

Usage

Authorization

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
  });

User

User information
wunderlist.user()
Avatar
  • userId: integer
  • size: integer (optional)
  • fallback: boolean (optional)
wunderlist.avatar(userId, size, fallback)

Lists

Get All lists
wunderlist.getLists()
Get specified list
  • listId: integer
wunderlist.getList(listId)
Make a list from state (public or private)
  • listId: integer
  • revision: integer
  • public: boolean
wunderlist.avatar(listId, revision, public)
Create List
  • title: string
wunderlist.createList(title)
Update List
  • listId: integer
  • revision: integer
  • title: string
wunderlist.updateList(listId, revision, title)
Delete List
  • listId: integer
  • revision: integer
wunderlist.deleteList(listId, revision)
Users authorized in list
  • listId: integer
wunderlist.listUsers(listId)

Notes

Get notes from list
  • listId: integer
wunderlist.notesList(listId)
Get notes from task
  • taskId: integer
wunderlist.notesTask(taskId)
Create note
  • taskId: integer
  • content: string
wunderlist.createNote(taskId, content)
Delete note
  • noteId: integer
  • revision: integer
wunderlist.deleteNote(noteId, revision)

Tasks

Get all tasks
  • listId: integer
wunderlist.getTasks(listId)
Get tasks for state
  • listId: integer
  • state: boolean (completed or incompleted)
wunderlist.getTasksForState(listId, state)
Get specified task
  • taskId: integer
wunderlist.getTask(taskId)
Create task
  • listId: integer
  • title: string
  • state: boolean
  • starred: boolean
wunderlist.createTask(listId, title, state, starred)
Delete Task
  • taskId: integer
  • revision: integer
wunderlist.deleteTask(taskId, revision)

Subtasks

Get subtask from list
  • taskId: integer
wunderlist.subtaskList(taskId)
Get completed subtasks from list
  • listId: integer
  • completed: boolean
wunderlist.subtaskListState(listId, completed)
Get subtask from task
  • taskId: integer
wunderlist.subtaskComment(taskId)
Get completed subtask from task
  • taskId: integer
  • completed: boolean
wunderlist.subtaskCommentState(taskId, completed)
Create subtask
  • taskId: integer
  • title: string
  • completed: boolean
wunderlist.createSubstask(taskId, title, completed)
Delete subtask
  • subtaskId: integer
  • revision: integer
wunderlist.deleteSubtask(subtaskId, revision)

Task Comments

Get comments from Task
  • taskId: integer
wunderlist.commentsTaks(taskId)
Get comments from Lists
  • listId: integer
wunderlist.commentsList(listId)
Create Comment
  • taskId: integer
  • text: string
wunderlist.createComment(taskId, text)

Membership

Get Membership
wunderlist.getMembership()
Add member to list
  • user_id: integer
  • listId: string
  • muted: boolean
wunderlist.addMember(user_id, listId, muted)
Remove a Member from a List
  • user_id: integer
  • revision: integer
wunderlist.removeMember(user_id, revision)

Contributing

  • 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

About

📕 Wunderlist in a simple way.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%