使用 https://developer.safetyculture.io/?shell#add-a-response
我有以下几点:
function addResponse(){
var url = 'https://api.safetyculture.io/response_sets/responseset_id/responses';
var myBody = {"label": "String To Add"};
var headers = {"Authorization" : 'Bearer ' + 'api_key'};
var params = {
'method': 'POST',
//'muteHttpExceptions': true,
'headers': headers,
'contentType': 'application/json',
'payload': myBody
};
UrlFetchApp.fetch(url, params);
}
我能够获得响应集 (https://developer.safetyculture.io/?shell#get-a-global-response-set),因此我知道 URL、Responseset_ID 和密钥是正确的。
Bad Request","message":"Invalid request payload JSON format"
我应该如何正确格式化 myBody
?