Follow these steps to start using SMS Gateway:
The SMS Gateway app allows you to send order updates, appointment reminders, marketing campaigns, and even OTPs directly from your mobile device. Whether you are a developer, business owner, or marketer, this tool provides a seamless way to integrate SMS functionality into your operations.
Additionally, we provide a free WooCommerce plugin that automates SMS notifications for e-commerce stores. This ensures your customers receive timely updates about their orders, shipments, and other important notifications.
Get started now and experience the flexibility of SMS Gateway!
https://api.smstext.app
Send an SMS message using the following endpoint:
POST https://api.smstext.app/push
Request Example:
{ "mobile": "+1234567890", "text": "Your order #1234 has been shipped!" }
Response Example:
[ "e1ca36e4-0574-4a73-b829-bfdc439bbbbf" ]
POST https://api.smstext.app/setCallback
Request Example:
{ "callbackUrl": "https://yourdomain.com/callback" }
Use Basic Authentication with your API Key:
Authorization: Basic base64_encoded(apikey:YOUR_API_KEY)
Python:
import requests headers = { "Authorization": "Basic base64_encoded(apikey:YOUR_API_KEY)" } data = { "mobile": "+1234567890", "text": "Hello!" } response = requests.post("https://api.smstext.app/push", json=data, headers=headers) print(response.json())
JavaScript (Node.js):
const axios = require('axios'); axios.post("https://api.smstext.app/push", { mobile: "+1234567890", text: "Hello!" }, { headers: { "Authorization": "Basic base64_encoded(apikey:YOUR_API_KEY)" } }).then(res => console.log(res.data));
PHP:
<?php $apiKey = "YOUR_API_KEY"; $headers = array( "Authorization: Basic " . base64_encode("apikey:" . $apiKey), "Content-Type: application/json" ); $data = json_encode(array( "mobile" => "+1234567890", "text" => "Hello!" )); $ch = curl_init("https://api.smstext.app/push"); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); echo $response; ?>
Below is the full PHP extension code (sms_gateway.php), which you need to include in your project:
<?php class SMSGateway { private $apiKey; private $apiUrl = "https://api.smstext.app/push"; public function __construct($apiKey) { $this->apiKey = $apiKey; } public function sendSMS($phoneNumber, $message) { $headers = array( "Authorization: Basic " . base64_encode("apikey:" . $this->apiKey), "Content-Type: application/json" ); $data = json_encode(array( "mobile" => $phoneNumber, "text" => $message )); $ch = curl_init($this->apiUrl); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); return $response; } } ?>
Include the file in your project and initialize it as follows:
include 'sms_gateway.php';
<?php $apiKey = "YOUR_API_KEY"; $sms = new SMSGateway($apiKey); $sms->sendSMS("+40712345678", "Your order #1234 has been confirmed!"); ?>
<?php $sms->sendSMS("+40712345678", "Reminder: You have an appointment on March 10 at 10:00 AM."); ?>
<?php $otp = rand(100000, 999999); $sms->sendSMS("+40712345678", "Your OTP code is: $otp"); ?>
This section explains how to integrate SMS Gateway with an XLSM file using VBA.
Follow these steps to configure Excel (XLSM) for SMS automation:
Sub SendSMSWithDelay()
Dim ws As Worksheet
Dim i As Integer
Dim phoneNumber As String, message As String, status As String
Dim http As Object, JSON As String
Dim intervalSec As Integer
Set ws = ThisWorkbook.Sheets("Sheet1")
intervalSec = 10 ' Set delay in seconds
i = 2 ' Start from the second row
While ws.Cells(i, 1).Value <> ""
phoneNumber = ws.Cells(i, 1).Value
message = ws.Cells(i, 2).Value
status = ws.Cells(i, 3).Value
If status <> "Sent" Then
JSON = "{""mobile"":""" & phoneNumber & """,""text"":""" & message & """}"
Set http = CreateObject("MSXML2.XMLHTTP")
http.Open "POST", "https://api.smstext.app/push", False
http.setRequestHeader "Content-Type", "application/json"
http.setRequestHeader "Authorization", "Basic " & Base64Encode("apikey:YOUR_API_KEY")
http.Send JSON
If http.Status = 200 Then
ws.Cells(i, 3).Value = "Sent"
Application.Wait (Now + TimeValue("00:00:" & intervalSec))
End If
End If
i = i + 1
Wend
End Sub
To run the script automatically:
SendSMSWithDelay
.Ensure there is a "Status" column in your sheet to prevent duplicate messages. The script marks messages as "Sent" after sending.
Use Debug.Print in VBA to check response errors.
Now, SMS automation with controlled intervals in Excel VBA is ready! 🎉
This section explains how to integrate SMS Gateway with Google Sheets using Google Apps Script.
Follow these steps to configure Google Sheets for SMS automation:
function sendSMSWithDelay() {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sheet1");
var data = sheet.getDataRange().getValues();
var intervalSec = 10; // Change interval (e.g., 10 seconds)
var properties = PropertiesService.getScriptProperties();
var lastProcessedRow = parseInt(properties.getProperty("lastProcessedRow")) || 1;
for (var i = lastProcessedRow; i < data.length; i++) {
var phoneNumber = data[i][0];
var message = data[i][1];
var status = data[i][2];
if (status !== "Sent") {
var options = {
"method": "post",
"headers": {
"Authorization": "Basic " + Utilities.base64Encode("apikey:YOUR_API_KEY"),
"Content-Type": "application/json"
},
"payload": JSON.stringify({
"mobile": phoneNumber,
"text": message
})
};
try {
var response = UrlFetchApp.fetch("https://api.smstext.app/push", options);
if (response.getResponseCode() === 200) {
sheet.getRange(i + 1, 3).setValue("Sent");
properties.setProperty("lastProcessedRow", i + 1);
Utilities.sleep(intervalSec * 1000);
}
} catch (e) {
Logger.log("Error sending to " + phoneNumber + ": " + e.toString());
}
}
}
properties.setProperty("lastProcessedRow", 1);
}
To send SMS messages automatically at intervals, create a trigger:
Ensure there is a "Status" column in your sheet to prevent duplicate messages. The script marks messages as "Sent" after sending.
Check logs in Apps Script by clicking View > Executions to debug errors.
intervalSec
to change
delay
between messages.Now, SMS automation with controlled intervals is ready! 🎉
https://yourwebsite.com/webhook-handler.php
)Use the following PHP script to process the webhook and send SMS notifications.
<?php // Read data from Shopify $data = json_decode(file_get_contents("php://input"), true); if (!$data) { http_response_code(400); exit("No data received."); } // Extract necessary details $customerPhone = $data['customer']['phone'] ?? null; $orderId = $data['id'] ?? null; $totalPrice = $data['total_price'] ?? '0.00'; if (!$customerPhone) { http_response_code(400); exit("No phone number found for customer."); } $smsMessage = "Comanda #$orderId a fost primită! Total: $$totalPrice. Vă mulțumim!"; $apiKey = "YOUR_API_KEY"; $apiUrl = "https://api.smstext.app/push"; $headers = [ "Authorization: Basic " . base64_encode("apikey:" . $apiKey), "Content-Type: application/json" ]; $postData = json_encode([ "mobile" => $customerPhone, "text" => $smsMessage ]); $ch = curl_init($apiUrl); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); file_put_contents("sms_log.txt", "Sent SMS to $customerPhone: $smsMessage\nResponse: $response\n", FILE_APPEND); http_response_code(200); exit("Webhook received and processed."); ?>
sms_log.txt
file to
confirm the message was sent.Integrate SMS Gateway with PrestaShop for real-time SMS notifications.
This method sends SMS immediately when a new order is placed.
Place this file on your server and configure the webhook in PrestaShop to call it.
<?php $data = json_decode(file_get_contents("php://input"), true); $phone = $data['customer']['phone']; $orderId = $data['id_order']; $message = "Order #$orderId has been received!"; $apiKey = "YOUR_API_KEY"; $apiUrl = "https://api.smstext.app/push"; $headers = [ "Authorization: Basic " . base64_encode("apikey:" . $apiKey), "Content-Type: application/json" ]; $postData = json_encode([ "mobile" => $phone, "text" => $message ]); $ch = curl_init($apiUrl); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); file_put_contents("sms_log.txt", "Sent SMS to $phone: $message\nResponse: $response\n", FILE_APPEND); ?>
Where to place this file?
Advantages: Instant SMS sending, no delay.