Knowledgebase
[0] => An internal error occurred! on booking acknowledgement (PHP)
Posted by Axel Girgensohn on 24 June 2013 11:17 AM
The cause could be located in the header parameters. A partner came with the solution for PHP which requires the parameter lenght = 0.

In php you need to make the request to the complete url and send seperately an empty file with “CURLOPT_INFILE” and length/size with “CURLOPT_INFILESIZE”

Here is the example PHP code which might help you to debug:


$url = "https://safe.novasol.com/api/bookings/$bookingsnumber?action=acknowledge&company=nov&salesmarket=528&agency=$agencynumber&user=web";
$parameters = "";

$putString = stripslashes($parameters);

// Put string into a temporary file
$putData = tmpfile();

// Write the string to the temporary file
fwrite($putData, $putString);

// Move back to the beginning of the file
fseek($putData, 0);

$headers=array("key: $partnerkey");

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_PUT, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_INFILE, $putData);
curl_setopt($ch, CURLOPT_INFILESIZE, strlen($putString));

$data = curl_exec($ch);

(0 vote(s))
Helpful
Not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below (we use this to prevent automated submissions).