Stations Experience API

From Open Rail Data Wiki
Revision as of 20:52, 22 January 2024 by PeterHicks (talk | contribs) (Add Stations Experience API page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Network Rail's Stations Experience API provides endpoint to retrieve details of lift and escalator status over an HTTP endpoint.

Access

To request access to the API, email APIIntegrationServicesC4E@networkrail.co.uk and request access to 's-nr-sfdc-liftsandescalator' and 'e-nr-stations'.

You will receive an email some time later containing a client ID and secret. These are effectively your user identity and password for access to the API. There is no automated mechanism for signup at the time of writing.

Restrictions

There are some restrictions placed on what can be done with the URL. Specifically, the data is licensed under the Open Government Licence v3.0, with a mandatory protocol on how the information should be displayed.

For further details, please contact Network Rail.

Base URL

All HTTP requests to this endpoint start with https://data.networkrail.co.uk/api/stations/v1.0/. Making a GET request to this URL without a valid client ID and secret will result in an HTTP 401 response with the following body:

{
  "error": "Authentication denied."
}

Authorization

Three headers must be passed with every HTTP request:

Header Description Example
client_id Client ID 256c727ed31cd44d6fbe0cd67bafae4e
client_secret Client secret 7hT1SPeN1VHMBfGxYjQ9DsEO29DTX3ae
x-correlation-id Correlation ID (any text) 1705956083

The correlation ID is just an identifier which is returned in the response.

Responses

All responses are in JSON and have a 'header' and 'data' key.

The following key/value pairs are supplied underneath the 'header' key:

Key Value Description
apiName e-nr-stations Name of the responding API
apiVersion v1.0 Current API version
correlationId 1705956083 The correlationId passed in the HTTP request

The 'data' key contains the JSON response from the API.

Endpoints

The following endpoints exist:

/ping

This endpoint will identify whether the API is up.

/all/lifts-and-escalators

This endpoint will return details of the availability of all lifts and escalators included in the API.

/crs-codes/{crs-code}/lifts-and-escalators

This endpoint will return details of the availability of all lifts and escalators at the given station, identified by CRS code.