使用新Gmail主题时,Google Tasks API不提供有关任务完成的更新 [英] Google Tasks API does not give update about Task completion when New Gmail Theme used

查看:74
本文介绍了使用新Gmail主题时,Google Tasks API不提供有关任务完成的更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我使用以下链接创建了一个任务: https://mail.google.com/tasks/canvas

First I created a Task using below link: https://mail.google.com/tasks/canvas

然后我将其标记为已完成".当我使用以下命令检查API响应是否相同时: 服务> Tasks API v1> task.tasks.list [返回指定任务列表中的所有任务.] 我能够查看更新和找到我标记为完成的任务.

Then I marked it as Completed. When I checked the API Response for the same using: Services > Tasks API v1 > tasks.tasks.list [Returns all tasks in the specified task list.] I was able to view the updates & found the task i marked as complete.

但是,当我使用GMail的新建"界面(主题)进行相同操作时,发现上述API响应中根本没有完成更新的任务.

However when I did the same using New interface (theme) from GMail, I found that the task I updated with completion was not at all there in above API Response.

因此,当使用新Gmail主题"时,Google Tasks API不会提供有关任务完成的更新.我有什么想念的吗?还是Google Task API的最新主题错误?

Thus Google Tasks API does not give update about Task completion when New Gmail Theme used. Is there anything I missed or is it bug from Google Task API with Newly introduced theme?

推荐答案

本周,我也被同样的事情所困扰.但是我只是使用 https://developers.google.com/tasks/v1/reference/tasks/list 来向我展示我已完成的任务.在查看了他们的代码如何告诉task.tasks.list之后,他们希望获得已完成的和隐藏的项目(需要两个标志),我玩弄了我的代码,并从错误消息中了解到,在给出任务列表ID之后,我可以添加一个JavaScript对象文字,因此我从尝试此API"的代码中复制了一部分对象文字,以下代码可以正常工作.

I was held up by this same thing this week. but I just figured it out using the "Try this API" feature on https://developers.google.com/tasks/v1/reference/tasks/list which I got to show me my completed tasks. After looking at how their code told tasks.tasks.list that they wanted to be given the completed and hidden items (both flags were needed) I played around with my code and learned from error messages that after giving the tasklist ID, I could add a JavaScript object literal, so I copied part of object literal from the code of the "Try this API" and the following worked.

var tasks = Tasks.Tasks.list( taskListId, { showCompleted: true, showHidden: true } );
  if (tasks.items) {
    for (var i = 0; i < tasks.items.length; i++) {
      var task = tasks.items[i];
      Logger.log('Task with title "%s" and notes "%s" and status "%s" was found ' , 
                             task.title, task.notes, task.status );  
    }
  }

这篇关于使用新Gmail主题时,Google Tasks API不提供有关任务完成的更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