Domanda

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?

È stato utile?

Soluzione

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.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top