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
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:
Synology Text Notifications
Log in to your Synology NAS, then open the "Control Panel" > "Notifications" > "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".
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
The last step asks the HTTP method to make sure the GET is selected:
Finally, click on the Apply button to save the new Text message notification. A new webhook element will appear on the Synology notification interface:
To verify whether it works, click the "Send Text Message" button, and you must receive the following message on your phone:
Voilà, now you will receive notification from your Synology NAS through Text Messages, Cheers! 🍻