Weather Message API
Anthony Narlock
This project aims to build a Spring-based RESTful API that delivers weather information through text SMS messaging and phone calls.
Context
API Specification
weather/v1/sms
POST Sends a message to an array of phone numbers with the current weather information for a specific location.
Request
POST /weather/v1/sms
{
"weatherCity": "New York",
"weatherCountryCode": "US",
"contact": "1112223333",
"unit": "F"
}
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"weatherInformation": {
"city": "New York",
"countryCode": "US",
"temp": 42,
"unit": "F",
"description": "Clear"
},
"status": "QUEUED",
"message": "Hello there, currently it's clear with a temperature of 42 degrees F in New York, US!"
}
weather/v1/voice
POST Makes a voice call to an array of phone numbers and delivers the current weather information for a specific location.
Request
POST /weather/v1/voice
{
"weatherCity": "New York",
"weatherCountryCode": "US",
"contact": "1112223333",
"unit": "F"
}
Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"weatherInformation": {
"city": "New York",
"countryCode": "US",
"temp": 42,
"unit": "F",
"description": "Clear"
},
"status": "QUEUED",
"message": "Hello there, currently it's clear with a temperature of 42 degrees F in New York, US!"
}
Test Coverage
Developer Environment Dependencies
- OpenWeather API - Weather data API to retrieve weather information.
- Twilio - A cloud communications platform for sending SMS and making phone calls.
Developer Convention Information
- Standard Spring Boot Layout (Controller, Service, Model packages).
- Testing utilizing Spock framework.
- Properties hidden in
application.yaml
are stored in a secrets file.
Future Developments
- Implement GraphQL Integration