Sorry about the formatting. Seems attachments cause the signature to be added.

The attached files are a better comparison.

The PHP results in good returned data. The TAF gives an SSL handshake error.



To unsubscribe from this list, please send an email to lists...@terascript.com with "unsubscribe terascript-talk" in the body.
<?php

// Please replace YOUR_API_KEY with your key and YOUR_SITE_URL with your site domain.

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "https://www.transdirect.com.au/api/bookings/v4";);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);

curl_setopt($ch, CURLOPT_POST, TRUE);

curl_setopt($ch, CURLOPT_HTTPHEADER, array(
  "Content-Type: application/json",
  "Api-key: ef719cb2a34079ec5415b6a0a916afe5"
));

curl_setopt($ch, CURLOPT_POSTFIELDS, "{
 \"declared_value\": \"1000.00\",
 \"referrer\": \"ef719cb2a34079ec5415b6a0a916afe5\",
 \"requesting_site\": \"http://dev.anoguard.com\";,
 \"tailgate_pickup\": true,
 \"tailgate_delivery\": true,
 \"items\": [
   {
     \"weight\": \"38.63\",
     \"height\": \"0.25\",
     \"width\": \"1.65\",
     \"length\": \"3.32\",
     \"quantity\": 1,
     \"description\": \"carton\"
   }
 ],
 \"sender\": {
   \"address\": \"111 Ourimbah Rd\",
   \"company_name\": \"Byteserve\",
   \"postcode\": \"2088\",
   \"suburb\": \"Mosman\",
   \"type\": \"business\",
   \"country\": \"AU\"
 },
 \"receiver\": {
   \"address\": \"43 Waterfall Drive\",
   \"company_name\": \"Anoguard\",
   \"postcode\": \"2619\",
   \"phone\": 262559748,
   \"suburb\": \"Jerrabomberra\",
   \"type\": \"business\",
   \"country\": \"AU\"
 }
}");


$response = curl_exec($ch);
curl_close($ch);

echo "<pre>";
print_r(json_decode($response));
exit;



To unsubscribe from this list, please send an email to lists...@terascript.com with "unsubscribe terascript-talk" in the body.

Attachment: tdtest6.taf
Description: Binary data



On 11 Dec 2019, at 2:02 pm, Wayne Irvine <wa...@byteserve.com.au> wrote:

I’m still fighting with this. I enabled PHP and ran this sample code:



To unsubscribe from this list, please send an email to lists...@terascript.com with "unsubscribe terascript-talk" in the body. <api_call.php>

It returns good results.

I used exactly the same values in this TAF:



To unsubscribe from this list, please send an email to lists...@terascript.com with "unsubscribe terascript-talk" in the body. <tdtest3.taf>

Both are calling CURL with various options and headers and data. But different results.

Can anyone see what I am overlooking?

Wayne

On 6 Dec 2019, at 2:39 am, Robert Shubert <rshub...@tronics.com> wrote:

It's hard to say if updating cURL on the OS will break TS. When we build TS we do so against the prevailing cURL on our build system. Newer versions may or may not be compatible.
 
From: Wayne Irvine [mailto:wa...@byteserve.com.au] 
Sent: Wednesday, December 04, 2019 9:00 PM
To: TeraScript-Talk@terascript.com
Subject: Re: TeraScript-Talk: API no longer working. SSL error
 
Looking into this it appears the issue is with CURL on OSX not using OpenSSL but some proprietary code.
 
Solution seems to be to remove the native CURL and rebuild with a generic version. Just wondering if I have to tell Terascript anything about the new version. And will it break everytime I update the system?
 
Also puzzled as to why it worked for a few weeks then just stopped. I assume something changed, I just don’t know what.
 
Wayne
 
On 5 Dec 2019, at 12:28 pm, Wayne Irvine <wa...@byteserve.com.au> wrote:
 
I’m submitting some details to a courier’s API in an effort to get back a range of quotes. All was working correctly until just before I left for holidays.
 
The error is:
File: tdtest2.taf
Position: WebCall2
Class: Internal
Main Error Number: -1001

Unable to send data when processing URL request.
wrong when connecting with SSL SSL peer handshake failed, the server most likely requires a client certificate to connect
 
I assume there is some client certificate on the server that is out of date. I’m using OSX but assume the problem happens on all platforms. Any pointers?
 
Wayne Irvine
 
Byteserve Pty Ltd
w: http://www.byteserve.com.au/
e: i...@byteserve.com.au
p: +61 02 9960 6099   
m: 0409 960 609   
f: +61 02 9960 6088
 
 

To unsubscribe from this list, please send an email to lists...@terascript.com with "unsubscribe terascript-talk" in the body. 
 
Byteserve Pty Ltd
w: http://www.byteserve.com.au/
e: i...@byteserve.com.au
p: +61 02 9960 6099   
m: 0409 960 609   
f: +61 02 9960 6088
 
 

To unsubscribe from this list, please send an email to lists...@terascript.com with "unsubscribe terascript-talk" in the body. 


To unsubscribe from this list, please send an email to lists...@terascript.com with "unsubscribe terascript-talk" in the body.

Byteserve Pty Ltd
w: http://www.byteserve.com.au/
e: i...@byteserve.com.au
p: +61 02 9960 6099   
m: 0409 960 609   
f: +61 02 9960 6088



To unsubscribe from this list, please send an email to lists...@terascript.com with "unsubscribe terascript-talk" in the body.

Byteserve Pty Ltd
w: http://www.byteserve.com.au/
e: i...@byteserve.com.au
p: +61 02 9960 6099   
m: 0409 960 609   
f: +61 02 9960 6088



To unsubscribe from this list, please send an email to lists...@terascript.com with "unsubscribe terascript-talk" in the body.

Reply via email to