我需要从点击银行的数码产品,所以我使用他们的API来获取产品,由他们给出的不幸给出的示例代码不工作,我使用curl要做到这一点,php中的Clickbank API?
代码如下:
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://api.clickbank.com/rest/1.3/products/list");
curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_HTTPGET, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/xml", "Authorization:DEV-KEY:API-KEY"));
$result = curl_exec($ch);
curl_close($ch);
print $result;
?>
,但我得到了以下错误
HTTP/1.1 400 Bad Request Date: Thu, 21 Feb 2013 05:20:47 GMT Server: Apache/2.2.23 (FreeBSD) mod_jk/1.2.37 mod_ssl/2.2.23 OpenSSL/0.9.8x Vary: Accept-Encoding Connection: close Transfer-Encoding: chunked Content-Type: text/plain The API call (/api/rest/1.3/products/list) requires parameters which are missing : [site]1
有任何一个之前得到这个错误?
您是否知道您发布您的访问凭据公开在互联网上? – Thorsten 2014-05-03 21:56:05