Ero sivun ”ITSFactory siriaccess developerguide” versioiden välillä

127 merkkiä poistettu ,  31. lokakuuta 2022 kello 15.38
p
POISTETTU http://data.itsfactory.fi/siriaccess/gm/siri - ei toimi
Ei muokkausyhteenvetoa
p (POISTETTU http://data.itsfactory.fi/siriaccess/gm/siri - ei toimi)
 
(14 välissä olevaa versiota 2 käyttäjän tekeminä ei näytetä)
Rivi 1: Rivi 1:
ITS Factory supports following SIRI modules:
ITS Factory supports following SIRI modules:
* Vehicle Monitoring, VM (Currently available)
* Vehicle Monitoring, VM (Currently available)
* General Messages, GM (Currently available in beta phase)
* General Messages, GM (Currently available)


== SIRI Vehicle Monitoring ==
== SIRI Vehicle Monitoring ==
Rivi 7: Rivi 7:


URLs:
URLs:
* http://data.itsfactory.fi/siriaccess/vm/siri (SIRI XML documents over HTTP POST)
* http://data.itsfactory.fi/siriaccess/vm/json (SIRI JSON documents over HTTP GET)
* http://data.itsfactory.fi/siriaccess/vm/json (SIRI JSON documents over HTTP GET)
== SIRI General Messages ==
SIRI general messages, or GM, offers periodic message-style updates on events occurring in the public transport network, such as information about service disruptions or route changes. 
URLs:
* http://data.itsfactory.fi/siriaccess/gm/siri (SIRI XML documents over HTTP POST)
* http://data.itsfactory.fi/siriaccess/gm/json (SIRI JSON documents over HTTP GET)
== The API ==
=== SIRI XML documents over HTTP POST ===
The URL supports standard SIRI XML document exchange as defined in http://www.kizoom.com/standards/siri/, the SIRI version is 1.3 as defined in http://www.kizoom.com/standards/siri/schema/1.3/siri.xsd


==== Requests ====
==== Requests ====
Rivi 60: Rivi 46:
</VehicleMonitoringRequest>
</VehicleMonitoringRequest>
</ServiceRequest>
</ServiceRequest>
</Siri>
</pre>
To access general messages, a client would send a following request:
<pre>
<?xml version="1.0" encoding="UTF-8"?>
<Siri xmlns="http://www.siri.org.uk/siri" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.3" xsi:schemaLocation="http://www.kizoom.com/standards/siri/schema/1.3/siri.xsd">
            <ServiceRequest>
                        <RequestTimestamp>2012-06-11T09:30:50-03:00</RequestTimestamp>
                        <GeneralMessageRequest version="1.3">
                                    <RequestTimestamp>2012-06-11T09:30:50-03:00</RequestTimestamp>
                        </GeneralMessageRequest>         
            </ServiceRequest>
</Siri>
</Siri>
</pre>
</pre>
Rivi 129: Rivi 102:
* VehicleRef uniquely identifies the monitored vehicle
* VehicleRef uniquely identifies the monitored vehicle


Following is a response for general message request:
=== SIRI JSON documents over HTTP GET ===
<pre>
 
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<b><font color=red>NEW!</font></b>
<Siri version="1.3" xmlns="http://www.siri.org.uk/siri" xmlns:ns2="http://www.ifopt.org.uk/acsb" xmlns:ns3="http://www.ifopt.org.uk/ifopt" xmlns:ns4="http://datex2.eu/schema/1_0/1_0">
 
  <ServiceDelivery>
* '''Please note!''' This SIRI VM JSON interface is superceeded by http://wiki.itsfactory.fi/index.php/Journeys_API#Vehicle_Activity . This interface will remain in use until it is eventually removed in the future. SIRI GM interface continues its operation.
      <ResponseTimestamp>2013-04-24T10:20:19.195+03:00</ResponseTimestamp>
      <ProducerRef>IJ2010</ProducerRef>
      <Status>true</Status>
      <MoreData>false</MoreData>
      <GeneralMessageDelivery version="1.3">
        <ResponseTimestamp>2013-04-24T10:20:19.195+03:00</ResponseTimestamp>
        <Status>true</Status>
        <GeneralMessage formatRef="string">
            <RecordedAtTime>2011-09-20T00:00:00+03:00</RecordedAtTime>
            <InfoMessageIdentifier>307</InfoMessageIdentifier>
            <InfoMessageVersion>1</InfoMessageVersion>
            <InfoChannelRef>errors</InfoChannelRef>
            <ValidUntilTime>2011-09-20T23:59:00+03:00</ValidUntilTime>
            <Content xsi:type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Hämeensilta poikki</Content>
        </GeneralMessage>
        <GeneralMessage formatRef="string">
            <RecordedAtTime>2011-09-20T00:00:00+03:00</RecordedAtTime>
            <InfoMessageIdentifier>308</InfoMessageIdentifier>
            <InfoMessageVersion>3</InfoMessageVersion>
            <InfoChannelRef>warnings</InfoChannelRef>
            <ValidUntilTime>2011-09-20T23:59:00+03:00</ValidUntilTime>
            <Content xsi:type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Vappukulkue hidastaa linjojen 13 23 etenemistä</Content>
        </GeneralMessage>
      </GeneralMessageDelivery>
  </ServiceDelivery>
</Siri>
</pre>
The response is quite straightforward:
* InfoChannelRef tells if this message is either error, warning or message
* Content contains the actual message data


=== SIRI JSON documents over HTTP GET ===
JSON access responds to HTTP GET requests and returns JSON formatted textual data. The data itself is structured and named like standard SIRI XML responses (it is just converted from SIRI XML to JSON notation). This allows the client avoid XML request parsing which is typically cumbersome for example to JavaScript clients.
JSON access responds to HTTP GET requests and returns JSON formatted textual data. The data itself is structured and named like standard SIRI XML responses (it is just converted from SIRI XML to JSON notation). This allows the client avoid XML request parsing which is typically cumbersome for example to JavaScript clients.


==== Requests - Vehcile Monitoring ====
==== Requests ====  
To access the SIRI vehicle monitoring client must send HTTP GET requests to http://data.itsfactory.fi/siriaccess/vm/json
To access the SIRI vehicle monitoring client must send HTTP GET requests to http://data.itsfactory.fi/siriaccess/vm/json


Rivi 246: Rivi 188:
The fields and the response structure is similar than the earlier presented XML response. Please check the XML response for few field descriptions.
The fields and the response structure is similar than the earlier presented XML response. Please check the XML response for few field descriptions.


==== Requests - General Messages ====
== SIRI General Messages ==
To access the SIRI vehicle monitoring client must send HTTP GET requests to http://data.itsfactory.fi/siriaccess/gm/json
SIRI general messages, or GM, offers periodic message-style updates on events occurring in the public transport network, such as information about service disruptions or route changes. 
 
URLs:
 
* http://data.itsfactory.fi/siriaccess/gm/json (SIRI JSON documents over HTTP GET)
=== SIRI XML documents over HTTP POST ===
==== Requests ====
<pre>
<?xml version="1.0" encoding="UTF-8"?>
<Siri xmlns="http://www.siri.org.uk/siri" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.3" xsi:schemaLocation="http://www.kizoom.com/standards/siri/schema/1.3/siri.xsd">
            <ServiceRequest>
                        <RequestTimestamp>2012-06-11T09:30:50-03:00</RequestTimestamp>
                        <GeneralMessageRequest version="1.3">
                                    <RequestTimestamp>2012-06-11T09:30:50-03:00</RequestTimestamp>
                        </GeneralMessageRequest>         
            </ServiceRequest>
</Siri>
</pre>
 
==== Responses ====
Following is a response for general message request:
<pre>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Siri version="1.3" xmlns="http://www.siri.org.uk/siri" xmlns:ns2="http://www.ifopt.org.uk/acsb" xmlns:ns3="http://www.ifopt.org.uk/ifopt" xmlns:ns4="http://datex2.eu/schema/1_0/1_0">
  <ServiceDelivery>
      <ResponseTimestamp>2013-04-24T10:20:19.195+03:00</ResponseTimestamp>
      <ProducerRef>IJ2010</ProducerRef>
      <Status>true</Status>
      <MoreData>false</MoreData>
      <GeneralMessageDelivery version="1.3">
        <ResponseTimestamp>2013-04-24T10:20:19.195+03:00</ResponseTimestamp>
        <Status>true</Status>
        <GeneralMessage formatRef="string">
            <RecordedAtTime>2011-09-20T00:00:00+03:00</RecordedAtTime>
            <InfoMessageIdentifier>307</InfoMessageIdentifier>
            <InfoMessageVersion>1</InfoMessageVersion>
            <InfoChannelRef>errors</InfoChannelRef>
            <ValidUntilTime>2011-09-20T23:59:00+03:00</ValidUntilTime>
            <Content xsi:type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Hämeensilta poikki</Content>
        </GeneralMessage>
        <GeneralMessage formatRef="string">
            <RecordedAtTime>2011-09-20T00:00:00+03:00</RecordedAtTime>
            <InfoMessageIdentifier>308</InfoMessageIdentifier>
            <InfoMessageVersion>3</InfoMessageVersion>
            <InfoChannelRef>warnings</InfoChannelRef>
            <ValidUntilTime>2011-09-20T23:59:00+03:00</ValidUntilTime>
            <Content xsi:type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">Vappukulkue hidastaa linjojen 13 23 etenemistä</Content>
        </GeneralMessage>
      </GeneralMessageDelivery>
  </ServiceDelivery>
</Siri>
</pre>
The response is quite straightforward:
* InfoChannelRef tells if this message is either error, warning or message
* Content contains the actual message data
=== SIRI JSON documents over HTTP GET ===
 
==== Requests ====
To access the SIRI general messages client would send following request to http://data.itsfactory.fi/siriaccess/gm/json
The URL supports following parameters
* indent=<yes|no>


The URL supports no parameters.
==== Responses ====
Like in the case of Vehicle Monitoring, the fields and the response structure is similar than the earlier presented XML response. Please check the XML response for few field descriptions.
The fields and the response structure is similar than the earlier presented XML response. Please check the XML response for few field descriptions.