I am trying to write a c# .NET app to get the live arrival time for a specific bus at a specific stop. So far I have run the following code.
var client = new HttpClient();
var queryString = HttpUtility.ParseQueryString(string.Empty);
var uri = "https://api.tfl.gov.uk/Mode/bus/Arrivals?" + queryString;
string responseBody = await client.GetStringAsync(uri);
and received the JSON data back for all buses in return. I assume I need to get the id of the bus I am interested in from either that data, or from a bus number to id translation call, then call
for example, to get the exact JSON data for the bus, including the number of minutes until arrival at a stop.
What I cant figure out is what the point of Tfl.Api.Presentation.Entities is? I sort of assumed I could take the JSON data and pass it as a parameter to maybe the Prediction class constructor or another class and get a class with all the data in the properties. There doesn’t seem to be anything like that though.
If I have to parse the JSON data myself and then fill in the structure, is their any point in referencing the Tfl.Api.Presentation.Entities dll.
What am I missing here?