Using SMS messages, send queries and get responses from web apis. The application is a web server pluggable to Vonage APIs (formerly Nexmo) inbound message webhook.
For example sending an SMS text bicloo gare maritime
to a bought Vonage phone number triggers the application to call the JCDecaux’s
self-service bicycles (bicloo in Nantes, France) API to get available bikes and bike stands and send it back as a SMS.
- https://dashboard.nexmo.com/your-numbers => buy virtual phone number
- https://dashboard.nexmo.com/settings => activate Messages API
- https://dashboard.nexmo.com/applications => new application, activate Messages capability and set Inbound URL
- link virtual phone number to the new application
see example config.yml
make
make build-cli
make run-cli from=... query="..." send=false # print
make run-cli from=... query="..." send=true # send SMS
# examples (based on config/config.yml)
SMS_GATEWAY_ALLOWED_PHONE_NUMBERS_1=33601020304 make run-cli from=33601020304 query="help" send=false
SMS_GATEWAY_ALLOWED_PHONE_NUMBERS_1=33601020304 make run-cli from=33601020304 query="search lemonde" send=false
SMS_GATEWAY_ALLOWED_PHONE_NUMBERS_1=33601020304 make run-cli from=33601020304 query="news" send=false
make test
see config file .pre-commit-config.yaml
pre-commit install
- https://developer.nexmo.com/messages/code-snippets/configure-webhooks
- https://developer.nexmo.com/messages/concepts/signed-webhooks
https://developer.jcdecaux.com/
http://data.nantes.fr/donnees/detail/info-trafic-temps-reel-de-la-tan/
https://opendata.stif.info/page/home/
https://www.vianavigo.com/accueil
http://doc.navitia.io/#next-departures-and-arrivals
https://canaltp.github.io/navitia-playground/
https://darksky.net/forecast/47.2186,-1.5541/us12/en
export PHONE_NUMBER=...
export NEXMO_KEY=...
export NEXMO_SECRET=...
export NEXMO_SIGNATURE_SECRET=...
export NEXMO_PHONE_NUMBER=...
export CYCLOCITY_JCDECAUX_API_KEY=...
export CLEVER_TOKEN=...
export CLEVER_SECRET=...
./scripts/clever-cloud-create.sh
export CLEVER_TOKEN=...
export CLEVER_SECRET=...
clever deploy