Hi everyone,
I’m building an API integration to run Anaplan ALM syncs and send an email with each model’s sync result. After submitting a sync, I check its status using:
GET /2/0/models/{target_model_id}/alm/syncTasks/{sync_task_id}
Here are the relevant fields from the response:
{
"status": {
"code": 200,
"message": "Success"
},
"task": {
"taskId": "<task_id>",
"currentStep": "Complete.",
"result": {
"successful": true,
"sourceRevisionId": "<source_revision_id>",
"targetRevisionId": "<target_revision_id>"
},
"taskState": "COMPLETE"
}
}
Which field should I check to reliably confirm that the sync finished successfully?
Is task.result.successful = true sufficient, or should I also require task.taskState = "COMPLETE"?
My understanding is that the top-level status.code and status.message indicate whether the API request succeeded, rather than the sync itself. Is that correct?
Also, is task.result.successful absent while the sync is running, and does it return false when a completed sync fails?
Thanks!