How to get a specific project data using name parameter filter

Hi Everyone,

When i try to get project data using: https://app.asana.com/api/1.0/projects, I receive below data which contains 3 projects (All projects)

{
“data”: [
{
“gid”: “1XXXXXXXXXXXXXX4”,
“name”: “ABC”,
“resource_type”: “project”
},
{
“gid”: “1XXXXXXXXXXXXXX1”,
“name”: “DEF”,
“resource_type”: “project”
},
{
“gid”: “1XXXXXXXXXXXXXX2”,
“name”: “XYZ”,
“resource_type”: “project”
}
]
}

Is there a way i can get data for one project i.e DEF without passing the gid in the URI ?

I have tried these two options:

  1. api/1.0/projects/search?opt_fields=id&name=DEF
    • Error message : “message”: “project: Not a Long: search”
  2. api/1.0/projects?name=DEF

It would be a great help as i do not want process all projects to find right match every-time !

No way to do this I know of.

The search API is only for tasks, not projects.

You’d need the gid to only get back one project.

Thanks for the quick response.