A Bash API for Bouygues Telecom SMS unofficial API (5 SMS /day limitation)
bouyguestelecom-smsapi is a Bash library which allows to use Bouygues Telecom unofficial SMS API.
It's based on bouyguestelecom-sms.
To be able to use this feature, you must have subscribed a mobile line with Bouygues Telecom operator.
With a Bouygues Telecom account, using their Web interface, you are allowed to send until 5 SMS per day.
It's on this possibility bouyguestelecom-sms is based.
And so this Bash API.
This library is composed of two files:
-
/etc/bouyguestelecom-smsapi/bouyguestelecom-smsapi.conf.src
The configuration file
-
/usr/lib/bouyguestelecom-smsapi/bouyguestelecom-smsapi.bash.src
The library
Both are located inside the directory bouyguestelecom-smsapi which allows to build a Debian package.
Configuration file: /etc/bouyguestelecom-smsapi/bouyguestelecom-smsapi.conf.src
is in fact a file which is sourced by the Bash library.
Thus syntax is the Bash one and is composed of the following variables:
Name | Meaning | Mandatory |
---|---|---|
LASTNAME | Base64 Bouygues Telecom account last name | false |
LOGIN | Plain or base64 Bouygues Telecom login | true |
PASS | Plain or base64 password associated to login | true |
TO | Target mobile phones numbers separated by: ';' character | true |
Example:
# Base64 Bouygues Telecom account last name
LASTNAME="TGFzdCBuYW1lCg=="
# Plain or base64 Bouygues Telecom login
LOGIN="0606060606"
# Plain or base64 password associated to login
PASS="1a2B3c4D5e6F7g"
# Target mobile phones numbers separated by: ';' character
TO="0707070707"
To use the library there are only two steps:
- Source the library:
. /usr/lib/bouyguestelecom-smsapi/bouyguestelecom-smsapi.bash.src
- Call the function to send a SMS:
callBouyguesTelecomSmsApi "My first SMS"
In this example My first SMS will be sent to the number 0707070707 which is defined in the configuration file.
Exit code will be 0
in case of success, 1
otherwise.
Build and installation steps are described in bouyguestelecom-sms repository.
You can create the Debian package with the following commands:
# Move to the repository directory
cd /github/bouyguestelecom-smsapi/repository/path
# Generate the Debian package
sudo dpkg-deb --build bouyguestelecom-smsapi
# Update the package name following Debian convention
VERSION=$(grep "Version" bouyguestelecom-smsapi/DEBIAN/control | cut -d ' ' -f 2)
ARCH=$(grep "Architecture" bouyguestelecom-smsapi/DEBIAN/control | cut -d ' ' -f 2)
mv bouyguestelecom-smsapi.deb bouyguestelecom-smsapi_${VERSION}_${ARCH}.deb
bouyguestelecom-smsapi is released under the BSD 3-Clause License.
See the bundled LICENSE.md
for details.