title: How to call Google Tasks API from javascript?
body: <p>I amtrying to call Google Tasks API for a app I'm building.When I make the call using Google's client libraries, it succeeds and return what is expected.</p>
  
  <pre><code>function getAllTasks() {
  gapi.client.tasks.tasks.list({
      tasklist: 'MDIxODc1MzEwNzc4MzMxNDU2MTU6MDow'
  }).then(function (response) {
      console.log(response);
      var arr = response.result.items;
      console.log(arr);
      for(var j=0;j&lt;arr.length;j++){
          console.log(arr[j].title);
      }
  })
  }
  </code></pre>
  
  <p>But when I do the same using jQuery, I get 404 with the text "Login Requied" in the response body.</p>
  
  <pre><code>function getAllTasksJquery() {
  $.get("https://content.googleapis.com/tasks/v1/lists/MDIxODc1MzEwNzc4MzMxNDU2MTU6MDow/tasks",function (data,status) {
      console.log(data,status);
      var arr = data.result.items;
      console.log(arr);
      for(var j=0;j&lt;arr.length;j++) {
          console.log(arr[j].title);
      }
  });
  
  }
  </code></pre>
  
  <p>Can someone tell me what am I doing wrong ?</p>