I am trying to create a task under a workspace in Asana.
Payload i have prepared to push to Asana:
{“data”:{“workspace”:{“resource_type”:“workspace”,“name”:“cm-focus.com”,“id”:967840855208084,“gid”:“967840855208084”},“notes”:“Creative Update notes”,“name”:“Creative Updates”,“assignee”:[{“resource_type”:“user”,“name”:“Pradip”,“id”:967839896278404,“gid”:“967839896278404”}]}}
But i am getting a error message as response :
{“errors”:[{“message”:“workspace: Not a valid GID type: "object".”,“help”:“For more information on API status codes and how to handle them, read the docs on errors: Build an app with Asana”}]}
I am not able to understand the reason as all the details available in the payload is correct.
Thanks Phil. That worked like magic however if i add another parameter to the request to associated with project , failing.
Sample Request Body : {“data”:{“workspace”:“967840855208084”,“projects”:[“967839896278404”],“notes”:“Creative Update notes”,“name”:“Creative Updates”,“assignee”:“967839896278404”}}
Response : {“errors”:[{“message”:“projects: [0]: Not the correct type”,“help”:“For more information on API status codes and how to handle them, read the docs on errors: Build an app with Asana”}]}
It’s mentioned in the API documentation that we need to send projects in form of array.
If you have an updated version of your last sample which is working now, it would be great if you could post it - just so others who come upon this post later can see the working sample. Thanks!
I’ve got same problem. Can’t create tast in Asana using API.
Creating tasks with integromat.com service.
The scenario in integromat was working fine, and I did nothing changed in it. But It started to show the Error and stopped creating tasks in Asana
I am making use of the Api Explorer calls to get my GID :
GET /projects?opt_fields=gid,name,owner&limit=10&workspace=1875855340xxxx
Then i am using that GID to try and create the new Task but still it fails with the same message :
projects: [0]: Not a valid GID type: number