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!

2 thoughts on “Sending SMS using Infobip service and MikroTik tool / fetch feature

  1. Pingback: Scripting • Sending SMS using Infobip service and MikroTik tool / fetch feature – http-header-field example – Mags Forum Technology

  2. Pingback: MikroTik – Netwatch enhanced (updated June 2019) | Luka Manojlovic

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.