Javascript “讯息”:&引用;处理请求时出错。”&引用;StackTrace";:&引用&引用&引用;例外类型";-JQUERY
这是我的代码,我不断得到相同的错误响应Javascript “讯息”:&引用;处理请求时出错。”&引用;StackTrace";:&引用&引用&引用;例外类型";-JQUERY,javascript,php,jquery,ajax,eloqua,Javascript,Php,Jquery,Ajax,Eloqua,这是我的代码,我不断得到相同的错误响应 "{"Message":"There was an error processing the request.","StackTrace":"","ExceptionType":""}" 我想不出来。我正在使用Eloqua API获取基本信息,如帐户总数、登录页、用户、图像等。这很奇怪,因为我在POSTMAN应用程序上尝试了该API,它确实工作得很好 PHP $objetos = array("data/accounts", "data/contacts
"{"Message":"There was an error processing the request.","StackTrace":"","ExceptionType":""}"
我想不出来。我正在使用Eloqua API获取基本信息,如帐户总数、登录页、用户、图像等。这很奇怪,因为我在POSTMAN应用程序上尝试了该API,它确实工作得很好
PHP
$objetos = array("data/accounts", "data/contacts", "assets/emails", "assets/landingPages", "assets/images", "assets/forms", "system/users", "assets/microsites", "assets/customObjects");
for ($i = 0; $i < 9; $i++){
$url = 'http://secure.p03.eloqua.com/API/REST/1.0/' . $objetos[$i] . '?count=1';
$ch=curl_init();
curl_setopt($ch,CURLOPT_URL,$url);
$headers = array(
'Content-type: application/json',
'Authorization: BASIC "MY TOKEN"'
);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_CAINFO, getcwd() ."/EloquaApi_lvl1.cer");
curl_setopt($ch, CURLOPT_POST, 0);
curl_setopt($ch, CURLOPT_HTTPGET, 1);
$data[$i] = curl_exec($ch);
curl_close($ch);
}
echo json_encode($data);
?>
控制台
尝试更改url
http://secure.p03.eloqua.com/API/REST/1.0/
到https
您可以将PHP的请求和响应添加到Eloqua吗?正文+标题+状态代码。。。
function getObjetos(){
$.get("objetos.php", function (data) {
console.log(data);
}, "json").done(function (data) {
console.log(data);
// rest of my code
}