Not able to POST tag or task in Google Script

Running the following code gives error but don’t understand what is going wrong?

{“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:”}]}

function postTag() {
var res = UrlFetchApp.fetch(‘’, {
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

Try “payload” instead of “body” parameter, as seen in this example:,Object)

1 Like

That did the trick. Next question is how to add priority to a task when adding it. Should this be done in the tags field?

Never mind, found it in custom fields.

1 Like