0

Sending Messages via PHP

Hi All, I'm running into a problem with the PHP SDK. 

After supplying a $user and $message - I keep getting the following error

{"error":{"code":-1005,"detail":"Invalid Argument Error","description":"Invalid Argument Error"},"code":-1005}

include_once 'jymengine.class.php';

$engine = new JYMEngine(CONSUMER_KEY, SECRET_KEY, USERNAME, PASSWORD);
$engine->debug = true;

if ($engine->debug) echo '> Fetching request token'. PHP_EOL;
if (!$engine->fetch_request_token()) die('Fetching request token failed');

if ($engine->debug) echo '> Fetching access token'. PHP_EOL;
if (!$engine->fetch_access_token()) die('Fetching access token failed');

if ($engine->debug) echo '> Signon as: '. USERNAME. PHP_EOL;

if (!$engine->signon('xxx')) die('Signon failed');

print_r($engine->send_message('Yahoo_user_id','message'));

Thanks 

by
3 Replies
  • same problem here

    QUOTE(BRBissoon @ 8 Nov 2011 7:00 PM)
    Hi All, I'm running into a problem with the PHP SDK. 

    After supplying a $user and $message - I keep getting the following error

    {"error":{"code":-1005,"detail":"Invalid Argument Error","description":"Invalid Argument Error"},"code":-1005}

    include_once 'jymengine.class.php';

    $engine = new JYMEngine(CONSUMER_KEY, SECRET_KEY, USERNAME, PASSWORD);
    $engine->debug = true;

    if ($engine->debug) echo '> Fetching request token'. PHP_EOL;
    if (!$engine->fetch_request_token()) die('Fetching request token failed');

    if ($engine->debug) echo '> Fetching access token'. PHP_EOL;
    if (!$engine->fetch_access_token()) die('Fetching access token failed');

    if ($engine->debug) echo '> Signon as: '. USERNAME. PHP_EOL;

    if (!$engine->signon('xxx')) die('Signon failed');

    print_r($engine->send_message('Yahoo_user_id','message'));

    Thanks 
    0
  • Give it a few tries, after a while it started working and changed nothing in my code. Just kept hitting refresh.

    QUOTE(First Nameaa @ 13 Nov 2011 6:35 AM)
    same problem here

    QUOTE(BRBissoon @ 8 Nov 2011 7:00 PM)
    Hi All, I'm running into a problem with the PHP SDK. 

    After supplying a $user and $message - I keep getting the following error

    {"error":{"code":-1005,"detail":"Invalid Argument Error","description":"Invalid Argument Error"},"code":-1005}

    include_once 'jymengine.class.php';

    $engine = new JYMEngine(CONSUMER_KEY, SECRET_KEY, USERNAME, PASSWORD);
    $engine->debug = true;

    if ($engine->debug) echo '> Fetching request token'. PHP_EOL;
    if (!$engine->fetch_request_token()) die('Fetching request token failed');

    if ($engine->debug) echo '> Fetching access token'. PHP_EOL;
    if (!$engine->fetch_access_token()) die('Fetching access token failed');

    if ($engine->debug) echo '> Signon as: '. USERNAME. PHP_EOL;

    if (!$engine->signon('xxx')) die('Signon failed');

    print_r($engine->send_message('Yahoo_user_id','message'));

    Thanks 
    0
  • include_once 'jymengine.class.php';

    $engine = new JYMEngine(CONSUMER_KEY, SECRET_KEY, USERNAME, PASSWORD); $engine->debug = true;

    if ($engine->debug) echo '> Fetching request token'. PHP_EOL; if (!$engine->fetch_request_token()) die('Fetching request token failed');

    if ($engine->debug) echo '> Fetching access token'. PHP_EOL; if (!$engine->fetch_access_token()) die('Fetching access token failed');

    if ($engine->debug) echo '> Signon as: '. USERNAME. PHP_EOL;

    if (!$engine->signon('xxx')) die('Signon failed');

    print_r($engine->send_message('Yahoo_user_id',json_encode('message')));

    1

Recent Posts

in Messenger IM SDK