Hi,
The 401 Unauthorized response usually means the request is reaching the device/API, but it’s missing proper authentication or required parameters.
In your case, the issue is likely not the HTML form itself but how the API expects authentication. Most Peplink/Pepwave APIs require either:
Session authentication (login first and use cookie/session)
Or API key/token (if supported in your firmware)
A few things to check:
Authentication requirement
The /api/cmd.sms.sendMessage endpoint typically needs an authenticated session.
Try logging in via the API first and then sending the request using the same session (Postman helps here).
Test with Postman instead of form
Forms don’t handle cookies/session easily.
Use Postman to:
Login endpoint
Capture session/cookie
Then call sendMessage
Check firmware/API mode
Some endpoints behave differently depending on firmware version or whether API access is enabled.
Use a simpler endpoint first
Try something like /api/info (no auth or basic auth depending on setup) to confirm connectivity before sending SMS.
Important note:
Sending SMS via web form directly usually fails in these setups because authentication/session handling is required. That’s why API tools or backend scripts work better than plain HTML forms.
If you can share your firmware version or how you’re authenticating, I can help you structure the exact request