AsiaSkills_Session2

General notes

API detail

Get Current Truck Location

The method returns current location coordinates (latitude and longitude values) of a specific truck.

The method contains path parameter - Number of the truck. /api/Location/{TruckNumber}, where {TruckNumber} is “T897OK01”, for example.

HTTP codes

200 - OK

404 - No Truck found

curl -X GET "http://web.ws.int:8050/api/Location/O745BY25"
GET /api/Location/O745BY25 HTTP/1.1
Host: web.ws.int:8050
Status200 OK
{
    "CurrentLocationLatitude": 57.734002847098942,
    "CurrentLocationLongitude": 72.226281840318592
}
Status404 Not Found

Get Distance

The method return distance (in meters) between two points, based on their coordinates (latitude and longitude) in query parameters.

HTTP codes

200 - OK

400 - Invalid coordinates

curl -X GET "http://web.ws.int:8050/api/Distance?lat1=55.624396&lng1=116.312868&lat2=69.090343&lng2=72.881931"
GET /api/Distance?lat1=55.624396&lng1=116.312868&lat2=69.090343&lng2=72.881931 HTTP/1.1
Host: web.ws.int:8050

Get Parking Video Streams

The method returns the list with all installed cameras on Truck Parks.

If camera on Truck Park isn’t working right now, then null value will be returned in CameraFrame.

HTTP codes

200 - OK

curl -X GET "http://web.ws.int:8050/api/VideoStreams"
GET /api/VideoStreams HTTP/1.1
Host: web.ws.int:8050
Status200 OK
[
    {
        "ParkingId": 1,
        "ParkingName": "Hogwash Garage",
        "CameraFrame": null
    },
    {
        "ParkingId": 2,
        "ParkingName": "Peripheral Parkers",
        "CameraFrame": "\r\n\r\n\r\n    \r\n    \r\n    \r\n    Moving\r\n    \r\n\r\n\r\n    
\r\n
\r\n
\r\n
2
\r\n
\r\n \r\n\r\n" }, { "ParkingId": 3, "ParkingName": "Darting Parking", "CameraFrame": "\r\n\r\n\r\n \r\n \r\n \r\n Moving\r\n \r\n\r\n\r\n
\r\n
\r\n
\r\n
3
\r\n
\r\n \r\n\r\n" }, { "ParkingId": 4, "ParkingName": "The Attendant Truck", "CameraFrame": "\r\n\r\n\r\n \r\n \r\n \r\n Moving\r\n \r\n\r\n\r\n
\r\n
\r\n
\r\n
4
\r\n
\r\n \r\n\r\n" }, { "ParkingId": 5, "ParkingName": "Snorting Parking", "CameraFrame": "\r\n\r\n\r\n \r\n \r\n \r\n Moving\r\n \r\n\r\n\r\n
\r\n
\r\n
\r\n
5
\r\n
\r\n \r\n\r\n" }, { "ParkingId": 6, "ParkingName": "Clever Car Collective", "CameraFrame": "\r\n\r\n\r\n \r\n \r\n \r\n Moving\r\n \r\n\r\n\r\n
\r\n
\r\n
\r\n
6
\r\n
\r\n \r\n\r\n" }, { "ParkingId": 7, "ParkingName": "Paved Parkway", "CameraFrame": null }, { "ParkingId": 8, "ParkingName": "Roadside Place", "CameraFrame": "\r\n\r\n\r\n \r\n \r\n \r\n Moving\r\n \r\n\r\n\r\n
\r\n
\r\n
\r\n
8
\r\n
\r\n \r\n\r\n" }, { "ParkingId": 9, "ParkingName": "The Unused Parking", "CameraFrame": null }, { "ParkingId": 10, "ParkingName": "The Frightened Assistant", "CameraFrame": null } ]