REST API - Send SMS
Send a single SMS message to one or multiple recipients.
Endpoint
GET https://sms.deals/api/ws.php
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
service | String | Required | Must be send_sms |
token | String | Optional | Account identification token (alternative to Bearer token) |
dest | String | Required | Destination phone number. For multiple recipients, use comma-separated values |
message | String | Required | Text message to send. Add short URL: [[ex_url-https://yoursite.com[[ |
sender | String | Required | Sender number or name (phone number, speed dial *XXXX, or Latin name up to 11 chars) |
sendtime | String | Optional | Schedule time in format dd/mm/yyyy HH:MM |
callback_url | String | Optional | URL to receive delivery status callbacks |
Example Request
https://sms.deals/api/ws.php?service=send_sms&message=Hello%20World&dest=0501234567&sender=0501234567&token=YOUR_TOKEN
Code Examples
PHP
<?php
$msg = urlencode("Hello world sms");
$destination = "0521234567,0537654321"; // One or Multiple comma separated
$sender = "0531234567";
$token = "xxxxx...";
$url = "https://sms.deals/api/ws.php?service=send_sms";
$url .= "&message=".$msg."&dest=".$destination."&sender=".$sender;
$url .= "&token=".$token;
$options = array('http' => array(
'method' => 'GET',
'header' => 'Authorization: Bearer '.$token
));
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
echo $result;
?>
C# (.NET)
using System;
using System.IO;
using System.Net;
using System.Text;
namespace Examples.System.Net {
public class WebRequestGetExample {
public static void Main() {
string url_query_string = "https://sms.deals/api/ws.php?" +
"service=send_sms&" +
"message=Hello world sms&" +
"dest=0521234567,0537654321&" +
"sender=0531234567";
WebRequest request = WebRequest.Create(url_query_string);
string bearerToken = "xxxxxx...";
request.Headers["Authorization"] = "Bearer " + bearerToken;
WebResponse response = request.GetResponse();
Console.WriteLine(((HttpWebResponse)response).StatusDescription);
Stream dataStream = response.GetResponseStream();
StreamReader reader = new StreamReader(dataStream);
string responseFromServer = reader.ReadToEnd();
Console.WriteLine(responseFromServer);
reader.Close();
response.Close();
}
}
}
Response
<?xml version="1.0" encoding="UTF-8"?>
<SMS_Service>
<service>send_sms</service>
<Message>1231230</Message>
<Source>0541234567</Source>
<sms_recipients>
<sms_0>
<Message_id>183804870</Message_id>
<Destination>0521234567</Destination>
<Status>Message in Action</Status>
<Send_time>2014-05-24 15:10:38</Send_time>
</sms_0>
<sms_1>
<Message_id>183804880</Message_id>
<Destination>0537654321</Destination>
<Status>Message in Action</Status>
<Send_time>2014-05-24 15:10:38</Send_time>
</sms_1>
</sms_recipients>
<Total_sms>2</Total_sms>
<Total_Charge>2</Total_Charge>
</SMS_Service>
Response Variables
| Variable | Type | Description |
|---|---|---|
Message_id | Integer | Unique identifier for the message |
Message | String | Message content |
Source | String | Sender number or name |
Destination | String | Destination phone number |
Send_time | Time | Date and time the request was logged |
Total_sms | Integer | Number of SMS messages sent |
Total_Charge | Integer | SMS credits charged |
Callback Parameters
When using callback_url, you'll receive the following parameters:
| Variable | Type | Description |
|---|---|---|
from | String | Sender number or name |
to | String | Destination phone number |
status | String | Delivery status (see table below) |
Message_id | Integer | Unique message identifier |
Delivery Status Codes
| Status | Description |
|---|---|
Success | Message sent to destination operator successfully |
Recipient "X" Blocked | Destination blocked for incoming SMS |
Destination MT block | Destination blocked for incoming SMS |
System Error | System error occurred |
Missing Message body | Message is empty |
Invalid Destination | Invalid destination number |
Expired | Message validity period has expired |
blacklist | Destination is in blacklist |
השפעות על המערכת
שליחת SMS בודד דרך ה‑API משפיעה:
- קרדיט — כל הודעה מורידה נקודה אחת מחשבון ה‑SMS; הודעה ארוכה עשויה להתפצל לכמה חלקים ולהיספר בהתאם
- דו״ח התראות — ההודעה נרשמת ב‑_notifications עם זמן שליחה, נמען ושולח; נראית מיד בדוח ההתראות
- Callback URL — אם סופק
callback_url, סטטוס המסירה (Success / Blocked / blacklist) נשלח חזרה בקשתית HTTP - sender IDs — שם השולח חייב להיות מאושר ב‑
/senders; שימוש בשם לא מאושר יוחזר כשגיאה - רשימה שחורה — נמענים ברשימה השחורה יוחזרו עם סטטוס
blacklistולא יישלחו