0

I'm trying to create a task with this JSON....

{
   "data":{
      "project":[

      ],
      "followers":[

      ],
      "workspace":{
         "id":14852,
         "name":"My Default"
      },
      "name":"This is test task",
      "assignee":{
         "id":14850,
         "name":"Steve Reich"
      }
   }
}

I'm getting the return error...

{
   "errors":[
      {
         "message":"workspace: Not an ID: [object Object]"
      }
   ]
}

Anyone know what I'm doing wrong?

davehale23
  • 4,374
  • 2
  • 27
  • 40
Steve Reich
  • 101
  • 1
  • 5

2 Answers2

2

(I work at Asana)

When you specify objects in the API, you just provide their IDs, not other meta-information. So it should be "workspace": 14852, not what you have. This goes for the assignee as well.

Also, you cannot at the moment specify projects during task creation - you must make a separate request via the addProject endpoint.

Greg S
  • 2,079
  • 1
  • 11
  • 10
  • Hi, this issue is still an issue. Your documentation clearly shows the way that the OP did it was the "right way". Please update the documentation. – ggdx Mar 05 '16 at 11:52
0

The response says the workspace ID you are using isn't valid. You aren't actually using 14852 as the workspace ID, are you? It certainly doesn't look like a valid ID.

You might verify that you have the right workspace ID with the query

https://app.asana.com/api/1.0/workspaces

  • No, the ID in my example is pseudocode. I'm using the correct workspace ID. I confirmed all of my ID's. I'm actually writing a wrapper for Coldfusion. – Steve Reich Oct 19 '12 at 18:05