jpsingleton/Huxley

Not getting "delayedTrains" from "delays" board

krgough opened this issue · 1 comments

API call and response attached below. Note there are 'trainServices' but no 'delayedTrains'. I'm not sure if I've formed the call wrong or if this is a real error. First trainService in the response is showing a short delay (1min). I'm pretty sure I was getting 'delayedTrains' a few days ago.

Call:

https://huxley.apphb.com/delays/win/to/wat?accessToken=

Response:

{'areServicesAvailable': True,
'busServices': None,
'crs': 'WIN',
'ferryServices': None,
'filterLocationName': 'London Waterloo',
'filterType': 0,
'filtercrs': 'WAT',
'generatedAt': '2018-11-06T13:05:12.8612475+00:00',
'locationName': 'Winchester',
'nrccMessages': [{'value': 'Disruption at Manchester Piccadilly. A broken '
'rail means trains may be delayed, amended or '
'cancelled. More information can be found in <A '
'href="http://nationalrail.co.uk/service_disruptions/205620.aspx">Latest '
'Travel News.'}],
'platformAvailable': True,
'trainServices': [{'adhocAlerts': None,
'cancelReason': None,
'currentDestinations': None,
'currentOrigins': None,
'delayReason': None,
'destination': [{'assocIsCancelled': False,
'crs': 'WAT',
'futureChangeTo': None,
'locationName': 'London Waterloo',
'via': None}],
'detachFront': False,
'eta': '13:19',
'etd': '13:20',
'filterLocationCancelled': False,
'isCancelled': False,
'isCircularRoute': False,
'isReverseFormation': False,
'length': 5,
'operator': 'South Western Railway',
'operatorCode': 'SW',
'origin': [{'assocIsCancelled': False,
'crs': 'WEY',
'futureChangeTo': None,
'locationName': 'Weymouth',
'via': None}],
'platform': None,
'rsid': 'SW924200',
'serviceID': 'RIjbPmh4EmsVDJW+T4uKQA==',
'serviceIdGuid': '3edb8844-7868-6b12-150c-95be4f8b8a40',
'serviceIdPercentEncoded': 'RIjbPmh4EmsVDJW%2bT4uKQA%3d%3d',
'serviceIdUrlSafe': 'RIjbPmh4EmsVDJW-T4uKQA',
'serviceType': 0,
'sta': '13:17',
'std': '13:18'},
{'adhocAlerts': None,
'cancelReason': None,
'currentDestinations': None,
'currentOrigins': None,
'delayReason': None,
'destination': [{'assocIsCancelled': False,
'crs': 'WAT',
'futureChangeTo': None,
'locationName': 'London Waterloo',
'via': None}],
'detachFront': False,
'eta': 'On time',
'etd': 'On time',
'filterLocationCancelled': False,
'isCancelled': False,
'isCircularRoute': False,
'isReverseFormation': False,
'length': 5,
'operator': 'South Western Railway',
'operatorCode': 'SW',
'origin': [{'assocIsCancelled': False,
'crs': 'POO',
'futureChangeTo': None,
'locationName': 'Poole',
'via': None}],
'platform': None,
'rsid': 'SW924400',
'serviceID': 'qdZPrgIFVu5oiQUaN6PC7g==',
'serviceIdGuid': 'ae4fd6a9-0502-ee56-6889-051a37a3c2ee',
'serviceIdPercentEncoded': 'qdZPrgIFVu5oiQUaN6PC7g%3d%3d',
'serviceIdUrlSafe': 'qdZPrgIFVu5oiQUaN6PC7g',
'serviceType': 0,
'sta': '13:24',
'std': '13:25'},
{'adhocAlerts': None,
'cancelReason': None,
'currentDestinations': None,
'currentOrigins': None,
'delayReason': None,
'destination': [{'assocIsCancelled': False,
'crs': 'WAT',
'futureChangeTo': None,
'locationName': 'London Waterloo',
'via': None}],
'detachFront': False,
'eta': 'On time',
'etd': 'On time',
'filterLocationCancelled': False,
'isCancelled': False,
'isCircularRoute': False,
'isReverseFormation': False,
'length': 5,
'operator': 'South Western Railway',
'operatorCode': 'SW',
'origin': [{'assocIsCancelled': False,
'crs': 'WEY',
'futureChangeTo': None,
'locationName': 'Weymouth',
'via': None}],
'platform': None,
'rsid': 'SW914400',
'serviceID': 'hCk2h7N434JhtggktTue4w==',
'serviceIdGuid': '87362984-78b3-82df-61b6-0824b53b9ee3',
'serviceIdPercentEncoded': 'hCk2h7N434JhtggktTue4w%3d%3d',
'serviceIdUrlSafe': 'hCk2h7N434JhtggktTue4w',
'serviceType': 0,
'sta': '13:47',
'std': '13:48'},
{'adhocAlerts': None,
'cancelReason': None,
'currentDestinations': None,
'currentOrigins': None,
'delayReason': None,
'destination': [{'assocIsCancelled': False,
'crs': 'WAT',
'futureChangeTo': None,
'locationName': 'London Waterloo',
'via': None}],
'detachFront': False,
'eta': 'On time',
'etd': 'On time',
'filterLocationCancelled': False,
'isCancelled': False,
'isCircularRoute': False,
'isReverseFormation': False,
'length': 5,
'operator': 'South Western Railway',
'operatorCode': 'SW',
'origin': [{'assocIsCancelled': False,
'crs': 'PMH',
'futureChangeTo': None,
'locationName': 'Portsmouth Harbour',
'via': None}],
'platform': None,
'rsid': 'SW844600',
'serviceID': 'aGtRqFHjGn0lj3L3JJEacw==',
'serviceIdGuid': 'a8516b68-e351-7d1a-258f-72f724911a73',
'serviceIdPercentEncoded': 'aGtRqFHjGn0lj3L3JJEacw%3d%3d',
'serviceIdUrlSafe': 'aGtRqFHjGn0lj3L3JJEacw',
'serviceType': 0,
'sta': '13:55',
'std': '13:56'},
{'adhocAlerts': None,
'cancelReason': None,
'currentDestinations': None,
'currentOrigins': None,
'delayReason': None,
'destination': [{'assocIsCancelled': False,
'crs': 'WAT',
'futureChangeTo': None,
'locationName': 'London Waterloo',
'via': None}],
'detachFront': False,
'eta': 'On time',
'etd': 'On time',
'filterLocationCancelled': False,
'isCancelled': False,
'isCircularRoute': False,
'isReverseFormation': False,
'length': 5,
'operator': 'South Western Railway',
'operatorCode': 'SW',
'origin': [{'assocIsCancelled': False,
'crs': 'WEY',
'futureChangeTo': None,
'locationName': 'Weymouth',
'via': None}],
'platform': None,
'rsid': 'SW924600',
'serviceID': 'zlNIZ4FNMDMN4/hsPExTww==',
'serviceIdGuid': '674853ce-4d81-3330-0de3-f86c3c4c53c3',
'serviceIdPercentEncoded': 'zlNIZ4FNMDMN4%2fhsPExTww%3d%3d',
'serviceIdUrlSafe': 'zlNIZ4FNMDMN4_hsPExTww',
'serviceType': 0,
'sta': '14:17',
'std': '14:18'},
{'adhocAlerts': None,
'cancelReason': None,
'currentDestinations': None,
'currentOrigins': None,
'delayReason': None,
'destination': [{'assocIsCancelled': False,
'crs': 'WAT',
'futureChangeTo': None,
'locationName': 'London Waterloo',
'via': None}],
'detachFront': False,
'eta': 'On time',
'etd': 'On time',
'filterLocationCancelled': False,
'isCancelled': False,
'isCircularRoute': False,
'isReverseFormation': False,
'length': 4,
'operator': 'South Western Railway',
'operatorCode': 'SW',
'origin': [{'assocIsCancelled': False,
'crs': 'POO',
'futureChangeTo': None,
'locationName': 'Poole',
'via': None}],
'platform': None,
'rsid': 'SW924800',
'serviceID': '6sqq5kFQHhDQrhd5u2vTrA==',
'serviceIdGuid': 'e6aacaea-5041-101e-d0ae-1779bb6bd3ac',
'serviceIdPercentEncoded': '6sqq5kFQHhDQrhd5u2vTrA%3d%3d',
'serviceIdUrlSafe': '6sqq5kFQHhDQrhd5u2vTrA',
'serviceType': 0,
'sta': '14:24',
'std': '14:25'},
{'adhocAlerts': None,
'cancelReason': None,
'currentDestinations': None,
'currentOrigins': None,
'delayReason': None,
'destination': [{'assocIsCancelled': False,
'crs': 'WAT',
'futureChangeTo': None,
'locationName': 'London Waterloo',
'via': None}],
'detachFront': False,
'eta': 'On time',
'etd': 'On time',
'filterLocationCancelled': False,
'isCancelled': False,
'isCircularRoute': False,
'isReverseFormation': False,
'length': 5,
'operator': 'South Western Railway',
'operatorCode': 'SW',
'origin': [{'assocIsCancelled': False,
'crs': 'WEY',
'futureChangeTo': None,
'locationName': 'Weymouth',
'via': None}],
'platform': None,
'rsid': 'SW914800',
'serviceID': 'NOKQed10z4il/HuCHa1wjA==',
'serviceIdGuid': '7990e234-74dd-88cf-a5fc-7b821dad708c',
'serviceIdPercentEncoded': 'NOKQed10z4il%2fHuCHa1wjA%3d%3d',
'serviceIdUrlSafe': 'NOKQed10z4il_HuCHa1wjA',
'serviceType': 0,
'sta': '14:47',
'std': '14:48'},
{'adhocAlerts': None,
'cancelReason': None,
'currentDestinations': None,
'currentOrigins': None,
'delayReason': None,
'destination': [{'assocIsCancelled': False,
'crs': 'WAT',
'futureChangeTo': None,
'locationName': 'London Waterloo',
'via': None}],
'detachFront': False,
'eta': 'On time',
'etd': 'On time',
'filterLocationCancelled': False,
'isCancelled': False,
'isCircularRoute': False,
'isReverseFormation': False,
'length': 4,
'operator': 'South Western Railway',
'operatorCode': 'SW',
'origin': [{'assocIsCancelled': False,
'crs': 'PMH',
'futureChangeTo': None,
'locationName': 'Portsmouth Harbour',
'via': None}],
'platform': None,
'rsid': 'SW845000',
'serviceID': 'xB/sZuLnJbXE2Pt+U/HKWg==',
'serviceIdGuid': '66ec1fc4-e7e2-b525-c4d8-fb7e53f1ca5a',
'serviceIdPercentEncoded': 'xB%2fsZuLnJbXE2Pt%2bU%2fHKWg%3d%3d',
'serviceIdUrlSafe': 'xB_sZuLnJbXE2Pt-U_HKWg',
'serviceType': 0,
'sta': '14:56',
'std': '14:56'}]}

