Php 404调用clickbank Web服务时未找到错误

Php 404调用clickbank Web服务时未找到错误,php,rest,clickbank,Php,Rest,Clickbank,当运行上述代码时,我得到以下错误: error_reporting(E_ALL); ini_set("display_errors", 1); $ch = curl_init(); //$qry_str='?&type=RFND&comment="API refund check"&reason=ticket.type.cancel.7&refundType=FULL'; // curl_setopt($ch, CURLOPT_URL, 'https://api

当运行上述代码时,我得到以下错误:

 error_reporting(E_ALL);
ini_set("display_errors", 1);
$ch = curl_init();
//$qry_str='?&type=RFND&comment="API refund check"&reason=ticket.type.cancel.7&refundType=FULL';
// curl_setopt($ch, CURLOPT_URL, 'https://api.clickbank.com/rest/1.3/tickets/N5GNE72J/'.$qry_str);
//https://api.clickbank.com/rest/1.3/tickets/RRBKQV4E/?type=rfnd&comment=&reason=ticket.type.refund.7&refundType=FULL
//curl_setopt($ch, CURLOPT_URL, "https://api.clickbank.com/rest/1.3/tickets/RRBKQV4E");

curl_setopt($ch, CURLOPT_URL, "https://api.clickbank.com/rest/1.3/tickets/RRBKQV4E/?type=RFND&comment=&reason=ticket.type.cancel.7&refundType=FULL");

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, '180');
curl_setopt($ch, CURLOPT_HEADER, true); 
curl_setopt($ch, CURLOPT_HTTPGET, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/xml","Authorization:DEV-B4VTK7HDKAPDR9842SODK8GI49KAHTHL:API-59RD4F7BORDB7SELOII28DV0EMLIB3IT"));

$result = curl_exec($ch);

$errorCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$curlInfo = curl_getinfo($ch);
$curlError = curl_error($ch);
if(curl_errno($ch))
{
    echo 'error:' . curl_error($ch);
}

请有人帮忙,我在过去的一周里一直在努力解决这个问题,但没有成功。

经过长期的努力,我找到了解决办法。使用下面的代码,它为我工作

HTTP/1.1 404 Not Found 
Date: Thu, 14 Aug 2014 08:14:19 GMT 
Server: Apache/2.2.27 (FreeBSD) mod_jk/1.2.40 mod_ssl/2.2.27 OpenSSL/0.9.8y 
Content-Length: 363 
Vary: Accept-Encoding 
Content-Type: text/html 


这不是关于你的代码,而是关于你的链接。它确实返回一个404错误快速查看API,它似乎在等待一个整数而不是票证id的字符串。对于
https://api.clickbank.com/rest/1.3/tickets/RRBKQV4E
您可以获得404,但对于
https://api.clickbank.com/rest/1.3/tickets/456
您得到403,这意味着它可以工作。。。
 <?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,
    "https://api.clickbank.com/rest/1.3/tickets/627JE7CZ/?type=rfnd&comment=&reason=ticket.type.refund.7&refundType=FULL");
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
/**
 * ClickBank doesn't allow POST parameters to be sent in; however, for the CURL POST to work correctly, the
 * CURL_POSTFIELDS option must be set, so we'll just set it to empty and put all our request parameters on the URL
 */
curl_setopt($ch, CURLOPT_POSTFIELDS, "");
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    "Accept: application/xml",
    "Authorization:DEV-enter your dev key here:API-enter your clerk key here"
));
$result = curl_exec($ch);
curl_close($ch);
?>