SMS gateway API connection
SMS API is a programming interface that facilitates communication between your application and mobile operators' SMS gateway. It allows you to send and receive SMS messages using simple HTTP requests, without the need for direct connection to telecommunications infrastructure.
Easy integration
JSON API s podporou HTTP požadavků pro rychlou integraci
High reliability
The service runs 24/7 thanks to AWS Cloud infrastructure and backup operator connections
Delivery speed
Messages delivered within seconds. Even faster when using the priority queue
Global coverage
Sending to 200+ countries worldwide and we help you meet all necessary requirements for each destination
Detailed reports
Real-time sending progress information via webhooks and access to logs
API first
All features are built primarily for API, making it easy to integrate our services into any system
Why SmsManager?
API tvořeno pro pohodlí vývojářů každý API požadavek může obsahovat vlastní JSON data, aby bylo možné doručenky nebo příchozí odpovědi snadno spárova.t
Developerský portál s příklady volání a detailním popisem API struktury.
Sandbox a možnost vyzkoušení developerský portál obsahuje functionality pro real-time vyzkoušení a validaci požadavků. Díky tomu své napojení připravíte velmi rychle.
Ukázky v mnoha jazycích - PHP, JavaScript, Node.js, Python, Java, Go, Ruby, .NET, ...
Quick start
Send a message
- JSON
- CURL
{
"body": "Vaše první SMS přes API!",
"to": [{"phone_number": "+420777123456"}]
}
curl -X POST https://api.smsmngr.com/v2/message \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"body": "Vaše první SMS přes API!",
"to": [{"phone_number": "+420777123456"}]
}'
API response
{
"request_id": "c3917016-4540-4a26-b2f9-f96028788dbe",
"accepted": [{
"key": "0",
"message_id": "8c8e93ce-3fdd-4f9a-8918-cf8b0b40502a"
}],
"rejected": []
}
Authentication
Pro odesílání zpráv budete vždy potřebovat API klíč.
Pokud budete používat standardní JSON API, bude potřeba vždy hlavičku požadavku obohatit o x-api-key a správně definovat Content-Type: application/json.
Content-Type: application/json x-api-key: YOUR_API_KEY
JSON API Endpoint
Naše JSON API je navrženo tak, aby bylo stabilní a výkonné.
Odpověď od našeho API vždy znamená potvrzení přijetí požadavku (a přidělení ID). Nikoliv odslání zprávy. Pro skutečné ověření stavu zprávy využijte REST API v rámci kterého poskytujeme detailní stav zpráv.
Protože využíváme JSON strukturu, upravujeme a přidáváme funkcionalitu přímo do jednotlivých verzí API.
Usage examples
- PHP
- Python
- Go
- Ruby
- Java
- .NET
- Node.js
<?php
$apikey = 'your-api-key-here'; // Replace with your actual API key
$number = 'phone-number-here'; // Replace with the target phone number
$text = 'message-text-here'; // Replace with the message text
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.smsmngr.com/v2/message');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(array(
'to' => array(array('phone_number' => $number)),
'body' => $text
)));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'x-api-key:' . $apikey
));
// Execute the request and capture the response
$response = curl_exec($ch);
curl_close($ch);
// Process the response
$response = json_decode($response, true);
if ($response['accepted'] && $response['accepted'][0]) { // SMS was sent successfully
echo 'Status: Accepted';
echo 'ID: ' . $response['accepted'][0]['message_id'];
} else {
echo 'Status: Rejected';
}
import requests
import json
api_key = 'your-api-key-here'
phone_number = 'phone-number-here'
text = 'message-text-here'
url = 'https://api.smsmngr.com/v2/message'
headers = {
'Content-Type': 'application/json',
'x-api-key': api_key
}
payload = {
'to': [{'phone_number': phone_number}],
'body': text
}
response = requests.post(url, headers=headers, data=json.dumps(payload))
response_data = response.json()
if 'accepted' in response_data and response_data['accepted']:
print('Status: Accepted')
print('ID:', response_data['accepted'][0]['message_id'])
else:
print('Status: Rejected')
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
apiKey := "your-api-key-here"
phoneNumber := "phone-number-here"
text := "message-text-here"
messageData := map[string]interface{}{
"to": []map[string]string{{"phone_number": phoneNumber}},
"body": text,
}
jsonData, _ := json.Marshal(messageData)
req, _ := http.NewRequest("POST", "https://api.smsmngr.com/v2/message", bytes.NewBuffer(jsonData))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("x-api-key", apiKey)
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
var result map[string]interface{}
json.Unmarshal(body, &result)
if accepted, ok := result["accepted"].([]interface{}); ok && len(accepted) > 0 {
message := accepted[0].(map[string]interface{})
fmt.Println("Status: Accepted")
fmt.Println("ID:", message["message_id"])
} else {
fmt.Println("Status: Rejected")
}
}
require 'net/http'
require 'uri'
require 'json'
api_key = 'your-api-key-here'
phone_number = 'phone-number-here'
text = 'message-text-here'
uri = URI.parse('https://api.smsmngr.com/v2/message')
request = Net::HTTP::Post.new(uri)
request.content_type = 'application/json'
request['x-api-key'] = api_key
request.body = JSON.dump({
'to' => [{'phone_number' => phone_number}],
'body' => text
})
req_options = {
use_ssl: uri.scheme == 'https'
}
response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
http.request(request)
end
response_data = JSON.parse(response.body)
if response_data['accepted'] && !response_data['accepted'].empty?
puts "Status: Accepted"
puts "ID: #{response_data['accepted'][0]['message_id']}"
else
puts "Status: Rejected"
end
// Requires Java 11+ for HttpClient
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
// Add a JSON processing library like Gson or Jackson to your project
// Example with manual string building for simplicity
public class SendSms {
public static void main(String[] args) throws Exception {
String apiKey = "your-api-key-here";
String phoneNumber = "phone-number-here";
String text = "message-text-here";
String jsonPayload = String.format(
"{\"to\":[{\"phone_number\":\"%s\"}],\"body\":\"%s\"}",
phoneNumber, text
);
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.smsmngr.com/v2/message"))
.header("Content-Type", "application/json")
.header("x-api-key", apiKey)
.POST(HttpRequest.BodyPublishers.ofString(jsonPayload))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
// In a real application, parse the JSON to check the 'accepted' array.
}
}
// Requires .NET 5+ for modern HttpClient usage with JSON helpers
// Add package: System.Net.Http.Json
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Net.Http.Json;
using System.Threading.Tasks;
using System.Collections.Generic;
public class SmsSender
{
public static async Task Main(string[] args)
{
var apiKey = "your-api-key-here";
var phoneNumber = "phone-number-here";
var text = "message-text-here";
using var client = new HttpClient();
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
client.DefaultRequestHeaders.Add("x-api-key", apiKey);
var payload = new
{
to = new[] { new { phone_number = phoneNumber } },
body = text
};
var response = await client.PostAsJsonAsync("https://api.smsmngr.com/v2/message", payload);
if (response.IsSuccessStatusCode)
{
var result = await response.Content.ReadFromJsonAsync<SmsResponse>();
if (result?.Accepted?.Count > 0)
{
Console.WriteLine("Status: Accepted");
Console.WriteLine($"ID: {result.Accepted[0].MessageId}");
}
else
{
Console.WriteLine("Status: Rejected");
}
}
else
{
Console.WriteLine($"Error: {response.StatusCode}");
Console.WriteLine(await response.Content.ReadAsStringAsync());
}
}
}
public class SmsResponse
{
public List<AcceptedMessage> Accepted { get; set; }
public List<object> Rejected { get; set; }
}
public class AcceptedMessage
{
public string Key { get; set; }
public string MessageId { get; set; }
}
const response = await fetch('https://api.smsmngr.com/v2/message', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'your-api-key-here'
},
body: JSON.stringify({
to: [{
phone_number: 'phone-number-here'
}],
body: 'message-text-here'
})
});
const responseText = await response.json();
if(response.accepted && response.accepted[0]){ // SMS was sent successfully
console.log('Status: Accepted');
console.log('ID:', response.accepted[0].message_id);
}
else{
console.log('Status: Rejected');
}
Ready to send WhatsApp messages too?
Send a message
Pokud již máte implementované naše API, můžete snadno rozšířit odesílání zpráv také na WhatsApp. Máte pod kontrolou pořadí odesílaných zpráv i obsah zprávy, která se odešle v SMS.
Díky chytré kombinaci SMS a WhatsApp zpráv můžete zásadně snížit náklady na odesílání zpráv.
- JSON
{
"flow":[
{
"whatsapp_template": {
"template_name": "welcome",
"language": "cs",
"sender": "987651234567890"
}
},
{
"sms": {
"body": "Pokud nemáte WhatsApp, dostanete SMS!"
}
}
],
"to": [{"phone_number": "+420777123456"}]
}
API response
{
"request_id": "c3917016-4540-4a26-b2f9-f96028788dbe",
"accepted": [{
"key": "0",
"message_id": "8c8e93ce-3fdd-4f9a-8918-cf8b0b40502a"
}],
"rejected": []
}
Start using our SMS gateway API today
Ready to start reaching your customers through the most effective communication channel? The process is quick and simple. Sign up in a minute, get your API key and send your first SMS today with our simple API.