Send HTTP Commands to MikroTik

Hi there,
Would it be possible to “command” MikroTik router by sending HTTP request to it?

e.g. http://username:password@Router_IP:Port_number/tool sms send usb3 message=“ABCDEFGHIJKLMNOPQRSTUV”

In order words is it possible to send an sms by sending a HTTP request to Mikrotik?

Any clue would be much appreciated

Paco

I don’t think so, not directly.

You could set up a web server in the middle that would do something similar, using the API and PHP for instance. The SMS functionality would not be necessary in this case.

What you are trying to accomplish?

Skot thanks for answering, let me clarify the scope.
i’m integrating a sms gateway with my home automation box (veralite)
That box can easily interface using HTTP get requests (incoming and outgoing)
I’ve got Mikrotik 5.24 running on an Alix board 2D13 with a 3G usb stick hooked up.

My target schema is the following :
Devices<>Vera<(GET HTTP)>MK<->USB 3G<->SMS
I’m focused on the interface between Vera and MK :

1)incoming SMS into MK works actually with a scheduled script which catchs the SMS parses it and makes a HTTP get to the Vera
2)outcoming SMS (Vera ->MK->USB 3G) is what i’m trying to implement. I’d like to trigger this way like the other i.e.using HTTP get request
and therefore make use of a unique interface both directions.

Running a PHP script on the Vera works but does not comply with point 2 :frowning:

Paco

you can send commands to RouterOS via SMS. Look up at wiki.mikrotik.com

Janisk that’s already in place and works see point 1 in my previous post.

My aim is howto send out a SMS by sending a HTTP Get request to MK ?

You’ll have to send commands to the MikroTik using a different method, such as SSH or FTP: http://forum.mikrotik.com/t/scripts-that-interact-between-different-mikrotik-routers/63478/1

To add to skot’s point, if the veralite does allow you to run a PHP script on it* or something else, then you can also use the API no problem.

I mean, what’s more important - that you command RouterOS from Veralite somehow, or that you command RouterOS from Veralite using only HTTP? I’d argue the former is the more important bit.

  • I assume this is the case based on

Thanks to all of you. I’ll use PHP for outgoing SMS :smiley:

if you can use PHP, you can control RouterOS router directly via API. as noted by boen_robot. That would be also preferred interface to do that.