I wrote a Drupal 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 using WebHooks.
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?
My thinking right now is that I'll have to use the Unbounce WebHooks feature to send data to an app on my server, then send that, with credentials, to ReServe from there. Sure seems like a roundabout way to do it though.
--
You received this message because you are subscribed to the Google Groups "Webhooks" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webhooks+u...@googlegroups.com.
To post to this group, send email to webh...@googlegroups.com.
Visit this group at https://groups.google.com/group/webhooks.
For more options, visit https://groups.google.com/d/optout.