Welcome to our SMS messaging API documentation! This API provides a simple and efficient way to send text messages programmatically. Integrate it into your applications to automate notifications, confirm transactions, or create personalized user experiences.
To use this API, you'll need a unique API key. This key is automatically generated when you register and must be included in every request.
Send message: https://api.smstext.app/push
POST
Type: Basic Auth
Username: apikey
Password: [YOUR_API_KEY] (replace with your actual API key)
[
{
"mobile": "+40763XXXXXX", // Recipient's phone number (international format)
"text": "Your message" // Message content
}
]
curl --location 'https://api.smstext.app/push' \
--header 'Content-Type: application/json' \
--data '[
{
"mobile": "+40763XXXXXX",
"text": "Hello! This is a notification."
}
]'
Format: The response typically does not contain additional data.
The API is relatively simple, allowing you to send SMS messages via an HTTP POST request. Authentication uses Basic Auth, and data is formatted in JSON.
import requests
def send_sms(api_key, phone_number, message):
url = "https://api.smstext.app/push"
headers = {
"Authorization": f"Basic {api_key}",
"Content-Type": "application/json"
}
data = [
{
"mobile": phone_number,
"text": message
}
]
response = requests.post(url, headers=headers, json=data)
if response.status_code == 200:
print("Message sent successfully!")
else:
print(f"Error sending message: {response.text}")
<?php
function send_sms($api_key, $phone_number, $message) {
$url = "https://api.smstext.app/push";
$data = json_encode([
[
"mobile" => $phone_number,
"text" => $message
]
]);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Authorization: Basic " . base64_encode($api_key . ":"),
"Content-Type: application/json"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
if ($response === false) {
die('Error: "' . curl_error($ch) . '"');
} else {
echo $response;
}
}
?>