简体   繁体   English

如何从Click Bank API和XML中列出产品详细信息?

[英]How to list out product details from click bank API and XML?

This is my sample code for click bank API unfortunately this script do not work 这是我的Click Bank API示例代码,很遗憾,此脚本无法正常工作

Here is the sample code: 这是示例代码:

 <?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:CLERK"));
$result = curl_exec($ch);
curl_close($ch);

print_r($result);
?>

If run this code following error has occur 如果运行此代码,则会发生以下错误

HTTP/1.1 400 Bad Request Date: Sat, 23 Feb 2013 05:24:10 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 HTTP / 1.1 400错误的请求日期:2013年2月23日星期六,格林尼治标准时间(GMT)服务器:Apache / 2.2.23(FreeBSD)mod_jk / 1.2.37 mod_ssl / 2.2.23 OpenSSL / 0.9.8x变化:接受编码连接:关闭传输编码:分块内容类型:文本/纯API调用(/api/rest/1.3/products/list)需要缺少的参数:[site] 1

https://api.clickbank.com/rest/1.3/products https://api.clickbank.com/rest/1.3/products

<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.clickbank.com/rest/1.2/debug");
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:CLERK"));
$result = curl_exec($ch);
curl_close($ch);

print_r($result);
?>

所需的“站点”参数应为Clickbank ID(也称为供应商)。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM