<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="he">
	<id>https://wiki.mindc.co/index.php?action=history&amp;feed=atom&amp;title=Send_SMS_API</id>
	<title>Send SMS API - היסטוריית גרסאות</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.mindc.co/index.php?action=history&amp;feed=atom&amp;title=Send_SMS_API"/>
	<link rel="alternate" type="text/html" href="https://wiki.mindc.co/index.php?title=Send_SMS_API&amp;action=history"/>
	<updated>2026-06-23T19:19:34Z</updated>
	<subtitle>היסטוריית הגרסאות של הדף הזה בוויקי</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>https://wiki.mindc.co/index.php?title=Send_SMS_API&amp;diff=946&amp;oldid=prev</id>
		<title>מנהל: יצירת דף שליחת סמס ב-API באנגלית</title>
		<link rel="alternate" type="text/html" href="https://wiki.mindc.co/index.php?title=Send_SMS_API&amp;diff=946&amp;oldid=prev"/>
		<updated>2026-06-23T12:49:14Z</updated>

		<summary type="html">&lt;p&gt;יצירת דף שליחת סמס ב-API באנגלית&lt;/p&gt;
&lt;p&gt;&lt;b&gt;דף חדש&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Send SMS API =&lt;br /&gt;
&lt;br /&gt;
Send an SMS message to a customer phone number via a simple HTTP request.&lt;br /&gt;
The API supports two modes: sending a &amp;#039;&amp;#039;&amp;#039;raw message&amp;#039;&amp;#039;&amp;#039; you compose yourself, or using a pre-configured &amp;#039;&amp;#039;&amp;#039;SMS template&amp;#039;&amp;#039;&amp;#039; stored in the system.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Endpoint ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
GET /api/send_sms.php&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Authentication ==&lt;br /&gt;
&lt;br /&gt;
Pass your worker ID via the &amp;lt;code&amp;gt;user_id&amp;lt;/code&amp;gt; parameter. The API uses it to look up the customer record and to log the outgoing message against your account.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Mode 1 — Raw Message ==&lt;br /&gt;
&lt;br /&gt;
Send a message you write directly in the request.&lt;br /&gt;
&lt;br /&gt;
=== Required Parameters ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;source_number&amp;lt;/code&amp;gt; || string || The sender name or number shown to the recipient. Alphanumeric only, max 12 characters.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;message&amp;lt;/code&amp;gt; || string || The message text to send. Max 500 characters.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;phone&amp;lt;/code&amp;gt; || string || Recipient&amp;#039;s Israeli mobile number in &amp;lt;code&amp;gt;05X-XXXXXXX&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;05XXXXXXXX&amp;lt;/code&amp;gt; format.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Optional Parameters ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;user_id&amp;lt;/code&amp;gt; || integer || Your worker ID. Used for customer lookup and logging.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;from_phone&amp;lt;/code&amp;gt; || string || Alternative to &amp;lt;code&amp;gt;phone&amp;lt;/code&amp;gt;. Used if &amp;lt;code&amp;gt;phone&amp;lt;/code&amp;gt; is not provided.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;date&amp;lt;/code&amp;gt; || string || Scheduled send date in &amp;lt;code&amp;gt;YYYY-MM-DD&amp;lt;/code&amp;gt; format. Defaults to today.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;time&amp;lt;/code&amp;gt; || string || Scheduled send time in &amp;lt;code&amp;gt;HH:MM:SS&amp;lt;/code&amp;gt; format. Defaults to now.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;repository_assign_id&amp;lt;/code&amp;gt; || integer || If you already know the customer&amp;#039;s assignment ID, pass it here to skip the lookup step.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example Request ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
GET /api/send_sms.php&lt;br /&gt;
  ?source_number=MindCRM&lt;br /&gt;
  &amp;amp;message=Hello, your appointment is confirmed.&lt;br /&gt;
  &amp;amp;phone=0501234567&lt;br /&gt;
  &amp;amp;user_id=42&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Scheduled Send Example ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
GET /api/send_sms.php&lt;br /&gt;
  ?source_number=MindCRM&lt;br /&gt;
  &amp;amp;message=Reminder: your meeting is tomorrow at 10:00.&lt;br /&gt;
  &amp;amp;phone=0501234567&lt;br /&gt;
  &amp;amp;user_id=42&lt;br /&gt;
  &amp;amp;date=2025-07-01&lt;br /&gt;
  &amp;amp;time=09:00:00&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Mode 2 — SMS Template ==&lt;br /&gt;
