I am trying to execute a simple POST request to create a task. I’m using Postman to do this. I can successfully execute this POST request if I use the x-www-form-urlencoded option for the request body. However, when I try to submit the request with the body as raw JSON, I get the following response:
{
“errors”: [
{
“message”: “You should specify one of workspace, parent, projects”,
“help”: “For more information on API status codes and how to handle them, read the docs on errors: Build an app with Asana”
}
]
}
Here is the JSON request body I’m trying to use (obviously i changed the value for “projects”):
{
“due_on”: “2019-10-11”,
“name”: “My first API task raw json”,
“notes”: “here are some notes”,
“projects”: 123456789
}
Can someone please let me know why I’m getting this error when I’ve clearly specified a project for the task to be created under? I’ve also tried these variants for the value of “projects”:
“projects”: [{123456789}]
“projects”: {123456789}
“projects”: [{“id”: 123456789}]