- May 2, 2010
- 9,949
- 16,067
I was trying for a while to get rytr product descriptions working, and finally after no help from support really, I stumbled upon the solution.
Thought it might help someone as new to API's as me.
The original documentation is here. With samples for php.
The part that starts:
Needs to be replaced with
Support claimed that it works for them out of the box, but I found you need to make that local SSL location addition.
It didn't want to work when declaring the certificate check as false. So the certificate is defo required.
They also said if I couldn't figure it out, I should get a real PHP developer. So guess who's due a pay rise now!?
Big up to @TomTheCat for pointing me in the right direction, and helping me get started.
Thought it might help someone as new to API's as me.
The original documentation is here. With samples for php.
The part that starts:
Code:
curl_setopt($c, CURLOPT_HTTPHEADER, $headers);
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
$data = curl_exec($c);
Needs to be replaced with
Code:
//stays the same
curl_setopt($c, CURLOPT_HTTPHEADER, $headers);
curl_setopt($c, CURLOPT_RETURNTRANSFER, true);
//new
$certificate_location = 'C:\Program Files\PHP\extras\ssl\cacert.pem';
curl_setopt( $c, CURLOPT_CAINFO, $certificate_location );
curl_setopt( $c, CURLOPT_CAPATH, $certificate_location );
//new
curl_setopt($c, CURLOPT_VERBOSE, false);
curl_setopt($c, CURLOPT_HEADER, false);
curl_setopt($c, CURLOPT_SSL_VERIFYHOST, true);
//stays the same
$data = curl_exec($c);
Support claimed that it works for them out of the box, but I found you need to make that local SSL location addition.
It didn't want to work when declaring the certificate check as false. So the certificate is defo required.
They also said if I couldn't figure it out, I should get a real PHP developer. So guess who's due a pay rise now!?
Big up to @TomTheCat for pointing me in the right direction, and helping me get started.