I have the following code for sending an API request from my Google App Script:
function sendApiRequest(query)
{
var sendQuery = JSON.stringify(query);
var options = {
'method' : 'post',
'headers' : {
'Content-Type': 'application/json',
'Authorization' : key
},
'payload' : sendQuery
};
var response = UrlFetchApp.fetch(apiUrl, options);
Logger.log(response);
return parseResponse(response);
}
When I’m trying to send a mutation query in order to update an item, I’m using the following query:
mutation {
change_multiple_column_values (board_id: 20178755, item_id: 200819371, column_values: “{"status": {"index": 1}}”) {
id
}
}
The problem is that in the column_values: "{\"status\": {\"index\": 1}}")
section I need to have double quotes wrapping my JSON.Stringfy values, which I’m just unable to make it happen.
The JSON Stringfy process either add escape or remove the quotes.
Could some please help?