Using the REST API for trip planing

79 views
Skip to first unread message

Alexander Czech

unread,
Oct 6, 2022, 9:37:44 AM10/6/22
to OpenTripPlanner Developers
Hey, I'm using the docker image of OTP (so dev-2.x), but I can't really find a documentation on the REST API (https://dev.opentripplanner.org/apidoc/ seems to be down).

What I want to do is set point a (x,y) and point b (x,y) and a time and get routing information back. Is this possible? And is there a documentation out there that I'm just missing?

I had a look at http://localhost:8080/otp/application.wadl, but it can only get static info like stops, and trips but nothing where I can submit a routing query

THX
Alex

Leonard Ehrenfried

unread,
Oct 6, 2022, 10:01:16 AM10/6/22
to Opentripplanner Developers
Hi Alexander,

your best bet is to use the regular debug browser client, click on the map to select start/end and look at your browser's web inspector to see the URL generated. This will give you an idea of the params required.


All the best.
--
  Leonard Ehrenfried

--
You received this message because you are subscribed to the Google Groups "OpenTripPlanner Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opentripplanner...@googlegroups.com.

Thomas Gran

unread,
Oct 27, 2022, 1:05:16 PM10/27/22
to OpenTripPlanner Developers
I think this might help: https://github.com/opentripplanner/OpenTripPlanner/blob/7896aa79f5027117604949aabadc3025b4ab4f7e/src/main/java/org/opentripplanner/api/common/RoutingResource.java

For example @QueryParam("pageCursor") means there is a HTTP query parameter called "pageCursor".

Andrew Byrd

unread,
Oct 28, 2022, 1:23:50 AM10/28/22
to opentripplanner-dev

On Thu, 6 Oct 2022, at 10:31, 'Alexander Czech' via OpenTripPlanner Developers wrote:
Hey, I'm using the docker image of OTP (so dev-2.x), but I can't really find a documentation on the REST API (https://dev.opentripplanner.org/apidoc/ seems to be down).

I just looked into this - I think the documentation was not truly unavailable, it's just not available over HTTPS. http://dev.opentripplanner.org is an AWS S3 bucket served over the web. S3 doesn't allow HTTPS out of the box, only plain HTTP. 

I just tried adding HTTPS support via a CloudFront distribution, and this almost works. But unfortunately S3 also doesn't supply HTML directory listings (which we need to allow you to navigate to the directory of documentation you want), so we have always generated those with a script that fetches an XML directory listing from S3 and converts it to HTML. Those XML listings are only available over plain HTTP, making for "mixed content" which is disallowed by current browsers.

Basically, S3 doesn't support HTTPS and directory listings, so I think we'd need to host this documentation somewhere else to get around it.

For the time being we can just always use HTTP URLs instead of HTTPS for this documentation. I am curious, where did you get the URL starting with HTTPS? If we correct that link to one starting with HTTP that should sidestep the problem for the time being.

-Andrew
Reply all
Reply to author
Forward
0 new messages