The maximum number of trains to include is required for the delays API.
E.g. https://huxley.apphb.com/delays/win/to/wat/10
Currently returning:

{
  "generatedAt": "2018-11-07T21:29:08.0682404+00:00",
  "locationName": "Winchester",
  "crs": "WIN",
  "filterLocationName": "London Waterloo",
  "filtercrs": "WAT",
  "delays": true,
  "totalTrainsDelayed": 1,
  "totalDelayMinutes": 25,
  "totalTrains": 6,
  "delayedTrains": [
    {
      "previousCallingPoints": [
        {
          "callingPoint": [
            {
              "locationName": "Weymouth",
              "crs": "WEY",
              "st": "19:20",
              "et": null,
              "at": "19:31",
              "isCancelled": false,
              "length": 5,
              "detachFront": false,
              "adhocAlerts": null
            },
            {
              "locationName": "Upwey",
              "crs": "UPW",
              "st": "19:24",
              "et": null,
              "at": "19:35",
              "isCancelled": false,
              "length": 5,
              "detachFront": false,
              "adhocAlerts": null
            },
            {
              "locationName": "Dorchester South",
              "crs": "DCH",
              "st": "19:37",
              "et": null,
              "at": "19:42",
              "isCancelled": false,
              "length": 5,
              "detachFront": false,
              "adhocAlerts": null
            },
            {
              "locationName": "Moreton (Dorset)",
              "crs": "MTN",
              "st": "19:43",
              "et": null,
              "at": "No report",
              "isCancelled": false,
              "length": 5,
              "detachFront": false,
              "adhocAlerts": null
            },
            {
              "locationName": "Wool",
              "crs": "WOO",
              "st": "19:49",
              "et": null,
              "at": "19:56",
              "isCancelled": false,
              "length": 5,
              "detachFront": false,
              "adhocAlerts": null
            },
            {
              "locationName": "Wareham",
              "crs": "WRM",
              "st": "19:57",
              "et": null,
              "at": "20:03",
              "isCancelled": false,
              "length": 5,
              "detachFront": false,
              "adhocAlerts": null
            },
            {
              "locationName": "Hamworthy",
              "crs": "HAM",
              "st": "20:03",
              "et": null,
              "at": "20:09",
              "isCancelled": false,
              "length": 5,
              "detachFront": false,
              "adhocAlerts": null
            },
            {
              "locationName": "Poole",
              "crs": "POO",
              "st": "20:09",
              "et": null,
              "at": "20:13",
              "isCancelled": false,
              "length": 5,
              "detachFront": false,
              "adhocAlerts": null
            },
            {
              "locationName": "Bournemouth",
              "crs": "BMH",
              "st": "20:22",
              "et": null,
              "at": "20:40",
              "isCancelled": false,
              "length": 10,
              "detachFront": false,
              "adhocAlerts": null
            },
            {
              "locationName": "Pokesdown",
              "crs": "POK",
              "st": "20:26",
              "et": null,
              "at": "20:44",
              "isCancelled": false,
              "length": 10,
              "detachFront": false,
              "adhocAlerts": null
            },
            {
              "locationName": "Christchurch",
              "crs": "CHR",
              "st": "20:30",
              "et": null,
              "at": "20:48",
              "isCancelled": false,
              "length": 10,
              "detachFront": false,
              "adhocAlerts": null
            },
            {
              "locationName": "New Milton",
              "crs": "NWM",
              "st": "20:37",
              "et": null,
              "at": "20:57",
              "isCancelled": false,
              "length": 10,
              "detachFront": false,
              "adhocAlerts": null
            },
            {
              "locationName": "Brockenhurst",
              "crs": "BCU",
              "st": "20:45",
              "et": null,
              "at": "21:04",
              "isCancelled": false,
              "length": 10,
              "detachFront": false,
              "adhocAlerts": null
            },
            {
              "locationName": "Southampton Central",
              "crs": "SOU",
              "st": "21:00",
              "et": null,
              "at": "21:21",
              "isCancelled": false,
              "length": 10,
              "detachFront": false,
              "adhocAlerts": null
            },
            {
              "locationName": "Southampton Airport Parkway",
              "crs": "SOA",
              "st": "21:08",
              "et": "21:29",
              "at": null,
              "isCancelled": false,
              "length": 10,
              "detachFront": false,
              "adhocAlerts": null
            }
          ],
          "serviceType": 0,
          "serviceChangeRequired": false,
          "assocIsCancelled": false
        }
      ],
      "subsequentCallingPoints": [
        {
          "callingPoint": [
            {
              "locationName": "Basingstoke",
              "crs": "BSK",
              "st": "21:34",
              "et": "21:54",
              "at": null,
              "isCancelled": false,
              "length": 10,
              "detachFront": false,
              "adhocAlerts": null
            },
            {
              "locationName": "Clapham Junction",
              "crs": "CLJ",
              "st": "22:13",
              "et": "22:29",
              "at": null,
              "isCancelled": false,
              "length": 10,
              "detachFront": false,
              "adhocAlerts": null
            },
            {
              "locationName": "London Waterloo",
              "crs": "WAT",
              "st": "22:22",
              "et": "22:38",
              "at": null,
              "isCancelled": false,
              "length": 10,
              "detachFront": false,
              "adhocAlerts": null
            }
          ],
          "serviceType": 0,
          "serviceChangeRequired": false,
          "assocIsCancelled": false
        }
      ],
      "origin": [
        {
          "locationName": "Weymouth",
          "crs": "WEY",
          "via": null,
          "futureChangeTo": null,
          "assocIsCancelled": false
        }
      ],
      "destination": [
        {
          "locationName": "London Waterloo",
          "crs": "WAT",
          "via": null,
          "futureChangeTo": null,
          "assocIsCancelled": false
        }
      ],
      "currentOrigins": null,
      "currentDestinations": null,
      "rsid": "SW927400",
      "sta": "21:17",
      "eta": "21:37",
      "std": "21:18",
      "etd": "21:38",
      "platform": null,
      "operator": "South Western Railway",
      "operatorCode": "SW",
      "isCircularRoute": false,
      "isCancelled": false,
      "filterLocationCancelled": false,
      "serviceType": 0,
      "length": 10,
      "detachFront": false,
      "isReverseFormation": false,
      "cancelReason": null,
      "delayReason": "This train has been delayed by congestion",
      "serviceID": "xhuGeem7OrUCan1bzwK2Jg==",
      "serviceIdPercentEncoded": "xhuGeem7OrUCan1bzwK2Jg%3d%3d",
      "serviceIdGuid": "79861bc6-bbe9-b53a-026a-7d5bcf02b626",
      "serviceIdUrlSafe": "xhuGeem7OrUCan1bzwK2Jg",
      "adhocAlerts": null
    }
  ]
}