January 16, 2014, 9:00am
I want to have my yii app fetch information from an sms web hook.
The web hook pattern specification is as below:
Receiving SMS Messages
Say you set your webhook URL to //myapp/index.php?password=akabanga. If your Android phone receives the text message "Im gonna pop some tags" from "+250788123132" then TextIt will POST the following:
I want to use yii to extract the values of parameters from the POST, Perform some check on the text message and then store to database. I assume i should use yii webservice but i dont know how to go about it. Can anyone give me clue?
How do i extract the parameters from the request??
You mean, read them from the $_POST array? Like:
echo $_POST['event']; // outputs: mo_sms
January 16, 2014, 3:04pm
I wouldnt know if it would be available in the $_POST array. I was just given that parttern to get my values from it.
Assuming am reading it from a $_POST array, do i necessarily have to create a form to do that??
What form? A form model? You could, but it’s not a requirement.
January 24, 2014, 7:43pm
Thanks nineinchnick, i was able to get it done by checking the values of the $_POST array elements. I had to create an action under the controller that did that.
February 4, 2014, 9:54am
I have got the application working, thanks.
However when i uploaded it to the server, the $_GET and $_POST are empty when i tried to run it. On local host it behaves ok but on the server it fails to get any value from $_GET or $_POST.
What could be causing it??
…EDIT…My bad figured it out.