You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Zoho Survey触发函数invokeurl返回.json文件名而非内嵌JSON的问题

问题:Zoho Survey触发函数调用API无法直接获取Survey唯一URL

我需要在Survey 1的提交触发函数中,用提交的Response ID调用Zoho Survey API生成Survey 2的唯一URL,并写入关联的Zoho Sheet。

  • 在PowerShell/curl中调用同一个API端点,能正常返回包含unique_url的JSON数组
  • 但用Deluge的invokeurl调用时,虽然返回码200,responseText却是类似1771452061360.json的时间戳文件名,不知道这个文件的托管位置,也没法获取内容
  • 尝试用isFile(resp)判断返回结果是否为文件,日志显示resp is NOT a file,无法通过getFileContent()获取内容

现寻求获取该JSON文件内容的方法,或者直接获取unique_url/short_unique_url的替代方案。

当前Deluge代码

// Get URL
responseId = survey.get("responseId");
respondentsList = List();
oneRec = Map();
oneRec.put("id", responseId.toString());
respondentsList.add(oneRec);

payload = Map();
payload.put("respondentsList", respondentsList);

resp = invokeurl
[
url : "[survey url]"
type : POST
parameters : payload.toString()
content-type : "application/json"
headers : {"Accept":"application/json"}
detailed : true
connection : "surveyhub"
];

// Write to Zoho Sheet
rowData = Map();
rowData.put("Response ID", responseId.toString());
rowData.put("URL for informed consent survey", ifnull(resp, "<NULL>").toString());

queryData = Map();
queryData.put("header_row", 1);

resp2 = zoho.sheet.createRecords(
"ahwg8d7233dc136d1410b98214920b1b551da",
"Sheet1",
rowData,
queryData,
"sheetsurvey"
);

Zoho Sheet返回内容

{
  "responseText": "1771452061360.json",
  "responseHeader": {
    "date": "Wed, 18 Feb 2026 22:01:01 GMT",
    "server": "ZGS",
    "content-length": "286",
    "set-cookie": "aprmjrnpkcrkks=61ca4324-3c5f-4ffe-9e2e-bdf1bfaea88c;path=/;SameSite=None;Secure;priority=high",
    "expires": "Thu, 01 Jan 1970 00:00:00 GMT",
    "x-content-type-options": "nosniff",
    "x-frame-options": "SAMEORIGIN",
    "content-type": "json;charset=UTF-8",
    "connection": "keep-alive",
    "cache-control": "private,no-cache,no-store,max-age=0,must-revalidate",
    "pragma": "no-cache",
    "strict-transport-security": "max-age=64072000; includeSubDomains; preload"
  },
  "responseCode": 200
}

尝试添加的判断代码

if(isFile(resp))
{
    fileContent = resp.getFileContent();
    info "fileContent = " + ifnull(fileContent,"<NULL>").toString();
}
else
{
    info "resp is NOT a file";
}

日志返回:resp is NOT a file

内容的提问来源于stack exchange,提问作者pakalla

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.11 13:04:54