SendWAPI × Smart School — Complete Integration Guide

Send WhatsApp notifications (fees, attendance, exams, etc.) from Smart School using your SendWAPI account.

📋 Table of Contents

  1. Prerequisites
  2. Step 1 — Get Your SendWAPI Credentials
  3. Step 2 — Replace the Customsms.php File
  4. Step 3 — Configure API Key & Sender Number
  5. Step 4 — Enable Custom SMS Gateway in Smart School
  6. Step 5 — Test the Integration
  7. Troubleshooting
  8. API Reference

Download Link

✅ Prerequisites

Before you begin, make sure you have:

RequirementDetails
Smart SchoolVersion 7.x or later installed and running
SendWAPI AccountRegister at sendwapi.com
Connected WhatsApp DeviceA WhatsApp number linked to your SendWAPI dashboard
Server AccessFTP/SFTP or cPanel file manager access to your Smart School files

🔑 Step 1 — Get Your SendWAPI Credentials

You need two things from your SendWAPI dashboard:

1.1 — Copy Your API Key

  1. Log in to sendwapi.com
  2. Go to DashboardAPI Settings (or Profile)
  3. Copy your API Key

sendwapi

[!IMPORTANT] Your API key looks something like: a1b2c3d4e5f6g7h8i9j0 Keep it private — never share it publicly.

1.2 — Note Your Sender Number

  1. In the SendWAPI dashboard, go to Devices
  2. Find the WhatsApp number that shows Connected status
  3. Copy the full number with country code, without the + sign
[!TIP] Number Format Examples:
CountryRaw NumberCorrect Format
India+91 98765 43210919876543210
Indonesia+62 888 1234 56786288812345678
USA+1 (555) 123-456715551234567
UK+44 7911 123456447911123456
Wrong: +919876543210, 09876543210, 98765-43210Right: 919876543210

📁 Step 2 — Replace the Customsms.php File

2.1 — Locate the File

The file you need to replace is located at:

your-smart-school/application/libraries/Customsms.php

Full path example (cPanel):

/home/yourdomain/public_html/application/libraries/Customsms.php

2.2 — Backup the Original File

[!WARNING] Always back up the original file before making changes!
  1. Open your File Manager (cPanel) or connect via FTP
  2. Navigate to application/libraries/
  3. Find Customsms.php
  4. Right-click → Rename it to Customsms.php.backup

2.3 — Upload the New File

  1. Download or copy the new Customsms.php file provided with this guide
  2. Upload it to the same directory: application/libraries/
  3. Make sure the filename is exactly Customsms.php (capital C, lowercase rest)
[!CAUTION] The filename must be exactly Customsms.php — not customsms.php or CustomSms.php. Linux servers are case-sensitive!

⚙️ Step 3 — Configure API Key & Sender Number

3.1 — Open the File for Editing

  1. In your File Manager, right-click Customsms.phpEdit (or Code Editor)
  2. You will see the file contents

3.2 — Set Your API Key (Line 19)

Find this line:

private $SENDWAPI_API_KEY = "your-sendwapi-api-key";

Replace your-sendwapi-api-key with your actual API key from Step 1.1:

private $SENDWAPI_API_KEY = "a1b2c3d4e5f6g7h8i9j0";

3.3 — Set Your Sender Number (Line 22)

Find this line:

private $SENDWAPI_SENDER = "your-whatsapp-sender-number";

Replace your-whatsapp-sender-number with your WhatsApp number from Step 1.2:

private $SENDWAPI_SENDER = "919876543210";

3.4 — (Optional) Set a Footer Message (Line 28)

If you want a footer text under every WhatsApp message:

private $SENDWAPI_FOOTER = "Sent via Smart School";

Leave it empty ("") if you don't want a footer.

3.5 — Save the File

Click Save Changes in your editor.

[!NOTE] Quick Summary — You only need to change 2 lines:
LineWhat to ChangeExample
19your-sendwapi-api-key → your real API key"a1b2c3d4e5f6g7h8i9j0"
22your-whatsapp-sender-number → your WhatsApp number"919876543210"

🟢 Step 4 — Enable Custom SMS Gateway in Smart School

4.1 — Log in to Smart School Admin Panel

  1. Open your Smart School URL: https://your-school.com
  2. Log in with your Admin or Super Admin account

4.2 — Navigate to SMS Settings

  1. Go to System SettingsSMS Setting (left sidebar)
  2. You will see multiple tabs for different SMS gateways

