Get Project Tasks - PHP/Laravel

Hi,

I am trying to access tasks relating to a project, but this seems to fail on my side.

I can access the tasks by running the below

$projects = $client->get('/projects', []);

But when trying to access tasks assigned to a project as per below, I can’t seem to get a return

$arr = $client->get('/projects/' . $projects[49] . '/task', []);

I get the following error when trying to dd the $arr

Object of class stdClass could not be converted to string

Also, it would be for all users and not one user on the platform.

https://developers.asana.com/docs/get-tasks-from-a-project

Try “/tasks” instead of “/task”

To get tasks from 1 users:
/users/xxx/tasks

But, you can’t get tasks of 1 users of 1 project using one of these methods. You will need to query the “search” endpoint of you need to do that without filtering results.

Hi Frederic, thank you, I will attempt to get the tasks using the search endpoint. Much appreciated