📡 SMS Bridge API - Endpoints Test

Available Endpoints

✅ 1. POST /register.php

Purpose: Register new Android device

Test command:

curl -X POST https://smsapi.inc.mk/register.php \
  -d "device_id=test_device_1" \
  -d "phone_number=+38970123456" \
  -d "fcm_token=test_fcm_token_12345"

Expected response:

{
  "success": true,
  "message": "Created successfully",
  "device_id": "test_device_1",
  "api_key": "a1b2c3d4...",
  "phone_number": "+38970123456"
}

✅ 2. POST /send.php

Purpose: Send SMS via registered device

Requirements: Valid API key, whitelisted domain & IP

Test command:

curl -X POST https://smsapi.inc.mk/send.php \
  -d "api_key=YOUR_API_KEY" \
  -d "receiver=+38970999888" \
  -d "message=Test SMS from API"

Expected response:

{
  "success": true,
  "message": "SMS queued for delivery",
  "log_id": 1,
  "receiver": "+38970999888",
  "device_id": "test_device_1"
}

✅ 3. POST /receive.php

Purpose: Log incoming SMS (called by Android app)

Test command:

curl -X POST https://smsapi.inc.mk/receive.php \
  -d "api_key=YOUR_API_KEY" \
  -d "sender=+38970111222" \
  -d "message=This is an incoming SMS"

Expected response:

{
  "success": true,
  "message": "SMS received and logged",
  "log_id": 2
}

✅ 4. POST /status.php

Purpose: Update delivery status (called by Android app)

Test command:

curl -X POST https://smsapi.inc.mk/status.php \
  -d "api_key=YOUR_API_KEY" \
  -d "log_id=1" \
  -d "status=delivered"

Expected response:

{
  "success": true,
  "message": "Status updated successfully",
  "log_id": 1,
  "status": "delivered"
}

✅ 5. GET /logs.php

Purpose: Query SMS history

Test command:

curl "https://smsapi.inc.mk/logs.php?api_key=YOUR_API_KEY&limit=10"

Expected response:

{
  "success": true,
  "logs": [...],
  "pagination": {
    "limit": 10,
    "offset": 0,
    "count": 2,
    "total": 2,
    "has_more": false
  }
}

Quick Test

Let's register a test device right now:

✅ Test Device Registered!

PropertyValue
Device IDtest_device_1772325614
Phone+38970000000
API Key0d2b1462448e7a71dacbb93206c8e3d1150ee19635afb81c9f62cae94402a7dd

Test send.php with this command:

curl -X POST https://smsapi.inc.mk/send.php \
  -d "api_key=0d2b1462448e7a71dacbb93206c8e3d1150ee19635afb81c9f62cae94402a7dd" \
  -d "receiver=+38970999888" \
  -d "message=Test SMS"

⚠️ Note: This will fail with "Access denied" because your IP/domain isn't whitelisted yet. This is expected!


Summary

✅ All API Endpoints Created!

What's working:

Next steps:

  1. Test endpoints via cURL (commands above)
  2. Build admin panel for visual management
  3. Build Android app

Reply: "API ready" to continue with admin panel or Android app