Skip to content

Darwin JSON responses

Daniel Pope edited this page Jul 23, 2015 · 2 revisions

The Darwin API returns replacement bus data and other messages. These things aren't yet read by trntxt. I'm putting some example JSON responses here so that I can make trntxt handle them in the near future:

2 messages from NRCC

{"GetStationBoardResult":{"generatedAt":"2015-06-21T12:36:17.188Z","locationName":"Didcot Parkway","crs":"DID","filterLocationName":"Bath Spa","filtercrs":"BTH","nrccMessages":{"message":["Trains between Bristol Temple Meads / Westbury and Swindon are being disrupted. More details can be found in <A href=\"http://nationalrail.co.uk/service_disruptions/100675.aspx \">latest travel news</A>.","Buses replace trains between Oxford and Worcester Shrub Hill. More details can be found in <A href=\"http://nationalrail.co.uk/service_disruptions/100683.aspx\">Latest Travel News.</A>"]},"platformAvailable":true}}

A couple of buses

{"GetStationBoardResult":{"generatedAt":"2015-06-21T13:57:17.800Z","locationName":"Swindon","crs":"SWI","filterLocationName":"Bath Spa","filtercrs":"BTH","nrccMessages":{"message":["Buses replace trains between Bristol Temple Meads / Westbury and Swindon. More details can be found in <A href=\"http://nationalrail.co.uk/service_disruptions/100675.aspx\">latest travel news</A>."]},"platformAvailable":true,"busServices":{"service":[{"origin":{"location":[{"locationName":"Swindon","crs":"SWI"}]},"destination":{"location":[{"locationName":"Bath Spa","crs":"BTH"}]},"std":"15:53","etd":"On time","platform":"BUS","operator":"First Great Western","operatorCode":"GW","serviceID":"LUVkvTd1nYkn9NlG5iBLdg=="},{"origin":{"location":[{"locationName":"Swindon","crs":"SWI"}]},"destination":{"location":[{"locationName":"Bath Spa","crs":"BTH"}]},"std":"16:53","etd":"On time","platform":"BUS","operator":"First Great Western","operatorCode":"GW","serviceID":"0j3Tk+POsF6wMbctomdaXw=="}]}}}

There are more places than the stations CSV suggests... (XPB)

{"GetStationBoardResult":{"generatedAt":"2015-07-23T23:14:36.550Z","locationName":"Bristol Temple Meads","crs":"BRI","platformAvailable":true,"trainServices":{"service":[{"origin":{"location":[{"locationName":"London Paddington","crs":"PAD"}]},"destination":{"location":[{"locationName":"Cardiff Central","crs":"CDF"}]},"std":"02:07","etd":"On time","operator":"First Great Western","operatorCode":"GW","serviceID":"TxN4RC9LkuiKP/cPn14JzQ=="}]},"busServices":{"service":[{"origin":{"location":[{"locationName":"Bristol Temple Meads","crs":"BRI"}]},"destination":{"location":[{"locationName":"Bristol Intl Airport (Bus)","crs":"XPB"}]},"std":"00:29","etd":"On time","operator":"First Great Western","operatorCode":"GW","serviceID":"kYLdaI7lCT71k9rqhC4u2g=="},{"origin":{"location":[{"locationName":"Bristol Temple Meads","crs":"BRI"}]},"destination":{"location":[{"locationName":"Bristol Intl Airport (Bus)","crs":"XPB"}]},"std":"00:59","etd":"On time","operator":"First Great Western","operatorCode":"GW","serviceID":"bsHvL+S/Jk6T/188OB36GQ=="},{"origin":{"location":[{"locationName":"Bristol Temple Meads","crs":"BRI"}]},"destination":{"location":[{"locationName":"Bristol Intl Airport (Bus)","crs":"XPB"}]},"std":"01:29","etd":"On time","operator":"First Great Western","operatorCode":"GW","serviceID":"ZydxbGiYXvS2ky2kNksqIg=="}]}}}
Clone this wiki locally