The API uses the GraphQL query language. As an emerging standard this allows a consumer to not only selectively query the lift and escalator status’ but also subscribe to changes in data. An introduction to which can be found here:
Endpoint
Note: If making a http request directly a query can be made by sending a POST request to this endpoint. |
The following example we will be using a simple filtering technique, you can find more complex filtering examples here:
https://hasura.io/docs/1.0/graphql/manual/queries/query-filters.html
Query
|
Response
{ |
The status field can have the following three string values:
Unknown – We do not know whether the lift/escalator is running as the Site is Out of Commission/EMU has communication issues
Available - Lift/Escalator is OK to be used
Not Available – Lift/Escalator cannot be used i.e. broken down
If the Lift is “Not Available” the following fields may be true, indicating different states:
Isolated – Lift is switched off but can be put back into service if required
Engineer On Site – Engineer working on the Lift/Escalator
Independent – Lift is on independent service i.e. key switch
CRS codes are a unique three letter code for each station. It is a popular key used for stations in systems using UK rail data. We can also get the assets status’ at a particular station using a more complex query that filters on this code:
Query
query MultiTableQuery { |
Response
{ |
Currently the api is running a maximum of 15 requests per minute per ip connection, we expect to increase this in future as we make our starter and unlimited packages available. The expected behaviour when this limit is reached is documented below.
Expected Exceeded Limit Response (Http 200)
{ |
{ |
{ "title": "The Portfolio Table Schema", "description": "Nested object containing status table attributes for asset" "description": "Address of station containing asset" "description": "CRS code identifier of station containing asset", "examples": [ "description": "The postcode of the station that the asset is in" "description": "The unique identifier for the asset in the system as a whole.", "examples": [ } |