1

This is my sample code for click bank API unfortunately this script do not work

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

halfer
  • 19,824
  • 17
  • 99
  • 186
  • requires parameters which are missing : [site]1 - you're missing a parameter to the call, looks like it should be named 'site' – Nick Pickering Feb 23 '13 at 05:45
  • Hi @ Nicholas Pickering where we can pass a parameter 'site' and please give me a sample code for this? –  Feb 23 '13 at 05:57
  • Hi @ Nicholas Pickering what is a [site]1 parameter how can i get it Please Explain –  Feb 23 '13 at 06:02
  • I've written an answer for you - with a link to the API you are working with – Nick Pickering Feb 23 '13 at 06:04

2 Answers2

1

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);
?>
rinchik
  • 2,642
  • 8
  • 29
  • 46
Nick Pickering
  • 3,095
  • 3
  • 29
  • 50
  • Hi@ Nicholas Pickering replace this code follwing error has occur HTTP/1.1 403 Forbidden Date: Sat, 23 Feb 2013 06:34:17 GMT Server: Apache/2.2.23 (FreeBSD) mod_jk/1.2.37 mod_ssl/2.2.23 OpenSSL/0.9.8x Vary: Accept-Encoding Transfer-Encoding: chunked Content-Type: text/plain Access to account denied1 please help me –  Feb 23 '13 at 06:35
  • Did you replace www.domain.com with your website's URL? – Nick Pickering Feb 23 '13 at 06:51
  • 1
    @krishna let me know if it didn't. – Nick Pickering Feb 23 '13 at 07:31
  • Hi @ Nicholas Pickering i am using my domain name, but show the follwing error has occur HTTP/1.1 403 Forbidden Date: Sat, 23 Feb 2013 06:34:17 GMT Server: Apache/2.2.23 (FreeBSD) mod_jk/1.2.37 mod_ssl/2.2.23 OpenSSL/0.9.8x Vary: Accept-Encoding Transfer-Encoding: chunked Content-Type: text/plain Access to account denied1 please help me –  Feb 23 '13 at 07:43
  • 1
    @krishna run the code in my edited answer now instead of your code, and let me know what you get. – Nick Pickering Feb 23 '13 at 07:49
  • @krishna what is your website URL? – Nick Pickering Feb 23 '13 at 07:54
  • Hi @Nicholas Pickering www.osiztechnologies.com this is my websiteurl –  Feb 23 '13 at 09:35
  • 1
    Hi @Nicholas Pickering replace this script following information has displayed Header Parameters: Param:host, value :api.clickbank.com Param:accept, value :application/xml Param:authorization, value :DEV-0AA0863B00D0C8E3E4AAE3D39C59836B3333:API-189A6471A02308B646DFF780C015D2322FBB Param:content-length, value :0 Request Parameters: 1 please help me –  Feb 23 '13 at 10:26
0

The required "site" parameter should be the Clickbank ID (also known as vendor).

Tunaki
  • 132,869
  • 46
  • 340
  • 423