How to get the assignee of a task?

How can I get the assignee of a task from the API so I can save it as a string?

1 Like

Hi @Adam_Creed and welcome to the forum,

Hard to give a detailed response with the level of info provided, but assuming you have the task’s ID, use this call to retrieve the task’s information:

Assuming when you say “save it as a string” you’re referring to the assignee’s name, add the parameter opt_expand=assignee to the request URL; that will return the entire assignee object including the assignee name.

2 Likes

Hi @Phil_Seeman I’m a developer who struggles with connecting assignee id with the actual user… I will ask you a question in this thread, because I cannot post a question somehow…
I call https://app.asana.com/api/1.0/tasks/${task} and this gives me an assignee object with a gid and I assume that’s the ID of a User that is assigned to the task. But when I go to that user’s profile, in the link there’s different ID. I can’t connect the task to the actual assignee person. Maybe you could help me with this, please?
cc: @Forum-team

Correct!

To get the user, do this follow-up call to get the user’s info:
https://developers.asana.com/reference/getuser