SMS Documentation
At SMSmobileAPI, we strive to make our API as compatible as possible with any architecture or platform.
Whether you’re using REST, SOAP, cURL, or various programming languages like Python, JavaScript, PHP, and more,
our API is designed to integrate seamlessly into your projects.
We also have ready-to-use plugins for e-commerce solutions and software.
Click here to discover them.
Send SMS
This endpoint allows you to send an SMS from your mobile phone.Endpoint:
Parameters:
| Parameter | Description |
|---|---|
| apikey | Required Your unique API key. |
| recipients | Required The recipient's phone number. |
| message | Required The message to send (no 160-char limit). |
| port |
Define the SIM port to use for sending the SMS: 1, 2, or leave it empty. If left empty, the SMS will be sent using the available SIM port automatically. This parameter is available starting from Android version 4.1.15.0 and works when the app is in the foreground (first plan). |
| shorturl | 1 = convert URLs to short links 0 or empty = no conversion |
| sIdentifiant | Select which connected phone sends the SMS. Leave empty for first available device. Requires app 3.0.35.3+. |
| sendwa | 1 = send via WhatsApp. |
| sendsms | 1 = send via SMS (default if empty). Set to 0 to block SMS. |
| encrypt_message | yes = recipient needs a key to decrypt. Learn more |
| schedule_timestamp | UNIX timestamp (GMT 0) from which the SMS should be sent. |
Example:
GET https://api.smsmobileapi.com/sendsms?apikey=YOUR_API_KEY&recipients=+1234567890&message=Hello%20World
Resend an unsent SMS
This API endpoint is used to resend an unsent SMS (only if the message has an error status).
Endpoint:
Parameter:
| Parameter | Description |
|---|---|
| guid | Required GUID of the message to be resent. |
Example:
GET https://api.smsmobileapi.com/resend/?apikey=YOUR_API_KEY&guid=GUID_OF_THE_MESSAGE
Log of SMS sent from the API
This API endpoint is used to retrieve the log of SMS messages sent via the API.
Endpoint:
Parameter:
| Parameter | Description |
|---|---|
| apikey | Required Your API key. |
| guid_message | Filter by the unique identifier of the message. |
| before | Retrieve messages sent before this timestamp or GUID. |
| error_api | 1 = list SMS with API request error. |
| error_mobile | 1 = list SMS with mobile processing error. |
| keyword | Filter by recipient number or message content. |
Example:
GET https://api.smsmobileapi.com/log/sent/sms?apikey=YOUR_API_KEY
SMS Received
This API endpoint is used to retrieve SMS messages received on the smartphone.
Endpoint:
Parameter:
| Parameter | Description |
|---|---|
| apikey | Required The API key you have or will receive. |
| sIdentifiantPhone | Isolate a phone linked to received SMS. |
| after_timestamp_unix | List received SMS after a UNIX timestamp. |
| onlyunread | "yes" = list only SMS not marked as read (API status). |
Example:
GET https://api.smsmobileapi.com/getsms/?apikey=YOUR_API_KEY
Mark SMS Messages Received as Read
This API endpoint is used to mark one received SMS message as read in the API status only.
This does not change the read status on the smartphone.
Endpoint:
Parameter:
| Parameter | Description |
|---|---|
| apikey | Required The API key you have or will receive. |
| guid_message | Required GUID of the message to mark as read. |
Example:
GET https://api.smsmobileapi.com/getsms/set-read/?apikey=YOUR_APIKEY&guid_message=GUID_MESSAGE
Delete SMS
This API endpoint is used to delete SMS messages from the server log of SMS Mobile API.
Endpoint:
Parameter:
| Parameter | Description |
|---|---|
| apikey | Required The API key you have. |
| guid_message | The unique ID of the message to delete. |
| date_start | If used alone, deletes all messages from the specified day. |
| date_start and date_end | Combined to delete messages within a specified period. |
Example:
GET https://api.smsmobileapi.com/deletesms/?apikey=YOUR_API_KEY
Note: Deleted SMS are only those stored in server logs. SMS on the device will not be deleted.
Gateway – List connected mobiles
List mobiles connected to your SMS Gateway.
Endpoint:
Parameters:
| Parameter | Description |
|---|---|
| apikey | Required Your API key. |
| sid | Filter by exact SID (sIdentifiant_pour_check). |
| search | Search in fields (sid, date, battery, version, label...). |
Example:
GET https://api.smsmobileapi.com/gateway/mobile/list/?apikey=YOUR_API_KEY
Gateway – Update a mobile label
Update the label (nom_reference) of a connected mobile.
Endpoint:
Parameters:
| Parameter | Description |
|---|---|
| apikey | Required Your API key. |
| sid | Required The device SID (sIdentifiant_pour_check). |
| label | Required New label (can be empty). |
Example:
GET https://api.smsmobileapi.com/gateway/mobile/update/?apikey=YOUR_API_KEY&sid=SID&label=OfficePhone
Important: label is required but can be empty (label=).
Gateway – Delete a connected mobile
Remove a connected mobile from your gateway (deletes all history rows for this SID).
Endpoint:
Parameters:
| Parameter | Description |
|---|---|
| apikey | Required Your API key. |
| sid | Required The device SID (sIdentifiant_pour_check). |
Example:
GET https://api.smsmobileapi.com/gateway/mobile/delete/?apikey=YOUR_API_KEY&sid=SID
Webhook – SMS Received
This webhook system sends a POST request to the configured URL whenever an SMS is received. The system ensures real-time updates by delivering the SMS details to the specified webhook URL.
How to Configure the Webhook in the Dashboard
Follow these steps to set up your webhook URL in the dashboard:
- Log in to your account on the SMS Mobile API Dashboard.
- Navigate to the Webhook Settings section.
- Enter your webhook URL (e.g.,
https://example.com/webhook-endpoint). - Click on the Save Webhook button.
- Once saved, the system will start sending SMS details to the configured URL.
Webhook Payload
When an SMS is received, the system sends the following JSON payload to your webhook URL:
{
"date": "2025-01-20",
"hour": "10:15:00",
"time_received": "2025-01-20 10:14:50",
"message": "Hello, this is a test.",
"number": "+123456789",
"guid": "abcde12345"
}
Payload Fields:
- date: Date when the SMS was added (YYYY-MM-DD).
- hour: Hour when the SMS was added (HH:mm:ss).
- time_received: Time when the SMS was received.
- message: Content of the SMS.
- number: Sender's phone number.
- guid: Unique identifier of the SMS.
Example Webhook Endpoint
Your server should be ready to handle incoming POST requests. Below is an example PHP script to process the webhook payload:
<?php
$payload = file_get_contents('php://input');
$data = json_decode($payload, true);
if ($data) {
file_put_contents('sms_log.txt', print_r($data, true), FILE_APPEND);
http_response_code(200);
echo "Webhook received successfully.";
} else {
http_response_code(400);
echo "Invalid payload.";
}
?>
Testing the Webhook
To test your webhook configuration, use tools like:
Troubleshooting
- Ensure the webhook URL is correct and publicly accessible.
- Verify that your server is returning an HTTP 200 status code for successful requests.
- Check your server logs for any errors in processing the payload.
Enriched SMS
Coming soonAuthentication
The SMSMobile API supports two authentication methods: using a simple API Key or the OAuth2 protocol with a client ID and client secret.
1. API Key Authentication
This method requires an API Key that can be included as a parameter in either a GET or POST request.
2. OAuth2 Authentication
OAuth2 provides a more secure authentication method.
Use a client ID and client secret to obtain an access token, then include it in the Authorization header.
The client_id and client_secret are available in your dashboard.
Download the mobile app now or
access your dashboard.
Obtaining an Access Token
curl -X POST https://api.smsmobileapi.com/oauth2/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials" \
-d "client_id=YOUR_CLIENT_ID" \
-d "client_secret=YOUR_CLIENT_SECRET"
Using the Access Token:
curl -X POST https://api.smsmobileapi.com/sendsms \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "recipients=+1234567890" \
-d "message=Hello"
Which Method Should You Use?
- Use API Key Authentication for quick and straightforward integrations.
- Use OAuth2 Authentication for enhanced security and scalability.
Send SMS
WSDL URL
Parameters:
- message: The message to send.
- apikey: The API key you have or will receive.
Example
require_once "lib/nusoap.php";
$client = new nusoap_client("https://api.smsmobileapi.com/sendsms/wsdl/sendsms.wsdl", true);
$error = $client->getError();
$result = $client->call("sendSms", array("recipients" =>$_GET['recipients'],"message" =>$_GET['message'],"apikey" =>$_GET['apikey']));
print_r($result);
Send SMS & WhatsApp
Basic cURL Command
curl -X POST https://api.smsmobileapi.com/sendsms/ \
-d "recipients=PHONE_NUMBER" \
-d "message=YOUR_MESSAGE" \
-d "apikey=YOUR_API_KEY"
-d "sendwa=1"
-d "sendsms=1"
Send SMS & WhatsApp
Use our official Python Module : https://smsmobileapi.com/python/
import requests
url = "https://api.smsmobileapi.com/sendsms/"
payload = {"recipients":"PHONE_NUMBER","message":"YOUR_MESSAGE","apikey":"YOUR_API_KEY"}
response = requests.post(url, data=payload)
print(response.text)
SMS Mobile API - PHP SDK (Composer)
composer require smsmobileapi/sdk
GitHub: https://github.com/SmsMobileApi/smsmobileapi-php/tree/main
Send SMS & WhatsApp
const url = "https://api.smsmobileapi.com/sendsms/";
const data = {recipients:"PHONE_NUMBER", message:"YOUR_MESSAGE", apikey:"YOUR_API_KEY"};
fetch(url,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams(data)})
.then(r=>r.text()).then(console.log);
Send SMS & WhatsApp
const axios = require("axios");
axios.post("https://api.smsmobileapi.com/sendsms/", {recipients:"PHONE_NUMBER", message:"YOUR_MESSAGE", apikey:"YOUR_API_KEY"})
.then(r=>console.log(r.data));
Send SMS & WhatsApp
require "net/http"
require "uri"
uri = URI.parse("https://api.smsmobileapi.com/sendsms/")
req = Net::HTTP::Post.new(uri)
req.set_form_data({"recipients"=>"PHONE_NUMBER","message"=>"YOUR_MESSAGE","apikey"=>"YOUR_API_KEY"})
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true){|http| http.request(req)}
puts res.body

This issue arises from a process that attempts to run in the background when the application is not actively launched. However, due to Android's battery optimization measures, which vary across different versions, this background process may not initiate correctly. Android's battery optimization is designed to limit the background activity of apps to conserve battery life, which can inadvertently affect apps that require background processes to function properly.
To address this issue, users can manually configure their Android settings to allow the SmsMobileApi to use resources without restrictions.
This involves adjusting the battery optimization settings for the specific app, essentially instructing Android that the SmsMobileApi is permitted to run in the background and use resources as needed. By doing so, the application should be able to automatically send and receive SMS messages even when it is not the active application in the foreground. This adjustment ensures that the necessary background process can operate uninterrupted, circumventing the battery optimization features that might otherwise prevent its proper execution.


FAQ For Developer
Get Started with SMSmobileAPI Today!
Experience the freedom and flexibility of managing your SMS services on the go. Download our mobile app now and take the first step towards seamless SMS integration.
Download the App