No response from 'send' api call from PHP/CURL and it doesn't work
Hi guys. I am trying to send a message from a php script. I have copied the demo, with a few changes for SSL stuff, my script is below:
Firstly, what should the value for 'user' and 'password' be? the same I used to log into imified.com?
Can you see anything wrong with the script? I do not recieve any CURL or PHP errors, but the CURL call does not return any data and a message is not sent. any ideas??? I've removed the userkey and botkey for annymity, but I am happy to supply these if there maybe a problem with them? anybody else have a similar problem?
<?php
echo 'start...';
$url = 'https://www.imified.com/api/bot/';
$data = array(
'botkey' => 'botkey,
'apimethod' => 'send',
'userkey' => 'userkey, // char
'msg' => 'Hello User'
);
$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_USERPWD, 'user:pass'); curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch,CURLOPT_TIMEOUT,60);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,true);
curl_setopt($ch,CURLOPT_CAINFO,'../../../common/mozilla.pem');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
$xml = curl_exec($ch);
if(curl_errno($ch)) {
echo 'Curl error: ' . curl_error($ch);
} curl_close($ch);
print_r($xml);
echo 'end.';
?>
Comments are currently closed for this discussion. You can start a new one.
Support Staff 2 Posted by Adam Kalsey on 18 Jul, 2009 03:43 PM
I just provided an answer to the private message you sent a few minutes ago. There's no need to post your questions twice.
Curl isn't configured to use SSL. You can verify this by using a non-https url in your curl call.
Adam Kalsey closed this discussion on 18 Jul, 2009 03:43 PM.