POST /api/v0/road_trip
Content-Type: application/json
Accept: application/json
Requirements:
This POST endpoint should NOT call your endpoint like /api/v0/road_trip?origin=Cincinatti,OH&destination=Chicago,IL&api_key=t1h2i3s4_i5s6_l7e8g9i10t11, and should NOT send as form data either. You must send a JSON payload in the body of the request
in Postman, under the address bar, click on “Body”, select “raw”, which will show a dropdown that probably says “Text” in it, choose “JSON” from the list
this is a hard requirement to pass this endpoint!
API key must be sent
If no API key is given, or an incorrect key is provided, return 401 (Unauthorized)
You will use MapQuest’s Directions API: https://developer.mapquest.com/documentation/directions-api/
The structure of the response should be JSON API 1.0 Compliant.
Your code should allow for the following: (NOTE: These scenarios are expected in your POSTMAN Demo)
Traveling from New York, NY to Los Angeles, CA, with appropriate weather in L.A. when you arrive 40 hours later
Traveling from New York, NY to Panama City, Panama, with appropriate weather in Panama when you arrive 3 days later
Traveling from New York, NY to London, UK, weather block should be empty and travel time should be “impossible”
POST /api/v0/road_trip Content-Type: application/json Accept: application/json
Requirements:
This POST endpoint should NOT call your endpoint like /api/v0/road_trip?origin=Cincinatti,OH&destination=Chicago,IL&api_key=t1h2i3s4_i5s6_l7e8g9i10t11, and should NOT send as form data either. You must send a JSON payload in the body of the request
API key must be sent If no API key is given, or an incorrect key is provided, return 401 (Unauthorized) You will use MapQuest’s Directions API: https://developer.mapquest.com/documentation/directions-api/ The structure of the response should be JSON API 1.0 Compliant.
Your code should allow for the following: (NOTE: These scenarios are expected in your POSTMAN Demo)