Weather Report

Weather Report API
Powered by DTN

Overview


Weather Report Service is web API that from one side has weather report templates, from other side various web API data sources (e.g. MOSI, warnings, met text, etc) as a result there is JSON data contract with shiny XHTML or JSON report content.

Supports OAuth 2.0, Auth0.

HTTP Status Codes


This API uses HTTP status codes to communicate with the API consumer.

Error Responses


This API returns HTTP status code 400 Bad Request and human-readable error messages in response body when an error is encountered.


Generic Errors

Example:
                    
            {
                "__ERROR__": [
                    "Something weird happened."
                ]
            }
                    
                
Validation Errors

Example:
                    
            {
                "template": [
                    "The value does not belong to the list of known items."
                ]
            }
                    
                

Reports

Retrieve HTML report
[/reports/{regionCode}?template={templateName}]


Fetch a single Weather Report [GET]
                    
            {
                "metadata": {
                    "title": "ABC Radio London forecast script",
                    "issuedAt": "2012-12-14T03:15:15Z"
                },
                "content": "html content or json object"
            }
                    
                


Retrieve list of all HTML reports
[/reports]



Fetch all available HTML Weather Reports [GET]
                    
            {
                "items": [
                    {
                        "title": "ABC Radio London forecast script",
                        "region": "london",
                        "link": "http://reports.weather.mg/reports/london?template=standard"
                    }
                ]
            }
                    
                


Retrieve JSON report
[/forecast-texts/{regionCode}]



Fetch a single JSON Forecast Report [GET]
                    
            {
                "metadata": {
                    "title": "ABC Radio London forecast script",
                    "issuedAt": "2017-04-26T16:14:12Z"
                },
                "content": {
                    "headline": "Often rather cloudy, but also some brighter or sunny spells.",
                    "today": [
                        {
                            "title": "Today",
                            "forecast": "A chilly start with showers becoming rather more widespread through the morning."
                        },
                        {
                            "title": "Tonight",
                            "forecast": "Showers becoming isolated and mainly confined to western areas"
                        }
                    ],
                    "tomorrow": [
                        {
                        "title": "Thursday",
                            "forecast": "Rain, some heavy, spreading eastwards, and affecting most parts then a few showers following."
                        }
                    ],
                    "outlook": [
                        {
                            "title": "Outlook for Friday to Sunday",
                            "forecast": "Saturday probably dry with sunny spells. Cold northeasterly winds throughout. Chance of overnight frost."
                        }
                    ]
                }
            }
                    
                


Retrieve list of all JSON reports
[/forecast-texts]



Fetch all available JSON Forecast Reports [GET]
                    
            {
                "items": [
                    {
                        "title": "ABC Radio London forecast script",
                        "region": "london",
                        "link": "http://reports.weather.mg/forecast-texts/london"
                    }
                ]
            }
                    
                

Guidance

Retrieve Guidance Region Codes
[/guidances]



Fetch a all existed Region Codes for Guidance [GET]
                    
            [
                {
                    "regionCode": "uk",
                    "title": "UK"
                },
                {
                    "regionCode": "row",
                    "title": "Rest Of World"
                }
            ]
                    
                


Retrieve guidance report
[/guidances/{regionCode}]



Fetch a Guidance report for region code [GET]
                    
            {
                "metadata": {
                    "title": "United Kingdom guidance",
                    "issuedAt": "2012-12-14T03:15:15Z"
                },
                "content": {
                    "summary": "It will be a brighter day across England and Wales with sunny periods ...",
                    "synopticEvolutionModelDiscussion": "Low pressure will remain to the west of the UK today, with a blocking ...",
                    "forecast": [
                        {
                            "label": "wednesday",
                            "content": "Generally cloudy and mild with outbreaks..."
                        },
                        {
                            "label": "thursday",
                            "content": "Pulses of rain may spread northwards..."
                        },
                        {
                            "label": "friday",
                            "content": "A rather cloudy day, despite rising pressure..."
                        },
                        {
                            "label": "saturday",
                            "content": "Areas of mist, fog and low cloud thinning..."
                        },
                        {
                            "label": "sunday",
                            "content": "A south-westerly flow with a fair amount of cloud..."
                        },
                        {
                            "label": "6-10 day Outlook",
                            "content": "It is likely that high pressure will dominate..."
                        }
                    ]
                }
            }
                    
                

Authentication


For detailed instructions on how to obtain the necessary authorization information, please refer to the technical documentation on Bitbucket.