Quote from clueadventures on February 21, 2019, 7:02 pmCan anyone recommend JS to make a phone call a defined number or send a predetermined SMS?
Can anyone recommend JS to make a phone call a defined number or send a predetermined SMS?
Quote from Deleted user on March 28, 2019, 2:43 pmHello @clueadventures, to send an SMS, you need to use a server side scripting language like PHP because Javascript will leak your confidential keys.
You need to create an account at an SMS/ Calling API provider like Twilio.com
After that visit Download SDK and download the sdk by clicking "Clone or Download" button. After downloading the zip, extract it and create a send-sms.php file in it and paste the below code.
<?php require __DIR__ . '/Twilio/autoload.php'; use Twilio\Rest\Client; $recepientNumber = $_POST['number']; $message= $_POST['message']; // Your Account SID and Auth Token from twilio.com/console $account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXX'; $auth_token = 'your_auth_token'; // In production, these should be environment variables. E.g.: // $auth_token = $_ENV["TWILIO_ACCOUNT_SID"] // A Twilio number you own with SMS capabilities $twilio_number = "+15017122661"; $client = new Client($account_sid, $auth_token); $client->messages->create( // Where to send a text message (your cell phone?) $recepientNumber, array( 'from' => $twilio_number, 'body' => $message ) );Make sure to replace account_sid & auth_token according to your twillio account's details.
After you have done all this, upload this folder to your server's public_html/htdocs folder
To send a message from VisualNEO Win, do the following:
InternetPost "http://your-website.com/send-sms.php" "number=[number]&message=[message]" "[Result]" ""
To send a message from VisualNEO Web, create a Form object.
If you don't have a server/website yet, you can google search for "free web hosting" and sign up to any service provider but once, your app is ready, you should move to a paid service provider (example - CloudNEO)
Hello @clueadventures, to send an SMS, you need to use a server side scripting language like PHP because Javascript will leak your confidential keys.
You need to create an account at an SMS/ Calling API provider like Twilio.com
After that visit Download SDK and download the sdk by clicking "Clone or Download" button. After downloading the zip, extract it and create a send-sms.php file in it and paste the below code.
<?php
require __DIR__ . '/Twilio/autoload.php';
use Twilio\Rest\Client;
$recepientNumber = $_POST['number'];
$message= $_POST['message'];
// Your Account SID and Auth Token from twilio.com/console
$account_sid = 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
$auth_token = 'your_auth_token';
// In production, these should be environment variables. E.g.:
// $auth_token = $_ENV["TWILIO_ACCOUNT_SID"]
// A Twilio number you own with SMS capabilities
$twilio_number = "+15017122661";
$client = new Client($account_sid, $auth_token);
$client->messages->create(
// Where to send a text message (your cell phone?)
$recepientNumber,
array(
'from' => $twilio_number,
'body' => $message
)
);
Make sure to replace account_sid & auth_token according to your twillio account's details.
After you have done all this, upload this folder to your server's public_html/htdocs folder
To send a message from VisualNEO Win, do the following:
InternetPost "http://your-website.com/send-sms.php" "number=[number]&message=[message]" "[Result]" ""
To send a message from VisualNEO Web, create a Form object.
If you don't have a server/website yet, you can google search for "free web hosting" and sign up to any service provider but once, your app is ready, you should move to a paid service provider (example - CloudNEO)