I wrote a module to post JSON data to ReServe Cloud from our Drupal websites, and now people want me to connect from unbounce landing pages to ReServe.
The problem is, getting the data into Reserve requires authentication, so I do the interaction with cURL like so:
$ch=curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
// Authorization
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$data_string);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json',
'Content-Length: ' . strlen($data_string)));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$server_output = curl_exec ($ch);
curl_close ($ch);
It looks to me like all I can do with WebHooks is send to a url that doesn’t require authentication. Is this correct, or is there some way to send a username/password?