SMS Integration Tutorial?

I haven’t integrated SMS with Wappler yet.
I already have a page that saves a form to a database & then sends an html email.
It would be a logical place to attach this SMS.php script –
& I thought of starting by copying the script into a Server Action folder & calling for it & then mapping the variables available from the send-email action.

But, the php files in Server actions are just json structure & this script is actually a PHP script.

I see questions about using different API scripts from different online SMS hosts but no overall Tutorial on the best Wappler steps to start with –

(I know curl is installed on my hosting account)

For those who have already done something similar would you give me some pointers?

Thank you!

I’m playing with API Action in the Server Actions

I’ve been looking at this but I’m not sure yet whether I recognize every thing that matches my script

Please check the documentation of the API you are using and use this in the API action:

1 Like

Thank you, Teodor
I’ve been looking at this before I posted this question

I put up an image of the SMS.php that was sent to me with the request to integrate into what’s already online.

I couldn’t find the exact match to the script I have in its PHP structure

When I try using the API connector in Wappler I’m not sure I’m extracting everything from this script correcty

or whether I can just use the script as is by calling for it and passing the values Wappler already knows about.

$vorwahl = $_POST[‘vorwahl’]

If you want to use your PHP file and not the API, you can link directly to your PHP script, set the method to POST and then define your variables there (the ones in the script using POST vars) and bind the $_POST to them, something like:

Now that I didn’t know. Presumably if your php script returns a json response it can be picked up by later stages of server connect?

It can be called directly using its URL and using post variables :slight_smile:

1 Like

I don’t understand what you are saying, Teodor –

Your screenshot is showing USING the API Action Properties method – at least the 1st step of the process

It’s what I showed in my own screenshot when I asked the question about using PHP scripts for SMS from Wappler.

I can’t read the entire URL — is this link pointing TO the “sms.php” script itself?

Is that how this API ACTION PROPERTIES form is utilized to simply pass along the {{$_POST.mobilephone}} & other values to the PHP sms script?

2nd question) Given that there are so many warnings about using the API method because it is invoked in the user’s browser — wouldn’t using a php script in the submitting page force a Server-side SMS execution – which is safer?

Yes exactly.

Well that is the url to your PHP script which you want to run … https://yoursite.com/your_own_php_script.php

I don’t understand what are you saying. The script is called by your server action, entirely on the server side. The step is added just after your send mail step.

1 Like

Since I didn’t have your answer yet on whether the URL actually pointed to the SMS script, I asked my 2nd question not knowing your answer.

So, you have confirmed my guess that the API form URL would force the SMS action to happen on my server, rather than executing from the user’s own browser and Internet Connection.

Thank you, Teodor!