dbopendata / db-fahrplan-api

DB Fahrplan API
31 stars 1 forks source link

Improper formatted JourneyDetailRef url #10

Closed marcelbuesing closed 8 years ago

marcelbuesing commented 8 years ago

I think the second ? in the url should actually be a &.

http://open-api.bahn.de/bin/rest.exe/v1.0/journeyDetail?ref=358707/120803/425950/93406/80?date=2016-01-01&station_evaId=8000105&station_type=dep&authKey=zzz&lang=en&format=json&

I think it should actually look like this:

http://open-api.bahn.de/bin/rest.exe/v1.0/journeyDetail?ref=358707/120803/425950/93406/80&date=2016-01-01&station_evaId=8000105&station_type=dep&authKey=zzz&lang=en&format=json&
thekonz commented 8 years ago

Also, the protocol shoul be https, or at least match the protocol of the initial *Board request.

highsource commented 8 years ago

@marcelbuesing No, not quite. You should not interpret the ref param as a part of this URL. The JSON response contains URLs with the ref parameter in encoded form:

http://open-api.bahn.de/bin/rest.exe/v1.0/journeyDetail?ref=210711%2F74511%2F223578%2F41552%2F80%3Fdate%3D2016-02-22%26station_evaId%3D8000105%26station_type%3Darr%26authKey%3Dzzz%26lang%3Dde%26format%3Djson

Which may look weird but is not a malformed URL.

I believe implementation behind the API simple takes the ref parameter and appends it to some base URL. In this case, the encoded ? (which you mean to be the second ?) makes sense. Probably the build it into something like:

http://some.internal/url/358707/120803/425950/93406/80?date=2016-01-01&station_evaId=8000105&station_type=dep&authKey=zzz&lang=en&format=json&
highsource commented 8 years ago

@thekonz Agreed, but that's another issue.

highsource commented 8 years ago

@thekonz See #15.

highsource commented 8 years ago

Closing as invalid.