0

When I use

https://app.asana.com/api/1.0/workspaces/workspace-id/tasks -d "name=this is a new task"

and then also using the POST method... I get a response, but nothing is created in asana...

This is the response in JSON format

{"data":{"id":5480677401703,"created_at":"2013-05-17T12:55:21.298Z","modified_at":"2013-05-17T12:55:21.298Z","name":"","notes":"","completed":false,"assignee_status":"later","completed_at":null,"due_on":null,"workspace":{"id":1337166104874,"name":"mecad.co.za"},"assignee":null,"parent":null,"followers":[{"id":1337166104857,"name":"Andries Koorzen"}],"projects":[],"tags":[]}}

But I don't see anything in asana

ollo
  • 24,797
  • 14
  • 106
  • 155
Andries Koorzen
  • 131
  • 2
  • 11

2 Answers2

2

I guess you may have problem with the server itself. You would better start the ISS. Rather, you can control the postLinkClicked method to see if there is a problem.

0

(I work at Asana) Where do you expect the task to show up? You have not given your new task an assignee or a project, so it will not show up in your My Tasks list, nor will it show up under any project. Try setting something in the assignee or project field.

But it also looks like you have a problem specifying details for the task, since you're attempting to pass a name but it's not being accepted by the system. My guess is something about the way you're doing this is not actually sending the correct POST data to the Asana API.

Greg S
  • 2,079
  • 1
  • 11
  • 10
  • thanks for the feedback. My understanding from the documented API is that creating new tasks using my API key would create the task in the workspaceID specified, automatically assigned to me. How can I specified different fields in the same datablock? Do I seperate them with ';' or ','. I remember reading about it somewhere, but I can't find it again. Thank you in advance – Andries Koorzen May 20 '13 at 07:22
  • If i use -d "name=this is a new task, project=1337166104876, assignee=1337166104857" then I get response {"data":{"id":5501541005568,"created_at":"2013-05-20T07:46:33.160Z","modified_at":"2013-05-20T07:46:33.160Z","name":"","notes":"","completed":false,"assignee_status":"later","completed_at":null,"due_on":null,"workspace":{"id":1337166104874,"name":"workspacenameHere"},"assignee":null,"parent":null,"followers":[{"id":1337166104857,"name":"UsernameHere"}],"projects":[],"tags":[]}} – Andries Koorzen May 20 '13 at 07:48
  • What I don't understand is that the response is not an error. Which means that if I do a search in Asana, it should still give me a task called 'this is a new task' regardless of whether it is assigned to me or not, since the creation date is returned. Or is my thinking incorrect here? – Andries Koorzen May 20 '13 at 07:52
  • I will look at the code, but up until now I've only been GETing data (without any problems), not POSTing. So yeah..maybe there is something wrong with the code – Andries Koorzen May 20 '13 at 07:54
  • Am I correct in specifying parameters -d "name=newTask,assignee=assigneeNo,project=projectNumber" regards – Andries Koorzen May 20 '13 at 13:24
  • POST parameters can either be specified with a URL encoded scheme, or as JSON. Have you looked at the examples in the API documentation? If you pass the application/x-www-form-urlencoded header then you would set data as name=new%20task&assignee=me for example. – Greg S May 21 '13 at 04:40
  • Thanks @greg_s for your response. I eventually figured out that the mistake I was making was seperating the fields using a comma ',' and not an ampersand '&' – Andries Koorzen May 24 '13 at 09:46