Вопрос

Google Tasks API:
I have the ID of a Task.
The user changes the TaskList of the Task.
How can I find the new TaskList?

Fetching all TaskLists and then going through all the tasks takes ages.
Is there no other way?

Это было полезно?

Решение

Disclaimer: I haven't tested this

To get a task, you need the tasklist ID and the task ID GET https://www.googleapis.com/tasks/v1/lists/tasklist/tasks/task

So if you list all of the tasklists, then try to get the task id from each in turn, I think that's your quickest method.

Другие советы

With Tasks items, the only way I have found so far to find the list it belongs to is to parse the 'selfLink' property of the item.

Like stated in the accepted answer, https://www.googleapis.com/tasks/v1/lists/tasklist/tasks/task is the format and you need to grab 'tasklist' which should be the id of the list that the item belongs to.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top