Within the app there is a sample curl command to invoke the API to send SMS. If curl command is unavailable to you, these are the alternative method you can use to invoke the API.

Assumptions:
- App from sms.oofnivek.com installed
- Bearer token configured as “abcd1234”
- Port configured as “8080”
- Private IP address obtained is “192.168.1.234”
- Sending to someone in Singapore (+65) with the number 87654321
- With the message body “hello world”

Curl

By default curl is available in Mac and Ubuntu. If you are running Windows, you can either download curl for Windows or install Windows Subsystem Linux then add Ubuntu into it.

Do NOT use PowerShell Invoke-RestMethod. I had tried numerous ways to send a message like the example below. “hello world” always get translated to “hello+world”. If anyone found a solution, do drop me a message.

curl -X POST \
-H 'Authorization: Bearer abcd1234' \
--data 'to=+6587654321&body=hello world' \
'http://192.168.1.234:8080/sms/send'

Postman

Image for post
Image for post
Image for post
Image for post

< Back to all the stories I had written

Written by

A software engineer, a rock climbing, diving & rollerblading enthusiast, a husband, a father.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store