4.3 — Open the Custom SMS Gateway Tab

  1. Click on the "Custom SMS Gateway" tab (the last tab on the right)
  2. You will see two fields:
  3. Gateway Name — Enter: sendwapi
  4. Status — Select: 4.4 — Save the Settings

Smart School

  1. Click the Save button
  2. You should see a success confirmation
[!IMPORTANT] Make sure no other SMS gateway is enabled! Smart School only uses ONE active SMS gateway at a time. If Twilio or another gateway is also enabled, go to its tab and set Status to Disabled.

🧪 Step 5 — Test the Integration

5.1 — Send a Test Notification

  1. Go to CommunicateSend SMS in Smart School
  2. Select a group (e.g., a single student or parent)
  3. Type a test message: Hello! This is a test from Smart School via SendWAPI.
  4. Click Send

5.2 — Verify on WhatsApp

  1. Check the recipient's WhatsApp
  2. They should receive the message from your sender number

5.3 — Check Logs (If Message Didn't Arrive)

  1. Connect to your server via FTP/SSH
  2. Check the Smart School log file at:
application/logs/log-YYYY-MM-DD.php
  1. Search for SendWAPI — you'll see either:
  2. INFO - SendWAPI message sent to 919876543210
  3. ERROR - SendWAPI send failed to 919876543210: Invalid API key

🛠️ Troubleshooting

Common Issues & Solutions

ProblemCauseSolution
Messages not sending at allCustom gateway not enabledGo to SMS Settings → Custom SMS Gateway → set Status to Enabled
Messages not sending at allAnother gateway is also enabledDisable ALL other gateways (Twilio, Clickatell, etc.)
Invalid API key error in logsWrong API key in Customsms.phpDouble-check the key from SendWAPI dashboard
Sender not found error in logsWrong sender number or device disconnectedCheck SendWAPI dashboard → Devices → ensure the number is Connected
cURL error in logsServer can't reach sendwapi.comAsk your hosting to allow outbound HTTPS to sendwapi.com
404 or 500 HTTP error in logsAPI endpoint issueVerify the endpoint is https://sendwapi.com/send-message
Message sent but not receivedWrong recipient number formatEnsure recipient numbers in Smart School include country code (e.g., 919876543210)
File upload didn't workWrong filename casingFile must be exactly Customsms.php (capital C)

How to Read Log Errors

Open application/logs/log-YYYY-MM-DD.php and search for SendWAPI:

# ✅ Success
INFO - 2026-05-02 23:00:00 --> SendWAPI message sent to 919876543210

# ❌ API Error
ERROR - 2026-05-02 23:00:00 --> SendWAPI send failed to 919876543210: Invalid API key

# ❌ Network Error
ERROR - 2026-05-02 23:00:00 --> SendWAPI cURL error: Could not resolve host: sendwapi.com

# ❌ HTTP Error
ERROR - 2026-05-02 23:00:00 --> SendWAPI HTTP 500: Internal Server Error

📖 API Reference

Endpoint

POST https://sendwapi.com/send-message
Content-Type: application/json

Request Body

{
"api_key": "your-api-key",
"sender": "919876543210",
"number": "918765432109",
"message": "Hello from Smart School!",
"footer": "Sent via Smart School"
}

Parameters

ParameterTypeRequiredDescription
api_keystring✅ YesYour SendWAPI API key
senderstring✅ YesYour WhatsApp sender number (with country code)
numberstring✅ YesRecipient number (with country code)
messagestring✅ YesMessage text to send
footerstring❌ NoFooter text below the message
msgidstring❌ NoMessage ID to reply to
fullnumber❌ NoSet 1 for full response with message details

Success Response

{
"status": true,
"msg": "Message sent successfully!"
}

Error Response

{
"status": false,
"msg": "Invalid API key"
}

📂 File Reference

What Gets Changed

FileActionLocation
Customsms.phpReplace (only file changed)application/libraries/Customsms.php

What Does NOT Change

FileWhy
Smsgateway.phpAlready calls Customsms->sendSMS() when custom gateway is active
smsList.php (view)Already has the Custom SMS Gateway tab in admin UI
smsconfig_model.phpAlready handles saving/loading custom gateway settings
DatabaseNo new tables or columns needed
[!TIP] Need Help?
  1. SendWAPI Documentation: sendwapi.com/docs
  2. SendWAPI Support: sendwapi.com

Last updated: May 2026