Hey, I’m trying to create a task using node asana API.
Everything works great if I’m specifying only projects: projectId
, but I need also specify the section, so my code is “memberships”: [
{“project”: 12345, “section”: 09876}
]
And I always getting this error: Error: Invalid Request
I think you must do 2 requests, first create your task in the project, then add task to the section.
You don’t set the section of the task, you add the task to the section, as described there:
I just tried it in our app to see how we do this and I found that we also pass the “projects” parameter. So, the post looks like:
{“data”:{“name”:“14h19”,“projects”:“123456”,“memberships”:[{“project”:“123456”,“section”:“456789”}]}}
But, when I tried without the “projects” parameter, I got a 400 bad request response, but in the response info, I got informations about what is going wrong:
“message=You should specify one of workspace, parent, projects”
So, you should look at the “body” of non-200 responses, sometimes they give informations about why it doesn’t work.
2 Likes
Wow Frederic, thanks a lot, it works, you really helped me.
1 Like