narlock / WeatherMessageAPI

Spring-based RESTful API that delivers weather information through text SMS messaging and phone calls.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

Spring Boot Java Apache Groovy

Context

API Specification

POST weather/v1/sms

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!"
}

POST weather/v1/voice

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

About

Spring-based RESTful API that delivers weather information through text SMS messaging and phone calls.


Languages

Language:Groovy 56.5%Language:Java 43.5%