smsgatewayme / client-php

PHP Client for smsgateway.me
26 stars 32 forks source link

how to make the callback api works? #23

Closed leogildo10 closed 3 years ago

leogildo10 commented 3 years ago

i am using the version 4, the last one in PHP, and it is sending messages fine, but now i want to get the messages that were sent to me, i can not do it becouse the callback lokks like it does not work. i am using this code: $createCallbackRequest = new CreateCallbackRequest([ 'name' => 'Test Callback', 'event' => 'MESSAGE_RECEIVED', 'deviceId' => 123456, 'filterType' => 'contains', 'filter' => 'hello', 'method' => 'HTTP', 'action' => 'http://mywebsite.com/sms-callback.php', 'secret' => 'SsshhhhNotASecret' ]);

$callback = $callbackClient->createCallback($createCallbackRequest); print_r($callback);

and in action field, i put my php in the server, that inserts a record in my mysql database just for test, but this callback does not call my php on the server. any one could make this clalback works? or have other way to get the messages taht came to the phone?

leogildo10 commented 3 years ago

i have found how to make it using: Messages - Searching SMS messages as explained in the documentation.