Travel Suggestion to Cool Place
v1.0
Purpose : Verify user and provide a "Access Token"
API Endpoint : POST /GetAuthenticated
Request :
https://localhost:7282/api/Weather/GetAuthenticated
[ Params ]
username = raskin
password = 123
Response
{
"accessToken": "",
"expires": ""
}
Purpose : Get the temperature forecasts of each districts for up to 7 days for 64 districts at 2pm
API Endpoint : GET /TemperatureForecasts
Request :
https://localhost:7282/api/Weather/TemperatureForecasts
[ Header ]
Key = Authorization
Value = accessToken
Response
{
"2023-05-29T14:00:00": [
{
"name": "Dhaka",
"date": "2023-05-29T14:00:00",
"temperature": 31
},
.................
Purpose : Get the coolest 10 districts based on the average temperature at 2pm for the next 7 days
API Endpoint : GET /CoolestDistricts
Request :
https://localhost:7282/api/Weather/CoolestDistricts
[ Header ]
Key = Authorization
Value = accessToken
Response
[
{
"districtName": "Bandarban",
"averageTemperature": 29.442857142857143
},
............
Purpose : Compare the temperature of Friend's location and my preffered locations at 2 PM on a given day and return a response where should they travel
API Endpoint : GET /TravelSuggestion
Request :
https://localhost:7282/api/Weather/TravelSuggestion
[ Params ]
friendLocation =
destination =
travelDate
[ Header ]
Key = Authorization
Value = accessToken
Response
Your Location is Coolest, So You Should Travel to [coolest location]
Download and instal Visual Studio 2022 Link
Clone the project from this Git Repo then run the application from visual studio 2022
(If you don't find below extensions under Dependencies > Packages)
Right click on project and click Manage Nuget Packages then install below packages
- Microsoft.AspNetCore.Mvc.Newtonsoftjson(6.0.16)
- System.IdentityModel.Tokens.Jwt(6.30.1)
- Swashbuckle.AspNetCore.Annotations(6.5.0)
- Run the application from Visual Studio
- Test the APIs endpoints using Postman
- OR, use swagger to test it. just go to here : https://localhost:7282/swagger
- Github github.com/raskin-soft
- Linkedin - raskinurrashid