Public Transit API Developer's Guide

Route Section Update

User Story

The user wants to retrieve an update on a route section identified by its context, ctx.

Note: This service is subject to Terms and Conditions as described in Supplier Terms for Developers Using HERE Location Platform APIs.

Request

The query parameter ctx represents the context of a section from the initial route which can be obtained from the Connections/Connection/Sections/Sec element of the response for the initial transit route request, but with the the optional section context parameter enabled, secCtx=1. For reference, use the request in Transit Route with the secCtx parameter.

Note: The query parameter ctx expires after a few minutes. You need to request a new Transit Route to obtain fresh values.
https://transit.hereapi.cn/v3/sectionupdate.json
?app_id={YOUR_APP_ID}
&app_code={YOUR_APP_CODE}
&ctx={Context from one of 'Connections/Connection/Sections/Sec' elements in previous transit route response}
&graph=1

Response

The response to the request contains the following information blocks:
  • a single transit connection containing a single segment
  • the connection includes the following information:
    • departure time
    • real-time information about delays or disruptions
  • an operator who runs the service, including operator code, operator name and links to operator websites, if any.
{
  "Res": {
    "serviceUrl": "http://internal-ptkernel-prd-v010-1479417778.cn-northwest-1.elb.amazonaws.com.cn/goroute/HONG_KONG_SHIFTED_DEMO_V104_20181030",
    "Connections": {
      "context": "",
      "allow_direction": "N",
      "Connection": [{
        "id": "R006f44-C0",
        "duration": "PT0H5M0S",
        "transfers": 0,
        "Dep": {
          "time": "2019-06-24T07:40:00",
          "Stn": {
            "y": 22.300552,
            "x": 114.186154,
            "name": "Hung Hom Station",
            "id": "411411778"
          }
        },
        "Arr": {
          "time": "2019-06-24T07:45:00",
          "Stn": {
            "y": 22.325563,
            "x": 114.158733,
            "name": "Nam Cheong Station",
            "id": "411411345"
          }
        },
        "Sections": {
          "Sec": [{
            "mode": 7,
            "id": "R006f44-C0-S0",
            "context": "UBAT_XBAT_FUVSGRQ_QRZB_I104_20181030-wSskvh1PV-PvkHm_olhX41B-EF0S_QcBV2VzdCBSYWlsIExpbmU",
            "Dep": {
              "time": "2019-06-24T07:40:00",
              "Stn": {
                "y": 22.300552,
                "x": 114.186154,
                "name": "Hung Hom Station",
                "id": "411411778"
              },
              "Transport": {
                "mode": 7,
                "dir": "\u5f00\u5f80 \u5c6f\u9580\u7ad9 \u65b9\u5411",
                "name": "West Rail Line",
                "At": {
                  "category": "Train",
                  "color": "#992E87",
                  "textColor": "#FFFFFF",
                  "operator": "acn07000"
                }
              },
              "Freq": {
                "min": 0,
                "max": 2,
                "AltDep": [{
                  "time": "2019-06-24T07:42:00",
                  "Transport": {
                    "mode": 7,
                    "dir": "\u5f00\u5f80 \u5c6f\u9580\u7ad9 \u65b9\u5411",
                    "name": "West Rail Line",
                    "At": {
                      "category": "Train",
                      "color": "#992E87",
                      "textColor": "#FFFFFF",
                      "operator": "acn07000"
                    }
                  }
                }, {
                  "time": "2019-06-24T07:42:00",
                  "Transport": {
                    "mode": 7,
                    "dir": "\u5f00\u5f80 \u5c6f\u9580\u7ad9 \u65b9\u5411",
                    "name": "West Rail Line",
                    "At": {
                      "category": "Train",
                      "color": "#992E87",
                      "textColor": "#FFFFFF",
                      "operator": "acn07000"
                    }
                  }
                }, {
                  "time": "2019-06-24T07:44:00",
                  "Transport": {
                    "mode": 7,
                    "dir": "\u5f00\u5f80 \u5c6f\u9580\u7ad9 \u65b9\u5411",
                    "name": "West Rail Line",
                    "At": {
                      "category": "Train",
                      "color": "#992E87",
                      "textColor": "#FFFFFF",
                      "operator": "acn07000"
                    }
                  }
                }]
              }
            },
            "Journey": {
              "duration": "PT05M"
            },
            "Arr": {
              "time": "2019-06-24T07:45:00",
              "Stn": {
                "y": 22.325563,
                "x": 114.158733,
                "name": "Nam Cheong Station",
                "id": "411411345"
              }
            },
            "graph": "22.300552,114.186154 22.299494,114.185945 22.295753,114.184511 22.294906,114.183716 22.292344,114.180086 22.292104,114.179396 22.292085,114.178770 22.292589,114.177534 22.293483,114.176426 22.303227,114.171464 22.308696,114.167781 22.310682,114.166444 22.314357,114.165177 22.315346,114.164144 22.315758,114.163899 22.321638,114.160411 22.323921,114.160177 22.325563,114.158733"
          }]
        }
      }],
      "Operators": {
        "Op": [{
          "code": "acn07000",
          "type": "TT",
          "name": "\u9999\u6e2f\u9435\u8def\u6709\u9650\u516c\u53f8",
          "short_name": "070"
        }]
      }
    }
  }
}