Transport icon indicating copy to clipboard operation
Transport copied to clipboard

/journeys resource

Open fabian opened this issue 12 years ago • 2 comments

I'd like to add a resource for getting journey details and propose the following URI design for it:

/v1/journeys/tnr/{tnr}/cycle/{cycle}/puic/{puic}

It's not that nice as it includes external IDs, but this is the only way to get to the data, and connection and stationboard responses include this IDs in JHandle:

<JHandle tNr="202971" puic="085" cycle="03"/>

fabian avatar Sep 17 '13 08:09 fabian

Why not use parameters? /v1/journeys?tnr={tnr}&cycle={cycle}&puic={puic} Having URL fragments implies a hierarchy of resources, which this doesn't seem to be. Or rather, I don't understand the parameters to say if it is or not. On that note, maybe more obvious parameters make sense...

colinfrei avatar Sep 17 '13 09:09 colinfrei

You're right, there's no hierarchy between the parameters - at least none that I'm aware of. That's the main problem: We have no idea about the meaning of the parameters and I can't see how we could replace them… apart from making additional requests first? But then again it's not really guaranteed to return the specific journey.

/v1/journeys?from=Bern&to=Zürich&datetime=2013-09-17T12:02:00

fabian avatar Sep 17 '13 10:09 fabian