我目前正在尝试在 Zoho Desk 中运行一个自定义功能,该功能在创建工单时触发,针对由我们的 support@zoho... 电子邮件地址创建的工单,将收到的电子邮件转换为工单。
更具体地说,当电子邮件包含 JSON 附件时,我希望自定义函数能够读取附件并从附件中提取 JSON 数据。
这可能吗?有没有人成功过?
下面是我的代码,以为我在正确的轨道上,但遇到了下面的错误
//TicketID is set as an Argument for the custom function
ORGID = "********";
getthread = zoho.desk.getRelatedRecords(ORGID,"threads","tickets",TicketID);
threadid = getthread.getJSON("data").getJSON("id");
getthreadcontent = zoho.desk.getRelatedRecordById(ORGID,"threads",threadid,"tickets",TicketID);//.getJSON("content");
info getthreadcontent.getJSON("attachments").getJSON("name"); //Prints the Attachment Name (Works)
info getthreadcontent;//.getJSON("attachments").getJSON("href");//Prints the Attachment URL (Works)
response = invokeUrl
[
url: getthreadcontent.getJSON("attachments").getJSON("href")
type: GET
];
上面的代码返回这个错误:
{"errorCode":"UNAUTHORIZED","message":"You are not authenticated to perform this operation."}
任何帮助或指示将不胜感激:)