Running the following code gives error but don’t understand what is going wrong?
Error:
{“errors”:[{“message”:“You should specify one of workspace”,“help”:“For more information on API status codes and how to handle them, read the docs on errors: Build an app with Asana”}]}
Code:
function postTag() {
var res = UrlFetchApp.fetch(‘https://app.asana.com/api/1.0/tags’, {
method: ‘post’,
headers: {
‘Content-Type’: ‘application/json’,
//‘Accept’: ‘application/json’,
‘Authorization’: 'Bearer ’ + access_token,
},
body : JSON.stringify({
“data”: {
“color”: “light-green”,
“name”: “Stuff to buy”,
“workspace”: “1154002117252059”
}
}),
muteHttpExceptions: true
});
Logger.log(res);
}