Start using Wunderlist SDK

↘锁芯ラ 提交于 2019-12-12 12:34:51

问题


I am using Wunderlist SDK for a sample app that im developing for academic purposes.

From the Wunderlist's docs i have the following code working:

$(document).ready(function(){
   var WunderlistSDK = window.wunderlist.sdk;
   WunderlistAPI = new WunderlistSDK({
      'accessToken': access_token,
      'clientID': client_id
   });

   WunderlistAPI.initialized.done(function () {
       WunderlistAPI.http.lists.all().done(handleListData).fail(handleError);
   });

   function handleListData(data){
       $("#tasks").append("<button onclick='lookup_tasks(" + data.id + ")'>Search tasks for this list</button>");
   }

   function handleError(error,event){
      alert("Error: "+ JSON.stringify(error));
   }
});

I am confused on using the the rest of the API because i cant figure out how can i perform other requests using the REST API

For instance if i want to search all tasks by a list_id i am trying the following but it wont work:

function lookup_tasks(list_id){
    $.get("http://a.wunderlist.com/api/v1/tasks",{list_id: list_id},function(data){
        alert(JSON.stringify(data));
    }); //Neither works passing the client_id and access_token as params
}

Anyone knows what am i misunderstanding?

来源:https://stackoverflow.com/questions/30925242/start-using-wunderlist-sdk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!