&lt;br /&gt;
Use a pre-built template stored in the system. The template text is fetched automatically, and any &amp;#039;&amp;#039;&amp;#039;placeholder variables&amp;#039;&amp;#039;&amp;#039; (such as the customer&amp;#039;s name or phone number) are replaced with real data before sending.&lt;br /&gt;
&lt;br /&gt;
Any parameter you pass explicitly &amp;#039;&amp;#039;&amp;#039;overrides&amp;#039;&amp;#039;&amp;#039; the value from the template.&lt;br /&gt;
&lt;br /&gt;
=== Required Parameters ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;sms_template_id&amp;lt;/code&amp;gt; || integer || The ID of the SMS template to use.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;phone&amp;lt;/code&amp;gt; || string || Recipient&amp;#039;s Israeli mobile number in &amp;lt;code&amp;gt;05X-XXXXXXX&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;05XXXXXXXX&amp;lt;/code&amp;gt; format.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Optional Parameters ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Parameter !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;user_id&amp;lt;/code&amp;gt; || integer || Your worker ID. Used for customer data lookup and variable substitution.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;from_phone&amp;lt;/code&amp;gt; || string || Alternative to &amp;lt;code&amp;gt;phone&amp;lt;/code&amp;gt;. Used if &amp;lt;code&amp;gt;phone&amp;lt;/code&amp;gt; is not provided.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;source_number&amp;lt;/code&amp;gt; || string || Overrides the template&amp;#039;s sender name/number.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;message&amp;lt;/code&amp;gt; || string || Overrides the template&amp;#039;s message text entirely.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;date&amp;lt;/code&amp;gt; || string || Scheduled send date in &amp;lt;code&amp;gt;YYYY-MM-DD&amp;lt;/code&amp;gt; format. Defaults to now.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;time&amp;lt;/code&amp;gt; || string || Scheduled send time in &amp;lt;code&amp;gt;HH:MM:SS&amp;lt;/code&amp;gt; format. Defaults to now.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;repository_assign_id&amp;lt;/code&amp;gt; || integer || If you already know the customer&amp;#039;s assignment ID, pass it here to skip the lookup step.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Example Request ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
GET /api/send_sms.php&lt;br /&gt;
  ?sms_template_id=7&lt;br /&gt;
  &amp;amp;phone=0501234567&lt;br /&gt;
  &amp;amp;user_id=42&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Override Template Sender Example ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
GET /api/send_sms.php&lt;br /&gt;
  ?sms_template_id=7&lt;br /&gt;
  &amp;amp;phone=0501234567&lt;br /&gt;
  &amp;amp;user_id=42&lt;br /&gt;
  &amp;amp;source_number=MyBrand&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Phone Number Format ==&lt;br /&gt;
&lt;br /&gt;
The recipient phone number must be an Israeli mobile number matching one of these formats:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;0501234567&amp;lt;/code&amp;gt; — 10 digits, no separator&lt;br /&gt;
* &amp;lt;code&amp;gt;050-1234567&amp;lt;/code&amp;gt; — with a dash separator&lt;br /&gt;
&lt;br /&gt;
Valid prefixes: &amp;lt;code&amp;gt;050&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;051&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;052&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;053&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;054&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;055&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;058&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;059&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Response Format ==&lt;br /&gt;
&lt;br /&gt;
All responses are returned as JSON.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;stat_code&amp;quot;: 0,&lt;br /&gt;
  &amp;quot;description&amp;quot;: &amp;quot;SMS sent successfully&amp;quot;,&lt;br /&gt;
  &amp;quot;data&amp;quot;: &amp;quot;SMS sent successfully&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field !! Type !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;stat_code&amp;lt;/code&amp;gt; || integer || &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; = success. Any other value = error (see table below).&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;description&amp;lt;/code&amp;gt; || string || Human-readable result message.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; || string || Same as &amp;lt;code&amp;gt;description&amp;lt;/code&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Error Codes ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Code !! Meaning !! How to Fix&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; || Success || —&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; || Missing mandatory parameter || Check that all required parameters are included in your request.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; || Invalid phone number format || Ensure the phone number starts with &amp;lt;code&amp;gt;05&amp;lt;/code&amp;gt; and contains exactly 10 digits.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;3&amp;lt;/code&amp;gt; || Message too long || Keep the message under 500 characters.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;4&amp;lt;/code&amp;gt; || Invalid &amp;lt;code&amp;gt;source_number&amp;lt;/code&amp;gt; || Use only letters and numbers, max 12 characters. No special characters.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;5&amp;lt;/code&amp;gt; || SMS template not found || Verify the &amp;lt;code&amp;gt;sms_template_id&amp;lt;/code&amp;gt; exists and is active in the system.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Priority Rules (Mode 2) ==&lt;br /&gt;
&lt;br /&gt;
When both a template and explicit parameters are provided, &amp;#039;&amp;#039;&amp;#039;explicit parameters always win&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value !! Source&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;message&amp;lt;/code&amp;gt; || Explicit param → Template text (with variables replaced)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;source_number&amp;lt;/code&amp;gt; || Explicit param → Template&amp;#039;s source number&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
&lt;br /&gt;
* Messages are logged automatically in the customer&amp;#039;s SMS history.&lt;br /&gt;
* Scheduled messages (using &amp;lt;code&amp;gt;date&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;time&amp;lt;/code&amp;gt;) that are set in the past are sent immediately.&lt;br /&gt;
* Template variables are replaced with live customer data at the time of the request.&lt;/div&gt;</summary>
		<author><name>מנהל</name></author>
	</entry>
</feed>