Skip to content

SOP-004: SMS Operations

Fresh
FieldValue
Document IDSOP-004
Version1.0
StatusActive
Plan RequiredEssential+ (varies by operation)

Overview

Manage SMS messages through the Proxidize API including reading, sending, and deleting messages.

Prerequisites

  • Valid API token (SOP-001)
  • SIM cards with SMS capability

Operations Overview


Operation 1: Get SMS Messages

Plan Required: Essential, Plus, or Business

Endpoint

GET /api/sms/get?index=MODEM_INDEX

Parameters

ParameterRequiredDescription
indexYesModem index number

Example

bash
curl -H "Authorization: Token YOUR_API_TOKEN" \
     "http://YOUR_SERVER_IP/api/sms/get?index=1"

Response Format

json
{
  "sms_messages": [
    {
      "sms_id": 123,
      "date": "2025-01-08 14:30:00",
      "phone": "+15551234567",
      "content": "Your verification code is 123456",
      "sms_contact_id": 1,
      "timestamp": 1704729000.0
    }
  ]
}

Operation 2: Send SMS

Plan Required: Plus or Business

Endpoint

GET /api/sms/send?index=MODEM_INDEX&phone=PHONE&message=MESSAGE

Parameters

ParameterRequiredDescription
indexYesModem index number
phoneYesDestination phone number
messageYesMessage content (URL encoded)

Example

bash
# Send "Hello World" to +123456789 from modem 1
curl -H "Authorization: Token YOUR_API_TOKEN" \
     "http://YOUR_SERVER_IP/api/sms/send?index=1&phone=+123456789&message=Hello_World"

URL Encoding

Replace spaces with underscores (_) or use proper URL encoding (%20) for messages.


Operation 3: Delete Single SMS

Plan Required: Plus or Business

Endpoint

GET /api/delete_sms?sms_id=SMS_ID&modem_index=MODEM_INDEX

Parameters

ParameterRequiredDescription
sms_idYesMessage ID from SMS list
modem_indexYesModem index number

Example

bash
# Delete SMS with ID 22 from modem 5
curl -H "Authorization: Token YOUR_API_TOKEN" \
     "http://YOUR_SERVER_IP/api/delete_sms?sms_id=22&modem_index=5"

Response

Delete SMS requested for message id 22 on modem index 5

Operation 4: Delete Multiple SMS

Plan Required: Plus or Business

Endpoint

GET /api/delete_sms?sms_id=ID1,ID2,ID3&modem_index=MODEM_INDEX

Example

bash
# Delete SMS IDs 22, 23, 25, and 99 from modem 5
curl -H "Authorization: Token YOUR_API_TOKEN" \
     "http://YOUR_SERVER_IP/api/delete_sms?sms_id=22,23,25,99&modem_index=5"

TIP

Separate multiple SMS IDs with commas. Get IDs from the "Message ID" column on your SMS page.


Operation 5: Get SMS by Phone Number

Plan Required: Business Only

Retrieve SMS messages by the modem's phone number instead of index.

Endpoint

GET /api/sms/fetch_sms_phone_number?phone_number=NUMBER

Example

bash
curl -H "Authorization: Token YOUR_API_TOKEN" \
     "http://YOUR_SERVER_IP/api/sms/fetch_sms_phone_number?phone_number=19628522851"

Response Format

json
{
  "phone_number": "19628522851",
  "modem_index": 3,
  "message": "SMS messages fetched successfully.",
  "sms_messages": [
    {
      "date": "04-02-2023 04:21:54",
      "phone": ["15551234567"],
      "content": "Example message content",
      "sms_id": 51251,
      "sms_contact_id": 1,
      "timestamp": 1675484514.0
    }
  ]
}

Verification Checklist

  • [ ] SMS get request returns message list
  • [ ] Send request shows success status
  • [ ] Delete request confirms message removal
  • [ ] Deleted messages no longer appear in list

Troubleshooting

IssueCauseSolution
Empty SMS listNo messages receivedCheck SIM card and signal
Send failedInvalid phone formatUse international format (+country code)
Delete errorInvalid SMS IDGet correct ID from /api/sms/get
Phone not foundWrong number formatTry without + or country code

See Also

Proxidize API Documentation