Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 使用Freshdesk api创建票证,响应始终为{“注销”:“成功”}_Jquery_Json_Logout_Freshdesk - Fatal编程技术网

Jquery 使用Freshdesk api创建票证,响应始终为{“注销”:“成功”}

Jquery 使用Freshdesk api创建票证,响应始终为{“注销”:“成功”},jquery,json,logout,freshdesk,Jquery,Json,Logout,Freshdesk,嗯,我尝试了Freshdesk api()中提到的每一件事来创建新的票证,但没有成功 下面是我在RESTClient中创建票证的步骤: 方法:邮政 网址: 标题: 内容类型:application/json 授权:(使用APIKEY:X的基本授权) 请求机构: { "helpdesk_ticket":{ "description":"I am not able to create this ticket... bla bla bla", "subject":"Urge

嗯,我尝试了Freshdesk api()中提到的每一件事来创建新的票证,但没有成功

下面是我在RESTClient中创建票证的步骤:

方法:邮政 网址:

标题: 内容类型:application/json 授权:(使用APIKEY:X的基本授权)

请求机构:

{
  "helpdesk_ticket":{
      "description":"I am not able to create this ticket... bla bla bla",
      "subject":"Urgenta",
      "email":"toma@outerworlda.com",
      "priority":1,
      "status":2
  },
  "cc_emails":"rama@freshdeska.com,diana@freshdeska.com"
}
以下是回应:

{
    "logout": "success"
}

我也尝试过使用curl命令创建新的票证,但最终得到了类似的结果。

您使用的是restclient浏览器加载项吗?或者您是否正在使用任何脚本? 我来自Freshdesk,刚刚尝试分析这个问题,一切看起来都很好,并且能够在您的帐户上使用API创建一个票证

请尝试下面的curl命令,如果问题仍然存在,请告诉我。 只需使用配置文件设置中的API密钥替换API密钥即可

curl -u APIKEY:X -H "Content-Type: application/json" -d '{ "helpdesk_ticket": { "description": "I am not able to create this ticket... bla bla bla", "subject": "Urgenta", "email": "toma@outerworlda.com", "priority": 1, "status": 2 }, "cc_emails": "rama@freshdeska.com,diana@freshdeska.com" }' -X POST https://milliontech.freshdesk.com/helpdesk/tickets.json

为了避免这种反应

{
    "logout": "success"
}
并成功创建票证


只要在每次创建新票证时清除浏览器的缓存(如果您使用的是Mozilla或Chrome中的RESTClient)

希望这对以后的其他人有所帮助,即使在清除缓存后注销成功消息也有问题,也开始出现内部500错误,但在咨询Freshdesk支持后,此代码对我有效:

(函数($){
变量设置={
“异步”:true,
“跨域”:正确,
“url”:”https://company.freshdesk.com/helpdesk/tickets.json", 
“类型”:“职位”,
“headers”:{“authorization”:“BasicAuthKey”,“Content Type”:“application/json”},
“数据”:“{\r\n\”帮助台\u票证\“:{\r\n\”说明\“:“有关问题的一些详细信息…”,\r\n\“主题\:“需要支持…”,\r\n\“电子邮件\:\”tom@outerspace.com\“,\r\n \“优先级\”:1、\r\n \“状态\”:2\r\n}、\r\n \“抄送电子邮件\”:”youremail@gmail.com\“\r\n}”
} 
$.ajax(设置).done(函数(响应){
控制台日志(响应);
});

}(jQuery))
感谢阿诸那的回答,但这没有什么帮助,因为我在问题中已经提到,我已经测试了curl命令来创建票证,当然是的,我使用了我自己的APIKEY和我自己的公司URL,并以https作为前缀。在找到这个线程之前,我花了一个小时试图解决同样的问题!要确认,清除缓存是有效的。我使用的是高级Rest客户端Chrome插件。浏览器似乎正在将“Cookie”标题添加到请求中,从而导致
注销:成功
响应。从请求中删除此标头会导致成功创建票证。