public-transport / hafas-client

JavaScript client for HAFAS public transport APIs.
ISC License
277 stars 53 forks source link

Fix Invalid Client Version Error with BVG API #323

Closed timvonwerne closed 2 months ago

timvonwerne commented 3 months ago

Issue: When running the example or making any request, the BVG API returns an error related to an invalid client version:

{
  isHafasError: true,
  code: null,
  isCausedByServer: false,
  hafasCode: 'CLIENTVERSION',
  url: 'https://bvg-apps-ext.hafas.de/bin/mgate.exe?',
  hafasMessage: 'HCI Core: Invalid client version'
}

Resolution: This issue occurs because the AID (presumably App ID?) value in the base.json file is outdated. I have updated the AID to the value currently used in the BVG FahrInfo app on iOS. This change resolves the client version error, allowing requests to be processed correctly.

Testing: I have tested the updated AID with multiple requests, and they now work as expected without returning the error.

behring5 commented 2 months ago

Wow. Nice Catch.

And yes I was totally wrong and mixed the APIs

derhuerst commented 2 months ago

@timvonwerne Do you want to be mentioned in contributors in package.json? If you do, how? As Tim von Werne <tim@vonwernet.de>?

derhuerst commented 2 months ago

Published as hafas-client@6.3.2. 🎉