Tasks on Project - All Fields?

Hey all,

I’m currently trying to download task details for my projects, but the API seems to be constructed in a way that I make a call to get a list of id/gid values, then make one call per item to retrieve the full details.

According to the API docs, I can tell the call to either include or expand the details for each field that I want returned. In order to do this, I need to explicitly specify every field name.

Is there a way to construct a call in a simple fashion, where I tell it to give me full details on each item returned?

As an example:

https://app.asana.com/api/1.0/projects/123/tasks/

I get objects in response that look like this:

{
	"data":
	[
		{
			"id": 123456789,
			"gid": "123456789",
			"name": "My First Task",
			"resource_type": "task"
		}, {
			"id": 23456789,
			"gid": "23456789",
			"name": "My Second Task",
			"resource_type": "task"
		}
	]
}

I want the full details of the task to come back in this call, so that I don’t need to make (in my case) 810 calls back to the API in order to retrieve details on everything.

Thank you in advance!

1 Like

Hi @Derek_Torrence and welcome to the forum!

Yes, you can get all tasks details in that call without having to query each task individually. To do that, construct your request so it looks something like this (you can choose which “opt in” fields you want to include, you don’t have to use the exact set I’m illustrating here):

https://app.asana.com/api/1.0/projects/123/tasks?opt_expand=.,followers,likes,likes.user,tags,is_rendered_as_separator,created_by

Thank you, @Phil_Seeman!

Then it sounds like we need to explicitly set the fields. I was hoping there would be ancient wisdom that helped me work around that :sweat_smile:

Thanks again!

1 Like