can't send messages by using cURL

antaresteleko's Avatar

antaresteleko

30 Sep, 2011 03:42 PM via web

Hi all,

I have been using the imified bot service for a couple of months with no problems, but since a few days ago my PHP application is unable to control my imified bot for sending messages via curl. This is very weird since I have not made ANY changes in the system. It simply changed its bahaviour.

I have also written the following test function that I run to verify the PHP code with no success either:

function test(){

$url = 'https://www.imified.com/api/bot/'; 

$data = array(
    'botkey' => 'XXXXXXXX-XXXX-XXXX-B15193FF9E6BXXXX',
    'apimethod' => 'send',
    'userkey' => F15D7F92-C0D7-4B89-XXXXXXXXXXXXXXXX',
    'msg' => 'test',
    'network' => 'Gtalk',
);
echo print_r($data).'<br>';
//  mandamos el mensaje y obtenemos la respuesta en formato XML

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_USERPWD, 'my_imified_username:myimifiedpass');
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);    // to avoid CA cert problems
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
$xml = curl_exec($ch);

if (curl_error($ch)) {
    print "ERROR ". curl_error($ch) ."\n<br/>";
}
curl_close($ch);

//echo $xml; } test();

Any thoughts?
Many thanks in advance.

  1. 2 Posted by Paulo on 30 Sep, 2011 05:16 PM

    Paulo's Avatar

    The bot service seems to be instable from here :(
    But, try add this code:

    curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);

  2. 3 Posted by Dave Hoff on 06 Oct, 2011 02:16 PM

    Dave Hoff's Avatar

    Did Paulo's suggestion help to resolve this issue? There have been no recent changes on our end. You can also skip using ssl.

    Dave

  3. 4 Posted by Federico Linares on 06 Oct, 2011 10:40 PM

    Federico Linares's Avatar

    Hello Dafe, Paulo,

    many thanks for your support. I have tried to test what you sugested

    curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);

    but unfortunately the bot seems to be offline... I will try again later.

    Regards,

    Federico.

    El 06/10/2011 16:16, Dave Hoff escribió:

  4. 5 Posted by Federico Linares on 10 Oct, 2011 08:36 AM

    Federico Linares's Avatar

    Hi guys,

    today the bot was online again and I had the opportunity to find out
    what it was actually going on. I have discovered that somehow, and for
    some reason, google has changed my userkeys. Therefore I wasn't able to
    recieve any notifications in my GTalk accounts from the IMified bot.

    I hope this helps others with similar issues.

    I want to thank you guys for your support and interest on this.

    Cheers,

    Federico.

    El 06/10/2011 16:16, Dave Hoff escribió:

Reply to this discussion

Internal reply

Formatting help or Preview

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.