Closed davidallen353 closed 4 months ago
I will have a look but not sure if I should cry ot laugh as to yet-another-new approach where even the static data requires a key. Of those tested I only had 1 case where the realtime data required a key and this I understand as it is to protect mis/over-use...but for static???? why ??? Anywho ...will get back
I discovered I am using different methods to get realtime data which apparently donot always work the same esp. when api_key apply The workaround I have is that you use the gtfs rt service call to get the data locally, this with your url incl. api_key and then from the sensor you refer to that local file, see doc. I cannot verify if the rt data contains any valid stuff for bussses/trains...too much work but at least the file is read without any issues now
I did manage to pull the static data by adding ?api_data='MY_API_KEY'
to the end of the URL. But when I tried doing the same for the real time data, it appears to be trying to add "na" as an API key.
Perhaps a checkbox to enable/disable authentication in the realtime setup (so you can add the API key to the URL) could be a decent work around.
I will try setting up a service this evening to see if that works.
It wokrs for me but only via the service call, not (!) via the sensor setup...from the sensor I refer to the local created file by the service call
Whilst the workaround is fine (at my end) I will try to allow different locations for the key from theregular configuration. It now just assumes it to be part of a header but I will add url/querystrin for this one
EDIT: prototype is working
Got here searching trying to make it work. NYC MTA requires api-key as well. https://api.mta.info/#/HelpDocument looking forward to the addition as in the screenshot above to make it work.
Got here searching trying to make it work. NYC MTA requires api-key as well. https://api.mta.info/#/HelpDocument looking forward to the addition as in the screenshot above to make it work.
You need static data first to make real-time work, which source are you using for static? And... the x-api-key should already work in the current setup
EDIT: correction... X_API_KEY does not work, will review too
Both fixed in 0.3.8
EDIT:
BLUF: gtfs_rt_helper is not sending API key correctly
Does not download data for either Metro bus and Metro rail GTFS RT services.
For the setup, I use the following URLs: Rail https://api.wmata.com/gtfs/rail-gtfsrt-tripupdates.pb https://api.wmata.com/gtfs/rail-gtfsrt-vehiclepositions.pb https://api.wmata.com/gtfs/rail-gtfsrt-alerts.pb
Bus https://api.wmata.com/gtfs/bus-gtfsrt-tripupdates.pb https://api.wmata.com/gtfs/bus-gtfsrt-vehiclepositions.pb https://api.wmata.com/gtfs/bus-gtfsrt-alerts.pb
I also include my API key for both. I have attempted to include is as either an API key or an X_API key.
It fails to update an the log includes the following message:
As a debugging step, I attempted to include the API key in the URL (and not in the API key field in the GUI). That is, I set the URL as
https://api.wmata.com/gtfs/rail-gtfsrt-tripupdates.pb?api_key=MY_API_KEY
which yielded a similar but different error:So it appears that it attempted to pass "na" as the API key while the API expects a hex string.
I confirmed that going to the URL
https://api.wmata.com/gtfs/rail-gtfsrt-tripupdates.pb?api_key=MY_API_KEY
returns the expected file.Release used gtfs2 v0.3.6 and HAOS