Till senaste kommentaren
Detta inlägg är gammalt och kan innehålla inaktuell information.

Questions regarding the Resrobot v2.1 Route planner

Hi, I have a few questions regarding the API

The parameters originId and destId are both marked as required, but if originCoordLat, originCoordLong, destCoordLat and destCoordLong are provided the documentation says that originId/destId should NOT be provided, this seems contradictory.

In the documentation of originWalk/destWalk it is not clear if all four parameters must be given or if they can be given as "enable"[,"min"[,"max"[,"speed"]]] (where [] means optional as in "enable" may be followed by "min", "min" may be followed by "max" and so on). In the example given the speed parameter is omitted.

The speed part of the parameters originWalk and destWalk is described as "The relative walking speed (in %)", what does that mean?

The parameter "products" is not required, what products are returned if "products" is omitted?

In v2 a Leg attribute "dist" was returned for walk paths but it is not available in the documentation. Will this attribute exist in v2.1 but just hasn't been documented or should it not exist?

What are legal values for Trip.LegList.Leg.(Origin|Destination).Type?



  • Hej Alexander!

    I have updated the OpenApi documentation to include the information you requested. The website documentation itself has not been updated yet, but will follow later.

    - In short: originId, destId are conditionaly required, either originId or originCoordLat+originCoordLong should be specified. We removed the required attribute to prevent confusion.
    - Yes, you can omit default values at the end. This has now been described more clear.
    - The default speed is around 4 to 4,5km/h. 200% means double, 50% means about 2km/h.
    - If products is not specified, all products are included
    - dist and duration are still included, but were for some reason not present in the documentation. This has been fixed.
    - Legal values for Origin.Type and Destination.Type are ST (stop/station), ADR (address), POI (point of interest), CRD (coordinate), MCP (mode change point) or HL (hailing point).

    Please let us know if there is anything else that we could improve in the documentation. Would you have benefit of an XSD file for the XML representation?

    Bert på Trafiklab
  • Thank you, I myself would not benefit from a XSD file at the moment but I imagine others might. In any case having the schemas allows you to validate that the results actually match the documentation (assuming the documentation is generated from the schemas). Both XSD and JSON schema would be great.

    I found two more errors in the documentation for the v2.1. tripplanner.

    1. The response value Trip.LegList.Leg.Product is returned as an array of Product objects not a Product object as suggested by the schema.
    2. Trip.LegList.Leg.Product.idx is returned as an integer and not a string.

    At least that's what this query shows
    curl 'https://api.resrobot.se/v2.1/trip?accessId=<key>&date=2022-02-15&destCoordLat=59.23835372924805&destCoordLong=18.105449676513672&destId=740065585&format=json&lang=en&originCoordLat=59.30681610107422&originCoordLong=18.121328353881836&originId=740024807&passlist=1'

  • Hi Alexander,

    Thanks for reporting these issues. We have now fixed them in the OpenApi specification.

    Bert på Trafiklab

Kommentera eller skriv ett nytt inlägg

Ditt namn och inlägg kan ses av alla. Din e-post visas aldrig publikt.