[API] Allow arrivalReal and departureReal parameter in manual trip creation #2499
Closed
tiuub
started this conversation in
Ideas / Feature Requests
Replies: 1 comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I'm currently trying to import some old trips from zugfinder.net to traewelling.
Therefore I am using the API to import the trips with a small Python Script.
Because zugfinder.net also provides historical data, I want to set the delay for the trips via the API during the trip creation.
API-Endpoint:
POST https://traewelling.de/api/v1/trains/trip
Example data:
{"originId":5903,"originDeparturePlanned":"2022-12-31T17:12:00.000+01:00","destinationId":5550,"destinationArrivalPlanned":"2022-12-31T18:07:00.000+01:00","lineName":"EC 44","journeyNumber":null,"operatorId":null,"category":"national","stopovers":[{"stationId":5383,"departure":"2022-12-31T17:59:00.000+01:00","arrival":"2022-12-31T17:55:00.000+01:00"}]}
Response:
In the response of the request
arrivalReal
anddepartureReal
are bothnull
for each stopover.What I want to achieve:
The train had a delay of 10 minutes for example. So it left the origin 10 minutes past the planned time and also arrives and leaves at each stopover with a delay of 10 minutes.
So I basically want to set the
arrivalReal
ordepartureReal
parameter for each stopover andoriginDepartureReal
ordestinationArrivalReal
for the departure at the origin and the arrival at the destination, if the train was delayed.API-Endpoint:
POST https://traewelling.de/api/v1/trains/trip
Example data (with arrivalReal, departureReal and so on):
{"originId":5903,"originDeparturePlanned":"2022-12-31T17:12:00.000+01:00","originDepartureReal":"2022-12-31T17:13:00.000+01:00","destinationId":5550,"destinationArrivalPlanned":"2022-12-31T18:07:00.000+01:00","destinationArrivalReal":"2022-12-31T18:59:00.000+01:00","lineName":"EC 44","journeyNumber":null,"operatorId":null,"category":"national","stopovers":[{"stationId":5383,"departure":"2022-12-31T17:59:00.000+01:00","departureReal":"2022-12-31T18:11:00.000+01:00","arrival":"2022-12-31T17:55:00.000+01:00", "arrivalReal":"2022-12-31T18:01:00.000+01:00"}]}
Response (with arrivalReal, departureReal set in request):
If
arrivalReal
anddepartureReal
(ororiginDepartureReal
anddestinationArrivalReal
) are set in the request,arrivalReal
anddepartureReal
should now contain the real arrival and departure time for each stopover in the response.Kind regards
tiuub
Beta Was this translation helpful? Give feedback.
All reactions