Skip to main content

Automate message sending

How does sending messages via API work?

It is an interface that allows programmatic acceptance of message sending requests. This enables you to connect any system or application and send messages in a fully automated way.

What can I do with the API?

Odesílat je možné jak SMS, tak Viber, WhatsApp zprávy nebo interaktivní RCS zprávy.

How does it work?

1

Create an account

Registration is free. You only need an email and password.
2

Top up your credit and get your API key

After creating your account, you can top up your credit and get your API key. Credit can be topped up via bank transfer or credit card.
3

Use your API key

Your API key serves as credentials for sending messages. Now connect your system to our API and you can start sending messages. Code samples and existing libraries for various programming languages are available.

Usage examples

<?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';
}

Existing libraries

PHPPHP (Nette)JAVAGoRubyNode.js