Rut24x http send sms with http post

Hi,
in the Wiki dokumentation it sayes that we can use HTTP get end HTTP post to send SMS thru a Rut24x
HTTP Get is working
http://192.168.1.1/cgi-bin/sms_send?username=user1&password=user_pass&number=0037060000001&text=testmessage

But HTTP post does not work:
i tryed to send a JSON string:
{
“data”: {
“username”: “user1”,
“password”: “user_pass”,
“number”: “12345678”,
“message”: “string”,
“modem”: “2-1”
}

But this does not work.

Any ideas how to send a HTTP post to send a SMS?

Yes, http get URL is working. :slight_smile:

Hello,

Could you tell me what application you use to send/get these requests?

I’ve personally tried to do the same as you by using Postman as my app.

Basically, to send an SMS, my request URL looks like this:
http://192.168.1.1/api/messages/actions/send

And your body should look like this:

{
  "data": {
    "number": "+YourPhoneNumber",
    "message": "YourMessage",
    "modem": "YourModemID"
  }
}

Do make sure, however, that the bearer token is set on your call, under the authorization tab. And make sure that it is set to POST and not GET

To get the bearer token , you’ll need to send a POST request to Login to the device, which the URL should look like this:
http://192.168.1.1/api/login

The actual body of the request should look like this:

{
    "username":"admin",
    "password":"YourPassword123"
}

Let me know if you succeed or not,
M.

This topic was automatically closed after 60 days. New replies are no longer allowed.