I know there's a few errors on here regarding the new version of the API and the PHP wrapper, but I couldn't find one that matched my situation.
Basically, I'm trying to add a subscriber using this code:
require_once 'csrest_subscribers.php'; $wrap = new CS_REST_Subscribers('xxx', 'xxx'); $result = $wrap->add(array( 'EmailAddress' => $_POST[ "nlEmail" ], 'Name' => $_POST[ "nlName" ] ));
And am getting this error:
Warning: Missing argument 3 for CS_REST_Log::log_message(), called in /home/bridging/public_html/inc/class/transport.php on line 90 and defined in /home/bridging/public_html/inc/class/log.php on line 14 15:15:52 - 250: Error making request with curl_error: 1 Fatal error: Error making request with curl_error: Protocol https not supported or disabled in libcurl in /home/bridging/public_html/inc/class/transport.php on line 91
I know cURL is installed and operational on my server, as I use it elsewhere.
Has anyone experienced a similar error? Any help would be greatly appreciated.
Based on the error message it looks like your server doesn't have OpenSSL installed or the extension enabled in PHP. For a quick fix you can make calls over plain http by changing
CS_REST_Subscribers('177172795e37beda3d4d62cc023eaeea', '82acb1100d43ad98ca5bdd70ff3af72e', 'http');
however we'd definitely recommend using ssl to connect to the api and so you may need to install OpenSSL or enable the PHP extension. Instructions can be found here
Thanks, that did the trick. The next stumbling block was that I used the client's API key, rather than mine! Silly me.