I am trying to create a task and assigning it to me in ASANA using c#. Following is my JSON request that I am sending to ASANA
{"data":[{"assignee":"aaaa@bbb.com","name":"API Test","notes":"I am testing ASANA API","workspace":{"id":1234569789512,"name":"company.com"},"assignee_status":"inbox","due_on":""}]}
This is the response I get {"data":{"id":1234568,"created_at":"2014-10-24T20:41:02.839Z","modified_at":"2014-10-24T20:41:02.839Z","name":"","notes":"","completed":false,"assignee_status":"upcoming","completed_at":null,"due_on":null,"workspace":{"id":123456,"name":"company.com"},"num_hearts":0,"assignee":null,"parent":null,"hearts":[],"followers":[{"id":123456,"name":"MyFirstname MyLastname"}],"projects":[],"tags":[],"hearted":false}}
I don't see any tasks when I log on to ASANA. So I am not sure what it created where it created since there is no error but it does have an ID. But from the response it looks like it ignores name, notes and assingee_status that I am passing in the request. I thought [ and ] might be an issue as ASANA may not consider data as a top level element, so I removed it, matching the request as the response I am getting, but that caused a "Bad Request" error.
So I am not sure what I am doing wrong ?
Reading other post, i have checked the following, ContentType is application/json Web Request method is POST URL I am posting to is https://app.asana.com/api/1.0/workspaces/Workspace_ID/tasks
And I think my top level dictionary element is data. I am not good at JSON so this might be an issue of top level element, but I am not sure how to fix it.
Any suggestions or hint or guidance is greatly appreciated.
Thanks.
I removed the [ and ] and workspace: Here is the json request, But I get 400 Bad Request from the server {"data":{"assignee":"myemail@company.com","name":"API Test","notes":"Vivek is testing ASANA API","assignee_status":"inbox","due_on":""}}