-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
document on-board passenger information APIs #31
Comments
👍 Sounds good to me. Of course, in-vehicle APIs are somewhat different as they're not accessible from the outside and may depend on the local network setup, but I think we can handle that. Judging from the discussion at derhuerst/live-icomera-position#3, there are API instances where the endpoint depends on the network setup (e.g. it's located on the default gateway). Do we need support for some kind of relative endpoint definition, as in Also, we should clearly document that these APIs are not accessible from the outside to minimize confusion. |
From what I've seen, the onboard apis are mostly available under a few different domains as well as the standard gateway. However, in the Czech Railways trains for example the standard gateway simply redirects to cdwifi.cz. I can imagine similar behavior on other onboard systems. I think locally overwritten DNS entries are available most of the time and we don't need to mess around with gateway ips too much. |
I'd prefer to document the individual API calls/endpoints as relatice URLs (e.g.
|
Good point. We could use something like this (perhaps with more appropriate key names, I just can't think of any right now). {
"endpoint": "/api1/train-position",
"entrypoints": [{"host": "iceportal.de", "https": true}, {"host": "192.168.0.1", "https": false}, {"gateway": true, "https": false}]
} → The train-position API is typically available on iceportal.de, 192.168.0.1, or the default gateway (whichever IP it may be). For this example, I'm assuming that there may be API instances which do not have (proper) TLS certificates and should be accessed via HTTP instead. We might also use |
Looks good to me! I'd argue that, until we really understand what kinds of systems are there and what API calls they support, we might have to specify their API endpoints/calls individually, hence have and array of of endpoints.
I concluded the same from your example, so 👍 for readability.
I prefer that, it doesn't lack expressiveness but is easier to process. |
Should we also record the respective Wifi names? That makes it easier to determine which APIs to try for a multi-protocol client. |
Seems like not much additional effort and would add value at the same time. Definitely a thing we should do. |
It's been a while, but I created a small command line tool that looks for onboard apis in the network you're connected to. At the moment it just uses @derhuerst's libraries. Of course, many more can be easily implemented. Feel free to have a look @adwirawien/onboard-api-discovery. If you have special knowledge to share about reverse engineering apis, it'd be really awesome if you could contribute them to the repo in written form. I will personally dive into this topic over the next few months too and create a starting point for people who want to have a deeper look in the apis of their public transport vehicles. |
I have now added a basic guide for reverse engineering to the repo among with some dumps I gathered from a České dráhy train. Information in the repos readme was also updated. What do you think @derhuerst, do you have any additional suggestions? |
It just came to my mind that we could use OpenAPI (whenever applicable) to document these APIs; It also splits an API spec into API Endpoints and API Servers. |
In derhuerst/live-icomera-position#3, @Adwirawien proposed to have a central place to collect machine-readable knowledge about on-board (as in: available in the vehicle-local WiFi) APIs:
Let's focus the discussion here on how to add data to
transport-apis
, and keep the general discussion on how to obtain it and potential future projects building on top over at derhuerst/live-icomera-position#3.What do you think @derf?
The text was updated successfully, but these errors were encountered: