jeudi 29 janvier 2015

Create an Asana task with External Data


I am having trouble creating an asana task with external data. I can create a task fine, but i can't figure out what the cocktail is to be able to use the "external" data that is mentioned in the documentation.



$.ajax({
url : global.task.url,
type: "post",
data: {
assignee: "my-email@hidden.com",
name: "Test task",
notes: "this is a note",
projects: 123123123123,
workspace: global.workspace,
external: {
"id": "test",
"data": "12345099"
}
},
beforeSend: function (xhr) {
xhr.setRequestHeader("Authorization", "Bearer " + "MY-TOKEN");
}
})


the above code results in a 500 bad request.


I have also tried sending external stringified, which results in the error "No matching route for request".


The code above works perfectly if i remove the "external" from data.


i will be the first to say i do not typically call APIs so i feel like i must be doing something silly. any help appreciated!





Aucun commentaire:

Enregistrer un commentaire