Search code examples
asana

Unable to set due_on=null


I'm trying to remove a due date from a task using the following request:

curl --request PUT -u <KEY>: https://app.asana.com/api/1.0/tasks/<TASKID> -d "due_on=null"

and receive

{"errors":[{"message":"due_on: Day must be in yyyy-mm-dd format, not: null"}]}

What's the correct way to do it?


Solution

  • (I work at Asana)

    This is supposed to work - it appears to be a bug. This should be fixed in our push today (11/20/2012). Thanks for reporting the problem!

    Generally, in the API there are some fields which can take on the value of null in the JSON. When you use form-urlencoded parameters instead of a JSON content type, none of the values have specific types - they all come in as strings. In some places we weren't consistent about treating the string "null" as a real null value where it makes sense, like for due dates.