SOP-004: SMS Operations
Fresh| Field | Value |
|---|---|
| Document ID | SOP-004 |
| Version | 1.0 |
| Status | Active |
| Plan Required | Essential+ (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_INDEXParameters
| Parameter | Required | Description |
|---|---|---|
index | Yes | Modem 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=MESSAGEParameters
| Parameter | Required | Description |
|---|---|---|
index | Yes | Modem index number |
phone | Yes | Destination phone number |
message | Yes | Message 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_INDEXParameters
| Parameter | Required | Description |
|---|---|---|
sms_id | Yes | Message ID from SMS list |
modem_index | Yes | Modem 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 5Operation 4: Delete Multiple SMS
Plan Required: Plus or Business
Endpoint
GET /api/delete_sms?sms_id=ID1,ID2,ID3&modem_index=MODEM_INDEXExample
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=NUMBERExample
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
| Issue | Cause | Solution |
|---|---|---|
| Empty SMS list | No messages received | Check SIM card and signal |
| Send failed | Invalid phone format | Use international format (+country code) |
| Delete error | Invalid SMS ID | Get correct ID from /api/sms/get |
| Phone not found | Wrong number format | Try without + or country code |