I've been working on using PHP with Curl to call various USPS api's...maybe someone that has done this can give me some pointers?
First, I started simple and set up a request to call the tracking api (TrackV2) and the results come back fine. I had to use rawurlencode(), otherwise, curl wouldn't pass the XML variable correctly.
However, when I try to call the RateV3 api, I get the following message :
" 80040b1a API Authorization failure. RateV3 is not a valid API name for this protocol. UspsCom:oAuth"
Here is my php code (of course I replaced the USERID field with dummy information )...maybe someone here on sitepoint that has successfully used the RateV3 api can offer some help / advice.
Thanks - and my cramped brain thanks you!
$request1 = <<< XMLREQUEST
$request = "http://testing.shippingapis.com/ShippingAPITest.dll?API=RateV3&XML=" . rawurlencode($request1);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $request);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_HTTPGET, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SLL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($ch);