{"openapi":"3.0.0","info":{"title":"4see Analytics APIs","description":"4see Analytics APIs data","contact":{"email":"info@annet.com"},"license":{"name":"Apache 2.0","url":"https://www.apache.org/licenses/LICENSE-2.0.html"},"version":"1.0.0"},"servers":[{"url":"https://dev-4see.azurewebsites.net/","description":"Production server"},{"url":"http://localhost:8000/api/documentation","description":"Development server"}],"tags":[{"name":"Get Authentication Token","description":"Get Authentication Token"},{"name":"Credit Ratings","description":"Credit Ratings"},{"name":"Weather APIs","description":"Weather APIs"},{"name":"Currency Exchange Rate","description":"Currency Exchange Rate API"}],"paths":{"/api/getAuthToken":{"post":{"tags":["Get Authentication Token"],"summary":"To Get AccessToken required for API calls","description":"Returns a token for authentication","operationId":"getAuthToken","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthTokenRequest"}}},"required":true},"responses":{"200":{"description":"Successful login","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthTokenResponse"}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthTokenUnauthorizedResponse"}}}}}}},"/api/getCreditRatings":{"post":{"tags":["Credit Ratings"],"summary":"Get Credit Ratings by Tenant Name","operationId":"getCreditRatings","parameters":[{"name":"AccessToken","in":"header","description":"Access token received from getAuthToken API","required":true,"style":"simple","explode":false,"schema":{"type":"string","example":"Irb74OWsnY7UfxLaZJhSJSexc62Bqx1TDyBZEqb9ud4e1OZ5Yqc8eHEbAPglK3RpsxyuPrVIJbQMpSww"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreditRatingsRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CreditRatingsResponse"}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenericUnauthorizedResponse"}}}}}}},"/api/getCurrentWeatherData":{"post":{"tags":["Weather APIs"],"summary":"Get Current Weather Information by Zipcode","description":"Returns the current weather observation for a given postal code.","operationId":"getCurrentWeatherData","parameters":[{"name":"AccessToken","in":"header","description":"AccessToken obtained from getAuthToken API response","required":true,"style":"simple","explode":false,"schema":{"type":"string","example":"Irb74OWsnY7UfxLaZJhSJSexc62Bqx1TDyBZEqb9ud4e1OZ5Yqc8eHEbAPglK3RpsxyuPrVIJbQMpSww"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CurrentWeatherRequest"}}},"required":true},"responses":{"200":{"description":"Successful weather data retrieval or error response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CurrentWeatherResponse"}}}}}}},"/api/getForecastWeatherData":{"post":{"tags":["Weather APIs"],"summary":"Get 7 days forecast weather data by postal code","operationId":"getForecastWeatherData","parameters":[{"name":"AccessToken","in":"header","description":"Access token obtained from getAuthToken API","required":true,"style":"simple","explode":false,"schema":{"type":"string","example":"Irb74OWsnY7UfxLaZJhSJSexc62Bqx1TDyBZEqb9ud4e1OZ5Yqc8eHEbAPglK3RpsxyuPrVIJbQMpSww"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForecastWeatherRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ForecastWeatherResponse"}}}}},"401":{"description":"Unauthorized - Invalid AccessToken","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForecastWeatherUnauthorizedResponse"}}}},"404":{"description":"No data found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"}}}}}}},"/api/getHistoricalWeatherData":{"post":{"tags":["Weather APIs"],"summary":"Get Historical Weather Data","operationId":"getHistoricalWeatherData","parameters":[{"name":"AccessToken","in":"header","description":"Access token received from getAuthToken API","required":true,"style":"simple","explode":false,"schema":{"type":"string","example":"Irb74OWsnY7UfxLaZJhSJSexc62Bqx1TDyBZEqb9ud4e1OZ5Yqc8eHEbAPglK3RpsxyuPrVIJbQMpSww"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HistoricalWeatherRequest"}}},"required":true},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/HistoricalWeatherResponse"}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenericUnauthorizedResponse"}}}}}}},"/api/currency-exchange-rates":{"get":{"tags":["Currency Exchange Rate"],"summary":"Get Currency Exchange Rates","description":"Returns currency exchange rates. If no date is provided, it will return the latest rates.","operationId":"getCurrencyExchangeRates","parameters":[{"name":"AccessToken","in":"header","description":"Enter the AccessToken obtained from getAuthToken API response.","required":true,"schema":{"type":"string"}},{"name":"date","in":"query","description":"(Optional) The date for which to retrieve exchange rates in YYYY-MM-DD format. If omitted, the latest rates are returned.","required":false,"schema":{"type":"string","format":"date"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CurrencyExchangeRateResponse"}}}}},"401":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenericUnauthorizedResponse"}}}},"404":{"description":"No data found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFoundResponse"}}}}}}}},"components":{"schemas":{"AuthTokenRequest":{"required":["email","password"],"type":"object","properties":{"email":{"type":"string","format":"email","example":"user@example.com"},"password":{"type":"string","format":"password","example":"password123"}}},"AuthTokenResponse":{"type":"object","properties":{"email":{"type":"string","example":"user@example.com"},"password":{"type":"string","example":"password123"}}},"AuthTokenUnauthorizedResponse":{"type":"object","properties":{"success":{"type":"boolean","example":false},"message":{"type":"string","example":"Unauthorised."},"code":{"type":"integer","example":401},"data":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorised"}}}}},"CreditRatingsRequest":{"required":["tenant_name"],"type":"object","properties":{"tenant_name":{"type":"string","description":"Name of the tenant to get credit ratings for","example":"Home Depot"}}},"CreditRatingsResponse":{"type":"object","properties":{"TenantName":{"type":"string","example":"Home Depot"},"ParentCompany":{"type":"string","example":"Home Depot Inc."},"CreditRating":{"type":"string","example":"A"},"Outlook":{"type":"string","example":"Stable"},"CreditRatingDate":{"type":"string","example":"15 Oct 2013"}}},"GenericUnauthorizedResponse":{"type":"object","properties":{"success":{"type":"boolean","example":false},"message":{"type":"string","example":"Bad Request."},"code":{"type":"integer","example":401},"data":{"type":"object","properties":{"error":{"type":"string","example":"Unauthorised"}}}}},"CurrentWeatherRequest":{"required":["zipcode"],"type":"object","properties":{"zipcode":{"type":"string","description":"Postal code to get weather data","example":"400051"}}},"CurrentWeatherResponse":{"oneOf":[{"type":"object","properties":{"success":{"type":"boolean","example":true},"data":{"type":"object","properties":{"Zipcode":{"type":"string","example":"400051"},"Latitude":{"type":"string","example":"19.06"},"Longitude":{"type":"string","example":"72.87"},"Date":{"type":"string","format":"date","example":"2020-12-31"},"Sunrise":{"type":"string","example":"07:11 AM"},"Sunset":{"type":"string","example":"06:11 PM"},"Temp":{"type":"string","example":"27.777777"},"FeelsLike":{"type":"string","example":"29.444444"},"Pressure":{"type":"string","example":"1010"},"HumidityPercent":{"type":"string","example":"58"},"DewPoint":{"type":"string","example":"18.888888"},"WindSpeed":{"type":"string","example":"9"},"WindDirectionDegree":{"type":"string","example":"330"},"Visibility":{"type":"string","example":"22"},"Weather":{"type":"string","example":"Smoke"},"Description":{"type":"string","example":"smoke"},"CloudinessPercent":{"type":"string","example":"88"},"CreatedDate":{"type":"string","format":"date-time"},"RowNum":{"type":"string","example":"1"}}},"message":{"type":"string","example":"User login successfully."},"code":{"type":"integer","example":200}}},{"type":"object","properties":{"success":{"type":"boolean","example":false},"message":{"type":"string","example":"No data found!"},"code":{"type":"integer","example":200},"data":{"type":"object","properties":{"error":{"type":"string","example":"No data found!"}}}}}]},"ForecastWeatherRequest":{"required":["zipcode"],"type":"object","properties":{"zipcode":{"type":"string","description":"Postal code to fetch weather data","example":"400051"}}},"ForecastWeatherResponse":{"type":"object","properties":{"Zipcode":{"type":"string","example":"400051"},"Latitude":{"type":"string","example":"19.06"},"Longitude":{"type":"string","example":"72.87"},"Date":{"type":"string","example":"2021-01-01"},"Sunrise":{"type":"string","example":"07:11 AM"},"Sunset":{"type":"string","example":"06:11 PM"},"TempDay":{"type":"string","example":"27.777777"},"TempMin":{"type":"string","example":"24.444444"},"TempMax":{"type":"string","example":"28.333333"},"TempNight":{"type":"string","example":"25.555555"},"TempEvening":{"type":"string","example":"27.222222"},"TempMorning":{"type":"string","example":"25.000000"},"FeelsLikeDay":{"type":"string","example":"28.888888"},"FeelsLikeNight":{"type":"string","example":"26.666666"},"Pressure":{"type":"string","example":"1013"},"HumidityPercent":{"type":"string","example":"48"},"WindSpeed":{"type":"string","example":"5"},"Weather":{"type":"string","example":"Clouds"},"Description":{"type":"string","example":"scattered clouds"},"UVIndex":{"type":"string","example":"7"}}},"ForecastWeatherUnauthorizedResponse":{"type":"object","properties":{"success":{"type":"boolean","example":false},"message":{"type":"string","example":"Invalid AccessToken"},"code":{"type":"integer","example":401}}},"NotFoundResponse":{"type":"object","properties":{"success":{"type":"boolean","example":false},"message":{"type":"string","example":"No data found!"},"code":{"type":"integer","example":404}}},"HistoricalWeatherRequest":{"required":["enddate","startdate","zipcode"],"type":"object","properties":{"zipcode":{"type":"string","description":"Postal code to get historical weather data","example":"400051"},"startdate":{"type":"string","description":"Start date for historical weather data","format":"date","example":"2020-12-26"},"enddate":{"type":"string","description":"End date for historical weather data","format":"date","example":"2020-12-27"}}},"HistoricalWeatherResponse":{"type":"object","properties":{"Zipcode":{"type":"string","example":"400051"},"Latitude":{"type":"string","example":"19.060189999999999"},"Longitude":{"type":"string","example":"72.865167999999997"},"Date":{"type":"string","example":"2020-12-26"},"Sunrise":{"type":"string","example":"07:10 AM"},"Sunset":{"type":"string","example":"06:09 PM"},"Moonrise":{"type":"string","example":"03:20 PM"},"Moonset":{"type":"string","example":"03:42 AM"},"MoonPhase":{"type":"string","example":"Waxing Gibbous"},"TempMax":{"type":"string","example":"29"},"TempMin":{"type":"string","example":"26"},"TempAvg":{"type":"string","example":"28"},"WeatherDescription":{"type":"string","example":"Partly cloudy"},"HumidityPercent":{"type":"string","example":"51"},"PressureMb":{"type":"string","example":"1012"}}},"CurrencyExchangeRateResponse":{"type":"object","properties":{"Currency":{"type":"string","example":"USD"},"Rate":{"type":"number","example":1}}}}}}