Christopher Masser
Christopher Masser

Reputation: 829

Google Tasks API: How can I find the TaskList of a Task?

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?

Upvotes: 0

Views: 1932

Answers (2)

Anthony Graglia
Anthony Graglia

Reputation: 5435

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.

Upvotes: 0

pinoyyid
pinoyyid

Reputation: 22296

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.

Upvotes: 1

Related Questions