When I try to create a task using the JSON below, I get this error:
{
"errors": [
{
"message": "tags: [0]: Not a valid ID type: object",
"help": "For more information on API status codes and how to handle them, read the docs on errors: https://asana.com/developers/documentation/getting-started/errors"
}
]
}
I tried without the tags property and it works. The expected format for Tags is the same as for other array properties (Memberships, Followers, etc.) so I'm not sure what I'm doing wrong. The project and tag both exist in the workspace.
JSON request:
{
"data": {
"due_on": null,
"assignee": null,
"workspace": 227967273629890,
"name": "API task test2 with tag",
"notes": "foo",
"followers": [],
"memberships": [{
"project": 317773627482488,
"section": 0
}],
"tags": [{
"id": 375539822976838,
"name": "Tag3"
}]
}
}
Note that I'm serializing a C# class and writing that to the request stream. It works if I don't add to the Tag array, but I'm not sure what's wrong with the format - it's the same as the Membership and Follower arrays, which work fine. I tried removing the name property from the Tag class, and changed id to object from string - same error:
[DataContract]
public class TaskToCreate
{
[DataMember]
public Data data { get; set; }
public class Follower
{
[DataMember]
public string id { get; set; }
}
}
[DataContract]
public class Data
{
[DataMember]
public string due_on { get; set; }
[DataMember]
public string assignee { get; set; }
[DataMember]
public long workspace { get; set; }
[DataMember]
public string name { get; set; }
[DataMember]
public string notes { get; set; }
[DataMember]
public TaskToCreate.Follower[] followers { get; set; }
[DataMember]
public Membership[] memberships { get; set; }
[DataMember]
public Tag[] tags { get; set; }
}
[DataContract]
public class Membership
{
[DataMember]
public long project { get; set; }
[DataMember]
public long section { get; set; }
}
[DataContract]
public class Tag
{
[DataMember]
public object id { get; set; }
}