Send Text Notification from your Synology NAS with Free Mobile (SMS)

Steeve - Apr 29 - - Dev Community

This article is for you if you own a Synology NAS and your Mobile provider is Free Mobile.

Free Mobile API

Free Mobiles provides an API endpoint to send text messages to yourself when you have a phone subscription. The feature has been available since June 2014. However, it is not documented officially.

You must make a GET request to the following the API endpoint:

GET https://smsapi.free-mobile.fr/sendmsg?user=$user&pass=$pass&to=$to&msg=$message
Enter fullscreen mode Exit fullscreen mode

Details of each query parameter:

  • $user: Your Free login
  • $pass: Your API key
  • $to: Your phone number
  • $message: The message URL encoded.

The API returns the following code responses:

Status Code Meaning
200 The text message (SMS) has been sent to your mobile phone.
400 One of the query parameter is missing.
402 Too many text message has been sent in a short period.
403 The service is not activated on your Free account, or the login is incorrect, or the password is not valid.
500 Server error, try the request again later.

To get your API key, log in to your Free Account, then click on the "My Option" link on the left. Then activate the option Notifications par SMS, your API key will appear:

Free Mobile interface to get the API key

Synology Text Notifications

Log in to your Synology NAS, then open the "Control Panel" > "Notifications" > "Webhooks".

Synology Notification interface to manage webhooks

In the middle of the screen, click on "Add", you will get the following view. For the provider option, select "Custom", and for the rule, it's up to you: it defines which notifications are send, you may select "critical".

Image description

Then, the popup displays a form with configurations:

  • For the Provider Name, write "Free Mobile".
  • For the Subject, write any subject your want.
  • For the Webhook URL, write the Free API endpoint and replace the $user, $pass and $to with their corresponding values.
https://smsapi.free-mobile.fr/sendmsg?user=$user&pass=$pass&to=$to&msg=%40%40TEXT%40%40
Enter fullscreen mode Exit fullscreen mode

Popup configuration to setup the API URL

The last step asks the HTTP method to make sure the GET is selected:

Last notification configuration

Finally, click on the Apply button to save the new Text message notification. A new webhook element will appear on the Synology notification interface:

List of webhooks on the synology interface

To verify whether it works, click the "Send Text Message" button, and you must receive the following message on your phone:

Text message received from a Synology NAS on Iphone

Voilà, now you will receive notification from your Synology NAS through Text Messages, Cheers! 🍻

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .