Anyone have Experience with the Batch API

I’m trying to Create a task with multiple subtasks and subsections
Additionally;

  • The task and subtask will have multiple custom fields
  • The subtasks and subsections will have to be in a certain order.

I’ve seen the Batch API documentation, I’m just a bit of a newb…
What would the JSON Request look like?
How would the request be submitted as a Form-Data request? (Postman/Zapier - this one’s not as important in my instance, but would be helpful)
Any tips would be appreciated :open_hands:

There’s a Postman collection of Asana endpoint examples that includes a Batch API example:

Please note that batch are not executed in a specific order.
So, if you need your subtasks to be in a precise order, you will need to add them one by one without batch.
Batch can be ok for custom fields.
Also, you can’t create a task + subtasks for that task in the same batch, for the same reason. The “parent” task should be created before creating subtasks, so batch is not an option.
Batchs are ok if order of execution is not important, and 1 item of the batch does not depends on another.

2 Likes

Yes, that is true

In which case, I would create the Parent and the subtasks thereafter.

Perhaps I could do a batch reorder using insert_before / insert_after although this might be a bit complex to do