Task not found error

I have a php script that sets a task’s status to Complete and populates the Completion Date field. However, for some random tasks I get the error:

'Client error: GET https://api.infusionsoft.com/crm/rest/v1/tasks/848069?access_token=XXXX resulted in a 404 Not Found Task not found.

The taskID is added as a parameter to the php script and then pulled into the function. It is being transferred properly because you can see it in the error above. This is the function that completes the given task:

function completeTask($infusionsoft){

$id = $_GET['id'];

$task = $infusionsoft->tasks()->find($id);
$task->completed = true;
$task->save();

}

I tested the REST API on the developer page with the same taskID above and still come across the same error. I’ve searched task reports in Infusionsoft to make sure my taskID was correct and it is, and can be found through my Infusionsoft App Task Report:

All that being said, it seems like this only effects random tasks and is few and far between but an issue nonetheless. Any ideas on what may be causing this or what I can do to fix?

The returned result should only be a 404 if the object is not found; if you continue to experience intermittent issues I would recommend filing a ticket with API Support at Create a Support Ticket - Keap Developer Portal so that we can address it directly.

1 Like