简体   繁体   English

调用Clickbank Web服务时出现404找不到错误

[英]404 Not found error while calling clickbank webservices

 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);
}

When above code is run I am getting below error : 当上面的代码运行时,我得到以下错误:

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 

Please someone help, I am struggling with this for last 1 week but no success. 请有人帮忙,我在过去1周内一直在为此苦苦挣扎,但没有成功。

After a long struggle found the solution. 经过长期的努力,找到了解决方案。 Use below code it worked for me. 使用下面的代码对我有用。

 <?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);
?>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从Zend Framework中的Jquery调用Controller Action时出现404(找不到页面)错误 - Getting 404 (Page Not Found) error while calling Controller Action from Jquery in Zend Framework 使用.htaccess时出现404 Not Found错误 - 404 Not Found error while using .htaccess htaccess:尝试 ErrorDocument 时出现 404 Not Found 错误 - htaccess: 404 Not Found Error While trying ErrorDocument 调用POST(找不到404)Google Calendar API时出错 - Error calling POST (404 Not Found) Google Calendar API Symfony 2:加载 URI 时找不到资源错误 - 404 错误 - Symfony 2: Resource not found error while loading URI - 404 error 尝试使用 ErrorDocument 处理请求时遇到 404 Not Found 错误 - A 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request 尝试使用ErrorDocument时出现404 Not Found错误 - Getting 404 Not Found error while trying to use ErrorDocument 加载Web调试工具栏时发生错误(404:未找到)? - An error occurred while loading the web debug toolbar (404: not found)? 登录到magento Ves Bakerop主题时出现404找不到错误 - 404 Not Found error While Login into the magento Ves Bakerop theme 尝试下载现有文件时出现 404 文件未找到错误 - 404 File Not Found Error while trying to download an EXISTING file
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM