I am trying to add a due_on date during task creation with the Asana API and every time it spits out a server 500 error and a random, kinda humorous, message.. Here is an example of the api response when trying to add a task with a due_on or due_at value.
stdClass Object ( [errors] => Array ( [0] => stdClass Object ( [message] => Server Error [phrase] => 22 tough cobras kneel kindly ) ) )
Is there something going on with these date features? Maybe the 'YYYY-MM-DD' format I'm using (from the api docs) is not correct? When I remove this field I have no problems creating the task, that leaves me to believe the problem is only with the due_on and due_at fields. If i remove line 6 completely it will return a success.
Here is an example of the code that spits out the error:
$post_data = array(
'assignee' => $asana_user_id,
'notes' => $task_notes,
'followers[0]' => $asana_user_id,
'name' => 'Test Task',
'due_on' => '2015-09-03',
'workspace' => $workspaceID,
'projects' => $project_id
);
$curl = curl_init('https://app.asana.com/api/1.0/tasks');
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
'Authorization: Bearer '.$asanaApiToken
));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
$response = curl_exec($curl); // execute post to asana
print_r($response);
Any help is appreciated, thanks in advanced