Hi team,
It seems that I encounter a problem for sending creating items request to Monday API with Apps script.
Here is my Apps script code :
let mutation = mutation {create_item(board_id: 802400041, group_id: "topics", item_name: "${dateString}",column_values: "{\"statut\":{\"index\":2}}"){id}}
;
let payload = {query: mutation};
let options = {
“headers”: headers,
“method” : ‘POST’,
“payload”: JSON.stringify(payload),
“muteHttpExceptions”: true
};
let response = UrlFetchApp.fetch(mondayUrl, options);
The stringified payload sent to the api :
{“query”:“mutation {create_item(board_id: 802400041, group_id: "topics", item_name: "13/1/2021 17:29:54",column_values: "{"statut":{"index":2}}"){id}}”}
And the api response:
response : {“errors”:[{“message”:“Parse error on ":{" (STRING) at [1, 117]”,“locations”:[{“line”:1,“column”:117}]}],“account_id”:5740895}
I’ve tried many modifications of the “mutation” variable, but get allways errors.
Any ideas to help me?
Thanks