Ero sivun ”Journeys API” versioiden välillä

992 merkkiä poistettu ,  6. lokakuuta 2014 kello 02.13
Rivi 291: Rivi 291:
<pre>
<pre>
{
{
     "status" : "success",
     "url" : "http://data.itsfactory.fi/journeys/api/1/journeys/2010",
     "data" : {
     "activityUrl" : "http://data.itsfactory.fi/journeys/api/1/vehicle-activity?journeyRef=3_0010_3615_0002",
        "headers" : {
    "routeUrl" : "http://data.itsfactory.fi/journeys/api/1/routes/398",
            "paging" : {
    "lineUrl" : "http://data.itsfactory.fi/journeys/api/1/lines/3",
                "startIndex" : 0,
    "journeyPatternUrl" : "http://data.itsfactory.fi/journeys/api/1/journey-patterns/333",
                "pageSize" : 1,
    "departureTime" : "00:10:00",
                "moreData" : false
    "arrivalTime" : "00:38:00",
            }
    "dayTypes" : [ "monday" ],
        },
    "dayTypeExceptions" : [ {
        "body": [
      "from" : "2015-04-04",
            {
      "to" : "2015-04-04",
                "href" : "http://data.itsfactory.fi/journeys/api/1/journeys/111",
      "runs" : "yes"
                "route" : "http://data.itsfactory.fi/journeys/api/1/routes/123",
    } ],
                "departureTime" : "08:00:00",
    "calls" : [ {
                arrivalTime" : "08:20:00",
      "arrivalTime" : "00:10:00",
                "dayTypes" : ["Monday","Tuesday","Wednesday","Thursday","Friday"],
      "departureTime" : "00:10:00",
                "dayTypeExceptions" : [
      "stopPoint" : {
                    {
        "url" : "http://data.itsfactory.fi/journeys/api/1/stop-points/0002",
                        "date" : "2014-05-05",
        "location" : "61.49756,23.76148",
                        "runs" : "no"
        "name" : "Keskustori L",
                    }
        "shortName" : "0002",
                ],
        "tariffZone" : "1",
                "calls" : [
        "muncipality" : {
                    {
          "url" : "http://data.itsfactory.fi/journeys/api/1/muncipalities/837",
                        "arrival" : "08:00:00",
          "shortName" : "837",
                        "departure" : "08:00:00",
          "name" : "Tampere"
                        "stopPoint" : {
        }
                            "href" : "http://data.itsfactory.fi/journeys/api/1/stop-points/222"
      }
                            "location" : "61.44960,23.87165",
    }, {
                            "name" : "Hermia",
      "arrivalTime" : "00:11:00",
                            "shortName" : "3633"  
      "departureTime" : "00:11:00",
                        }
      "stopPoint" : {
                    },
        "url" : "http://data.itsfactory.fi/journeys/api/1/stop-points/0500",
                    {
        "location" : "61.49794,23.76558",
                        "arrival" : "08:10:00",
        "name" : "Koskipuisto C",
                        "departure" : "08:10:00",
        "shortName" : "0500",
                        "stopPoint" : {
        "tariffZone" : "1",
                            "href" : "http://data.itsfactory.fi/journeys/api/1/stop-points/223"
        "muncipality" : {
                            "location" : "61.43054,23.81566",
          "url" : "http://data.itsfactory.fi/journeys/api/1/muncipalities/837",
                            "name" : "Vuoreksen koulu",
          "shortName" : "837",
                            "shortName" : "3635"
          "name" : "Tampere"
                        }
        }
                    },
      }
                    {
                        "arrival" : "08:20:00",
                        "departure" : "08:20:00",
                        "stopPoint" : {
                            "href" : "http://data.itsfactory.fi/journeys/api/1/stop-points/224"
                            "location" : "61.44273,23.86268",
                            "name" : "Näyttämönkatu",
                            "shortName" : "3637"
                        }
                    }
                ]
            }          
        ]
     }
     }
}
    ...
    ]
  }
</pre>
</pre>
JOURNEY element contains property called "call". A call is NeTEx element which binds together journeys arrival and departure times with STOP POINT information. For example the JOURNEY in the response has three calls: first call tells that the JOURNEY start time and that it starts from STOP POINT with id 222.
JOURNEY element contains property called "call". A call is NeTEx element which binds together journeys arrival and departure times with STOP POINT information. For example the JOURNEY in the response has three calls: first call tells that the JOURNEY start time and that it starts from STOP POINT with id 222.
Rivi 362: Rivi 351:
* http://data.itsfactory.fi/journeys/api/1/journeys?firstStopPointId=111 will return JOURNEYS which first call which contains STOP POINT with id 111
* http://data.itsfactory.fi/journeys/api/1/journeys?firstStopPointId=111 will return JOURNEYS which first call which contains STOP POINT with id 111
* http://data.itsfactory.fi/journeys/api/1/journeys?lastStopPointId=111 will return JOURNEYS which last call which contains STOP POINT with id 111
* http://data.itsfactory.fi/journeys/api/1/journeys?lastStopPointId=111 will return JOURNEYS which last call which contains STOP POINT with id 111
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). For example query:
* http://data.itsfactory.fi/journeys/api/1/journeys?departureTime=08:00:00&lineId=2 will return JOURNEYS which depart at the given time and are on LINE with id 2


==== Stop Points ====
==== Stop Points ====
0

muokkausta