Public Transit API Developer's Guide

Update a Section In a Transit Route

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.api.here.com/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://ip-10-124-93-102.eu-west-1.compute.internal:8080/hafasproxy/G1C",
    "Connections": {
      "context": "9be58603-0d79-498f-b2fe-bada805fce55",
      "Connection": [
        {
          "id": "R0001cb-C0",
          "duration": "PT12M",
          "transfers": 0,
          "Dep": {
            "time": "2017-04-11T22:02:00",
            "Stn": {
              "id": "418800333#104",
              "name": "Madison + Clinton",
              "x": -87.641041,
              "y": 41.881948
            }
          },
          "Arr": {
            "time": "2017-04-11T22:14:00",
            "Stn": {
              "id": "418800347#104",
              "name": "Madison + Western",
              "x": -87.686194,
              "y": 41.881238
            }
          },
          "Sections": {
            "Sec": [
              {
                "mode": 5,
                "id": "R0001cb-C0-S0",
                "context": "T1P-VCRBPTFATz1NYWRpc29uICsgQ2xpbnRvbkBMPTQxODgwMDMzM0BhPTEyOEAkQT0xQE89TWFkaXNvbiArIFdlc3Rlcm5ATD00MTg4MDAzNDdAYT0xMjhAJDIwMTcwNDExMjIwMiQyMDE3MDQxMTIyMTQkQnVzICAgMjAk",
                "Dep": {
                  "time": "2017-04-11T22:02:00",
                  "Stn": {
                    "id": "418800333#104",
                    "name": "Madison + Clinton",
                    "x": -87.641041,
                    "y": 41.881948
                  },
                  "Transport": {
                    "mode": 5,
                    "dir": "Austin",
                    "name": "20",
                    "At": {
                      "operator": "1gA48700",
                      "category": "Bus"
                    }
                  },
                  "Freq": {
                    "min": 14,
                    "max": 15
                  }
                },
                "Journey": {
                  "duration": "PT12M",
                  "intermediate": 0
                },
                "Arr": {
                  "time": "2017-04-11T22:14:00",
                  "Stn": {
                    "id": "418800347#104",
                    "name": "Madison + Western",
                    "x": -87.686194,
                    "y": 41.881238
                  }
                },
                "graph": "41.881858,-87.641158 41.88184,-87.64283 41.881786,-87.64736 41.881732,-87.649679 41.881687,-87.651828 41.881651,-87.653194 41.881651,-87.654354 41.881597,-87.657329 41.881552,-87.658767 41.881552,-87.659657 41.881525,-87.662273 41.881507,-87.664386 41.881453,-87.666795 41.881408,-87.669114 41.881408,-87.670103 41.881381,-87.670328 41.881372,-87.671919 41.881336,-87.674238 41.8813,-87.676449 41.881264,-87.679092 41.881229,-87.68187 41.881202,-87.684243 41.881157,-87.686194"
              }
            ]
          }
        }
      ],
      "Operators": {
        "Op": [
          {
            "code": "1gA48700",
            "name": "Chicago Transit Authority",
            "type": "TT",
            "Link": [
              {
                "type": "website",
                "href": "https://transit.api.here.com/r?app_id={YOUR_APP_ID}&u=http://transitchicago.com",
                "text": "Chicago Transit Authority"
              }
            ],
            "At": {
              "phone": "1-888-YOURCTA"
            }
          }
        ]
      }
    }
  }
}