Question

So i have the API documentation, i have it working as far as logging me in. When i try to send an error the class just has return true so that does not help much. The IM is not being sent so i changed the class to return why it is not being sent.

> Fetching request token > Fetching access token > Signon as: {MY_ACCOUNT}@yahoo.com >  {"error":{"code":-1005,"detail":"Invalid Argument Error","description":"Invalid Argument Error"},"code":-1005}

Trying to send the IM uses

$sendIm = $engine->send_message($toAddress, 'TEST');

print_r($sendIm);

I have tried

$toAddress = 'theirAddress';

AND

$toAddress = 'TheirAddress@yahoo.com';

Looking at http://developer.yahoo.com/messenger/guide/ch02.html shows that -1005 is a "bad argument", however there are only 2 passed into the IM function, to & msg, both of which are correct. Anyone else have this issue? Anyone with any ideas?

Was it helpful?

Solution

Ok, it is now figured out for anyone else who has this issue, in the class's "send_message" function

$postdata = '{"message" : '. $message. '}';

is WRONG and needs to be

$postdata = '{"message" : "'. $message. '"}';

Notice the quotes around $message. This is all it took! Simple typo in the API.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top