Ero sivun ”Journeys API” versioiden välillä

531 merkkiä lisätty ,  4. heinäkuuta 2014 kello 21.17
Rivi 153: Rivi 153:


==== Routes ====
==== Routes ====
A client can access paged list of ROUTES by making HTTP GET request to url http://example.com/journeys/api/routes
This request would produce following response:
<pre>
{
    "headers" : {
        "dataValidityPeriod" : {
            "validFrom" : "2013-01-01",
            "validTo" : "2013-05-31"
        },
        "startIndex" : 0,
        "pageSize" : 10,
        "moreData" : false
    },
    "data" : {
        "routes" : [
            {
                "href" : "http://example.com/journeys/api/routes/123",
                "pattern" : {
                    "href" : "http://example.com/journeys/api/route-patterns/111"
                },
                "journeys" : [
                    {
                        "href" : "http://example.com/journeys/api/journeys/111",
                    }
                ]
            }
            ...
        ]
    }
}
</pre>
A client can access specific ROUTE'S details by issuing request at http://example.com/journeys/api/routes/123
A client can access specific ROUTE'S details by issuing request at http://example.com/journeys/api/routes/123


Rivi 202: Rivi 170:
         "routes" : [
         "routes" : [
             {
             {
                "id" : "123",
                 "href" : "http://example.com/journeys/api/routes/123",
                 "href" : "http://example.com/journeys/api/routes/123",
                 "pattern" : {
                 "pattern" : {
Rivi 212: Rivi 181:
                         "dayTypes" : [
                         "dayTypes" : [
                             {
                             {
                                 "href" : "http://example.com/journeys/api/day-types/weekdays"
                                 "href" : "http://example.com/journeys/api/day-types/123"
                             }
                             }
                         ],
                         ],
Rivi 238: Rivi 207:
}
}
</pre>
</pre>
A client can search JOURNEYS by issuing following requests:<br>
* http://example.com/journeys/api/journeys will return paged list of all JOURNEYS
* http://example.com/journeys/api/journeys?lineId=123 will return JOURNEYS which run on the LINE with id 123
* http://example.com/journeys/api/journeys?lineName=13 will return JOURNEYS which run on the LINE with name containing text "13" (case insentitive)
* http://example.com/journeys/api/journeys?departureDate=2013-06-10 will return JOURNEYS which depart at the given date
* http://example.com/journeys/api/journeys?departureTime=08:00:00+0300 will return JOURNEYS which depart at the given time
* http://example.com/journeys/api/journeys?dayTypeId=123 will return JOURNEYS which run on the DAY TYPE with id 123
* http://example.com/journeys/api/journeys?dayTypeExceptionId=111 will return JOURNEYS which have a DAY TYPE EXCEPTION with id 111
* http://example.com/journeys/api/journeys?stopPointId=111 will return JOURNEYS which contains a CALL which contains STOP POINT with id 111
* http://example.com/journeys/api/journeys?lastCallStopArrivalTime=08:20:00+0300 will return JOURNEYS which last CALL arrives at STOP POINT at 08:20:00+0300
These queries return response like above, with entities matching the criteria. All query parameters are exclusive (if you specify multiple conditions, the conditions are ANDed together).
==== Route Patterns ====
==== Route Patterns ====
List of route patterns is not available, clients are expected to navigate to a certain route pattern via lines or routes.
List of route patterns is not available, clients are expected to navigate to a certain route pattern via lines or routes.
0

muokkausta