添加到 iAuditor 响应集请求有效负载 JSON 格式无效

问题描述

使用 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

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)