Sample server-application that exposes a REST service able to send SMSs using MessageBird's API.
Application starts a Tomcat server on localhost (port 8443
) and a scheduled task that will execute every second and send to MessageBird's API the messages pending.
- It exposes 2 services:
request-sms
(POST) to send a SMS.report
(GET) to check status of already sent SMSs.
- It uses a H2 database running on memory, to store the created (and pending) SMSs. Meaning, you will lose all data if you reboot the application.
- Server only accepts SSL communications (use
ssl-server.crt
as valid certificate).
- Clone this repository.
git clone https://github.com/dpradom/smsproxy
- Edit
src/main/resources/application.properties
to set your MessageBird's API key onsender.apiKey
. - Build the project.
mvn clean install
- Start it.
java -jar smsproxy-0.0.1-SNAPSHOT.jar
Sample request to create a SMS using curl:
curl -k --header "Content-Type: application/json" --request POST \
--data "{\"recipient\":1555432112,\"originator\":\"INBOX\",\"message\":\"This is a test message.\"}" \
https://localhost:8443/request-sms
- 0.0.1
- Work in progress
Daniel Prado โ [email protected]
Distributed under the GPLv3 license. See LICENSE
for more information.