Jump to content

Clickbank API -


glenelkins

Recommended Posts

Hi

 

For the life of me I cannot work out why the following code is returning the following error:

 

Request Entity Too Large

The requested resource

/api/rest/1.2/sandbox/prepare

does not allow request data with POST requests, or the amount of data provided in the request exceeds the capacity limit.

 

Additionally, a 413 Request Entity Too Large error was encountered while trying to use an ErrorDocument to handle the request.

 

The strange thing is the API needs a POST request and this is saying it is not allowed? The api document for this preparing of the sandbox is here: https://sandbox.clickbank.com/rest/1.2/sandbox

 

<?php

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.clickbank.com/rest/1.2/sandbox/prepare");
curl_setopt($ch, CURLOPT_HEADER, false); 
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/xml", "Authorization:DEV-219F7E04857FADEEDAC74A48E2CFAD6EBFEF:API-DDA02BA4D7F9C2F7CAD1E7C1BA0CE478B56A"));
$result = curl_exec($ch);
curl_close($ch);

print $result;
?>

Link to comment
Share on other sites

  • 4 months later...

 

Found your post via Google as I was  having the same problem.  In case you haven't solved it yet, it's because you need to use the host sandbox.clickbank.com, not api.clickbank.com.  ClickBank docs don't seem to mention this though (or at least I didn't see it).  So the actual request URL should be:

 

https://sandbox.clickbank.com/rest/1.2/sandbox/prepare

 

Hope that helps!

 

Link to comment
Share on other sites

  • 11 months later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.