SendMessage api doesn't work
Hi,
I'm use SendMessage api, XML result say "<...rsp stat="ok"><....success msg='sent'/></....rsp>" but the message is not delivered.
My code;
function send_msg($msg, $user, $userkey)
{
$botkey = '***mybotkey***';
$url = 'https://www.imified.com/api/bot/';
$data = array(
'botkey' => $botkey,
'apimethod' => 'send',
'userkey' => $userkey,
'msg' => $msg,
'network' => 'MSN',
'user' => $user
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_USERPWD, 'username:password');
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
$xml = curl_exec($ch);
curl_close($ch);
return $xml;
}
echo send_msg('msg', '***@yyy.zzz', '***userkey***');
this return "<.. rsp stat="ok"><..success msg='sent'/><../rsp>" but message is not delivered.
Please help...
2 Posted by alwi on 17 Apr, 2010 03:29 PM
use your im client and see if your bot is online or not
if you still testing your bot, try delete that bot and create a new one, it worked for me once.
3 Posted by rob on 17 Apr, 2010 05:16 PM
i'm seeing the same thing.
actually when testing, the messages were sending fine for the first 2 messages - around 12:45 pm or so, but then about 15 mins later, they stopped working
I get a success each time: ie.
Both IM accounts + bots are online, i can converse with the bots fine, but if i attempt to send a message manually through this API, they don't recieve the message.
4 Posted by rob on 17 Apr, 2010 05:20 PM
Also, like to add, that this issue which is affecting me too is over MSN too -
i'm not passing network or user in the data dictionary, just botkey + userkey - it did work for me for a few minutes but then stopped working
i haven't taken my bot offline as it seem to be responding still
5 Posted by Musa AVCI on 17 Apr, 2010 05:23 PM
In fact there is no problem. just message that coming much later. unstable problems. I do not understand why
6 Posted by rob on 17 Apr, 2010 05:28 PM
wow, you're right. just now, i got spammed by myself, all my messages came all at once.. 3 to one msn, and 4 to the other.. crazyness!!
it was like a 30 minute delay :)
7 Posted by alwi on 17 Apr, 2010 05:34 PM
somewhere i read in this forum, < rsp stat="ok" > doest guarantee that message will be delivered because there's no way imified server to control the delivery. It means that imified system is successfully send your message. after that depends on among other things is the proprietary network (MSN in your case).
8 Posted by Musa AVCI on 17 Apr, 2010 05:36 PM
yeah I've had the same :D
imified very sluggish , but it does not erase it may never be. Although it is submitted late :D