דלג לתוכן הראשי

Receive SMS API

Receive inbound SMS messages on Maskyoo SMS phone numbers.

Overview

When you purchase an SMS-enabled phone number, you can associate it with a URL. When someone sends a text message to that number, Maskyoo makes an HTTP request to your URL.

Webhook Format

http://www.yoursite.com/yourpage.php?from=XXXXXXX&to=XXXXXXX&msg=XXXXXXXXXXXXXXXXXXX&time=2016-04-25%2010:00:00

Webhook Parameters

VariableTypeDescription
fromStringSender phone number
toStringDestination phone number (your Maskyoo number)
msgStringText message content
timeStringDate and time in format Y-m-d H:i:s

Example Webhook Handler (PHP)

<?php
// Receive incoming SMS webhook
$from = $_GET['from'] ?? '';
$to = $_GET['to'] ?? '';
$message = $_GET['msg'] ?? '';
$time = $_GET['time'] ?? '';

// Log the incoming message
$log = date('Y-m-d H:i:s') . " - From: $from, To: $to, Message: $message\n";
file_put_contents('sms_log.txt', $log, FILE_APPEND);

// Respond with 200 OK
http_response_code(200);
echo "OK";
?>

Setup

To configure your webhook URL:

  1. Log in to your Maskyoo account
  2. Navigate to your SMS phone number settings
  3. Enter your webhook URL in the designated field
  4. Save the settings

השפעות על המערכת

קבלת SMS נכנס מפעילה כמה מנגנונים במערכת:

  • אוטומציה — הודעה נכנסת יכולה להפעיל אירוע sms_receive ולהריץ כללי אוטומציה (שליחת מייל, URL callback, הוספת תגית)
  • דוח התראות — ההודעה הנכנסת נשמרת ב‑_notifications עם from, to, msg ו‑time ונראית בדוח
  • Webhook — המערכת שולחת HTTP GET ל‑URL המוגדר; מומלץ להחזיר 200 OK כדי שהקריאה לא תיחשב ככשל
  • מספר SMS‑enabled — נדרש מספר עם יכולת SMS דו‑כיוונית; לא כל DDI תומך בקבלה
  • עומס — webhook שלא עונה מהר עשוי לחסום תור הודעות נכנסות; מומלץ לטפל אסינכרונית

ראו גם