Skip to content
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

API key error for WMATA #30

Closed
MrMastodonFarm opened this issue Jan 28, 2024 · 0 comments · Fixed by #31
Closed

API key error for WMATA #30

MrMastodonFarm opened this issue Jan 28, 2024 · 0 comments · Fixed by #31

Comments

@MrMastodonFarm
Copy link

MrMastodonFarm commented Jan 28, 2024

When configured per the documentation, WMATA rejects the attempt to connect to the trip updates URL (https://api.wmata.com/gtfs/rail-gtfsrt-tripupdates.pb) because it says no API key was supplied, even when api_key has a value set in the configuration file. I fixed the issue by changing:

self._headers = {"Authorization": api_key}

to

self._headers = {"api_key": api_key}

in /config/custom_components/gtfs_rt/sensor.py .

It seems WMATA wants the API key presented as "api_key: " instead of "Authorization: ".

elffaW pushed a commit to elffaW/ha-gtfs-rt-v2 that referenced this issue Feb 24, 2024
elffaW added a commit to elffaW/ha-gtfs-rt-v2 that referenced this issue Feb 24, 2024
mark1foley added a commit that referenced this issue May 7, 2024
fix #30: add api_key_header option to config
elffaW referenced this issue May 7, 2024
Changed default for CONF_API_KEY_HEADER_NAME to "Authorization"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant