Best way to pull a milestone using API?


What is the best way to pull a milestone using API?

Hi @Jill_H,

In the Asana API, milestones are a subtype of task. As such, the documentation for milestones can be found within the tasks reference docs (sorry if this is confusing – I know it’s not necessarily intuitive that milestones are a type of task).

When fetching tasks, you can see if a task is a milestone by using the resource_subtype field.

For example, here’s how you could find all of the milestones in a particular project:
GET /projects/<project-id>/tasks?opt_fields=resource_subtype.

Here’s an example of a response when you include the resource_subtype field:

“data”: [{
“id”: 12345,
“gid”: “12345”,
“resource_subtype”: “milestone”
“id”: 678910
“gid”: “678910”,
“resource_subtype”: “default_task”
“resource_subtype”: “default_task”

You can then request a specific milestone task just as you would a normal default task:
GET /tasks/12345