Tag Archives: mikrotik sms fetch http-header-field

Sending SMS using Infobip service and MikroTik tool / fetch feature

My recent article related to enhancement of Netwatch feature in MikroTik was created as a prerequisite for a simple alerting solution with e-mail / SMS notifications channels.

I am using Infobip SMS platform and they have clear and simple API solution (nicely documented) for sending SMS messages (I was able to make it work from Powershell – documented here.).

I was searching a bit and I saw that MikroTik changed something in the way tool called fetch works when we need to send header fields – as it can be read here, here and in official documentation here.

The working command – tested on MikroTik with RouterOS 6.44.3 (june 2019) is:

/tool fetch http-method=post mode=https http-header-field=”content-type:application/json,Authorization:Basic key23123832″ http-data=”{ \”from\”:\”MyMonitoring\”, \”to\”:[\”386xxyyyzzz\”], \”text\”:\”HOST x.x.x.x DOWN\”}” url=https://api.infobip.com/sms/1/text/single

So – the important thing to point out is the way you provide http-header-field:
http-header-field=”content-type:application/json,Authorization:Basic key23123832″

Hope it helps!

Advertisements