Create task 400 response code but no error data

Hi, so I’ve been having an issue attempting to create a task via the Asana API. I’m using PHP/cURL and most of the time the ability works but I’ve recently been experiencing 400 return codes via the following URL that I post to:-

Like I say I get a 400 response but no ‘error’ data with it as expected, to help narrow down the exact problem. My PHP debugging just says the response is ‘false’. The following is a snippet of what I’m debugging to see the 400 and response:-

$this->response = curl_exec($curl); = ‘false’
$this->responseCode = curl_getinfo($curl, CURLINFO_HTTP_CODE); = 400

Is there anything else I need to POST to the API to get a more coherent data response upon error?

Many thanks

Upon further investigation the create task returns NULL and fails to create the task. Before I attempt to create the task I create a project, which works successfully.

For reference here is the JSON I’m attempting to post to create the task:-

“name”:“Fixed Dev Task Name”,

Many thanks

So I managed to figure this out - seems as though you can’t have the ‘start_on’ and ‘due_at’ / ‘due_on’ fields having the same date information.

Hope this helps someone


@Ross_Grambo maybe this could be added to the API docs? :slight_smile:

Creating a task now :slight_smile:

1 Like