Update 2024-11-20: I’ve removed the pay wall for this post as this may or may not work for you. If this does work for you and/or you are so inclined to show your support, you can Buy me a Coffee.
Flowroute now requires you to register your “messaging campaign” with 10DLC in order to send/receive text messages from your Flowroute DID’s. If you use Flowroute for personal reasons, this may be a moot subject as they seem to be limiting SMS to businesses.
See: https://flowroute.com/flowroute-10dlc/
Now this may still work with other providers, if you’re able to post HTTP requests to an API that requires an Authentication Header…
On to the original post:
If you’re reading this you already know what your Synology Diskstation can do. Along with the plethora of features of the Diskstation operating system, you can configure it to send you system notifications via email and SMS texts. Email is pretty straight forward but SMS can be trickier, considering they only give you two built-in providers. But have no fear, they allow you to add your own! In this case, we’ll be using Flowroute.com
Flowroute is a SIP provider who also offers SMS/MMS capabilities, allowing you to send and receive text messages using your SIP account.
In this example, we will be configuring a DS218+ running DSM version 6.2.1 to use Flowroute v2 API in order to send system notifications to your mobile phone, assuming you have a Flowroute account with API enabled. If you haven’t turned on API, you can do so in your Flowroute control panel.
Flowroute
First, login to Flowroute.com and go to Preferences > API Control. You’ll want to copy the API accessKey and secretKey.
SMS Callback is for confirmations or receiving SMS messages, mainly for SMS gateways, neither of which we’ll be using with the Diskstation so just enter a dummy URL here. Such as http://synology.local.
Click Enable SMS
API Format should be v2.0, if for whatever reason you’re on v2.1 you’ll need to adjust the URL in Synology accordingly, but in this case we’re using v2.0 as that is what has been tested for this scenario.
Postman
Next, you’ll need to get Postman, which we will use to build your authorization key in order to use HTTP POST to send SMS messages using your Flowroute credentials.
Download Postman here (https://www.getpostman.com/apps)
When you run Postman, you’ll be asked to sign in, just click the link at the bottom to skip signing in.
Click Request (Create a Basic Request)
Under SAVE REQUEST you’ll enter Synology for the request name, and Flowroute under Collection to save to, and Save
Now we build the authorization request.
You’ll create a POST to https://api.flowroute.com/v2/messages
Under the Authorization tab you’ll choose Basic Auth
To the right you’ll use your Flowroute accessKey for the username and secretKey for the password, those were obtained earlier in this post. Make sure there are no spaces if you copied/pasted from clipboard or the message will fail.
Once you’ve entered your settings to match the above screenshot, click the Body tab.
You’re going to enter three fields here. to, from, and body. To should be your cellphone number, including area code. From will be one of the DID’s from your Flowroute account. Note: You must use one of your own DID’s or you will not be able to send messages. Body will be the content, in this case enter Test or whatever you want.
Click Send
You should see a JSON response in the lower window that looks like this:
{
“data”: {
“id”: “mdr2-fb3cb000000000000000000000000e99”
}
}
This means your submission was successful and you should receive the text message on your cellphone, otherwise any errors would be shown here.
Now click on the Headers tab, under Value you should see something like this
Basic Mj000000000000000000000000000000000000000000000000TVnR2c=
We will use this when setting up the Synology profile.
Configuring Diskstation
Now that we have our Authorization key, we can setup a custom SMS provider in Diskstation.
Log in to your Synology Diskstation
Go to Control Panel and click on Notification
Go to the SMS tab
Click Enable SMS notifications
Click Add SMS service provider
Provider Description
SMS URL: https://api.flowroute.com/v2/messages
HTTP Method: POST
Click Next
Edit HTTP Request Header
Parameter: Authorization
Value: Basic Mj000000000000000000000000000000000000000000000000TVnR2c=
This it the value you copied from Postman and will be different than you see in this example.
Click Save
Click Next
Edit HTTP Request Body
Parameter: from
Value: (leave blank)
Parameter: to
Value: (leave blank)
Parameter: body
Value: hello world
Select Corresponding Category
Now we map the fields to the Synology categories.
Authorization: Other
from=: Sender
to=: Phone number
body=hello world: Message content
Click Apply
SMS Control Panel
Back at the SMS Control Panel the options have changed, now we can enter our Sender phone number, and Recipient phone number.
Sender will be your Flowroute DID. Country code + area code included.
Recipient will be your cellphone number, Country code in the first box (ie: 1) and area code + phone number in the next, no spaces.
I have checked the SMS interval limit – Flowroute will not allow you to send more than 5 messages per second, so you’ll want to throttle any messages from your Diskstation although I doubt you would get a flood of texts, but if you did Flowroute will delay delivery, so I put 1 minute here.
Apply your changes.
Click Send a test SMS message
All set! You should receive something similar to the following:
Now you will receive system notifications such as a disk needing attention, experiencing degradation, etc… Neat!
Leave a Reply