Closed victorlobe closed 1 year ago
You can initialize the DB provider as follows:
let provider = DbProvider(
apiAuthorization: [
"type": "AID",
"aid": ""
],
requestVerification: AbstractHafasClientInterfaceProvider.RequestVerification.checksum(salt: "")
)
You can find the required struct format for the respective provider here: https://github.com/alexander-albers/tripkit/blob/main/Sources/TripKit/Resources/secrets.json.template For running the tests, you need to copy secrets.json.template to secrets.json and fill out the necessary keys.
Thank you very much for your quick response. I got a „client Id“ and a „client secret (api key)“, I pasted the secret key to the aid line but I don’t work. which keys do I have to add at which line?
I'm not sure if we are talking about the same API. What endpoint are you trying to reach?
Edit: maybe to add, the client id is currently hardcoded in DbProider.swift. You could try to override it after initializing and setting RequestVerification to .none, but I don't know if that will work for you.
I am trying to reach the DB API, I got the following data:
![Uploading 4DE7502B-4BB5-4D2C-892C-9922F729BF99.jpeg…]()
Unfortunately, this API is not supported by TripKit. You need to obtain a different key similar to the one the official DB Navigator app uses.
You can have a look at this project: https://github.com/public-transport/transport-apis
Ah ok, now I understand. Thank you very much! And keep up the good work :)
Its not possible to add Api keys for DB anywhere.