...
If the user adds a GTFS-RT broadcaster to a Partner, like gtfs-rt-trip-updates-broadcaster
, gtfs-rt-vehicle-positions-broadcaster
, gtfs-rt-service-alerts-broadcaster
, etc
For example:
Code Block |
---|
POST /referential<referential_slugslug>/partners { "slug": "test", "connectorTypes": [ "gtfs-rt-trip-updates-broadcaster" ], "settings": { "local_credential": "secret", "remote_objectid_kind": "internal" } } |
Then the user can perform GTFS requests:
Code Block |
---|
GET /referential<referential_slugslug>/gtfs-rt GET /referential<referential_slugslug>/gtfs-rt/trip-updates GET /referential<referential_slugslug>/gtfs-rt/vehicle-positions GET /<referential_slug>/gtfs/service-alerts |
Endpoints
The user can select the expected GTFS-RT entities by using one of the GTFS-RT endpoints:
Global endpoint /referential<referential_slugslug>/gtfs-rt
This endpoint provides all entities. If no GTFS-RT broadcaster is defined (gtfs-rt-trip-updates-broadcaster
, gtfs-rt-vehicle-positions-broadcaster
, etc), this endpoint returns a 501 status code.
Trip Update endpoint /referential<referential_slugslug>/gtfs-rt/trip-updates
This endpoint provides only Trip Update entities. If the gtfs-rt-trip-updates-broadcaster
is not defined into the associated Partner, this endpoint returns a 501 status code.
Vehicle Position endpoint /referential<referential_slugslug>/gtfs-rt/vehicle-positions
This endpoint provides only Trip Update entities. If the gtfs-rt-vehicle-positions-broadcaster
is not defined into the associated Partner, this endpoint returns a 501 status code.
Service Alert endpoint /<referential_slug>/gtfs/service-alerts
This endpoint provides only Alert entities. If the gtfs-rt-service-alerts-broadcaster
is not defined into the associated Partner, this endpoint returns a 501 status code.
...
The user can specify a credential in the GTFS-RT request by using an HTTP header Authorization
with this syntax : for secret
token, Authorization: Token token=secret
Code Block |
---|
GET /referential<referential_slugslug>/gtfs-rt Authorization: Token token=secret |
...
Code Block |
---|
GET /bibus/gtfs-rt
Authorization: Token token=secret |
...
Code Block |
---|
GET /bibus/gtfs-rt |
will be associated to the Partner C.
...
Code Block |
---|
GET /bibus/gtfs-rt
Authorization: Token token=dummy |
...
FeedHeader
Incrementality
FeedEntity
TripUpdate
TripDescriptor
StopTimeUpdate
StopTimeEvent
VehiclePosition
TripDescriptor
Position
Alert
ActivePeriod
InformedEntity
Cause
Effect
HeaderText
DescriptionText
SeverityLevel
All GTFS-RT responses respect this structure.
...
The VehiclePosition entities are provided only if the user request selects them and if the gtfs-rt-vehicle-positions-broadcaster
is associated to the Partner. See the associated story for content details.
Complete example (in pseudo json content)
...
language | json |
---|
...
The Alert entities are provided only if the user request selects them and if the gtfs-rt-service-alerts-broadcaster
is associated to the Partner. See the associated story for content details.
Complete example (in pseudo json content)
Code Block | ||
---|---|---|
| ||
{ "header": { "gtfs_realtime_version": "2.0", "incrementality": "FULL_DATASET", "timestamp": "1580136888" }, "entity": [ { "id": "trip:281721", "trip_update": { "trip": { "trip_id": "281721", "route_id": "3001I", "start_time": "16:36:00" }, "stop_time_update": [ { "stop_sequence": 1, "departure": { "time": "1580135775" }, "stop_id": "1020503" }, { "stop_sequence": 2, "arrival": { "time": "1580136050" }, "departure": { "time": "1580136050" }, "stop_id": "1174501" }, { "stop_sequence": 3, "arrival": { "time": "1580136234" }, "stop_id": "1250501" } ] } }, { "id": "vehicle:943", "vehicle": { "trip": { "trip_id": "281721", "route_id": "3001I", "start_time": "16:36:00" }, "position": { "latitude": 60.27628707885742, "longitude": 24.856653213500977, "bearing": 133 }, "vehicle": { "id": "943" } } }, ] } |
General attributes
...
FeedHeader attribute
...
Value
...
gtfs_realtime_version
...
“2.0”
...
incrementality
...
FULL_DATASET
...
timestamp
...
According to the current time on response creation
Broadcast Vehicle Journey data via a GTFS-RT Trip Updates Broadcaster
When the user requests the GTFS-RT Trip Updates, Ara returns a GTFS-RT Trip Update entity for each Vehicle Journey which have at least a Stop time in the future, with the following attributes:
...
FeedEntity attribute
...
Value
...
id
...
“trip:<vehicle journey.objectid>”
...
TripDescriptor attribute
...
Value
...
trip_id
...
Vehicle Journey objectid
...
route_id
...
Line objectid
...
start_time
...
First Stop Visit actual or expected or aimed departure time
...
StopTimeUpdate attribute
...
Value
...
stop_sequence
...
Stop Visit PassageOrder
...
stop_id
...
Stop Area objectid
...
arrival
...
Stop Visit absolute actual
or expected
or aimed
arrival time if defined
...
departure
...
Stop Visit absolute actual
or expected
or aimed
departure time if defined
Trip Update Entity example (in pseudo json content)
Code Block | ||
---|---|---|
| ||
{ "id": "trip:281721", "trip_update": { "trip": { "trip_id": "281721", { "id": "d2fd41c5-8bee-4920-9c75-e3d505f82f01", "alert": { "active_period": [ { "start": 1720418400, "end": 1723671900 } ], "informed_entity": [ { "route_id": "3001I7", "start_time": "16:36:00" } }, ], "stop_time_update": [ {"cause": 10, "stop_sequenceeffect": 19, "departureheader_text": { "timetranslation": [ "1580135775" }, { "stop_id "text": "1020503"route change" }, { ] "stop_sequence": 2 }, "arrivaldescription_text": { "timetranslation": "1580136050"[ }, { "departure": { "timetext": "1580136050"Route change from July 10th to July 14th" }, "stop_id": "1174501" } }, ] { "stop_sequence": 3}, "arrivalseverity_level": {3 } "time": "1580136234" } }, "stop_id": "1250501" } ] } } |
...
]
} |
General attributes
FeedHeader attribute | Value |
---|---|
gtfs_realtime_version | “2.0” |
incrementality | FULL_DATASET |
timestamp | According to the current time on response creation |
Broadcast Vehicle Journey data via a GTFS-RT
...
Trip Updates Broadcaster
When the user requests the GTFS-RT Trip Updates, Ara returns a GTFS-RT Vehicle Position Trip Update entity for each Vehicle Journey which have at least a Stop time in the future, with the following attributes:
FeedEntity attribute | Value |
id | “trip:<vehicle journey.objectid>” |
TripDescriptor attribute | Value |
trip_id | Vehicle Journey objectid |
route_id | Line objectid |
start_time | First Stop Visit actual or expected or aimed departure time |
StopTimeUpdate attribute | Value |
stop_sequence | Stop Visit PassageOrder |
stop_id | Stop Area objectid |
arrival | Stop Visit absolute |
actual
|
arrival time if defined | |
departure | Stop Visit absolute |
|
departure time if defined |
VehiclePosition attribute
Value
latitude
Vehicle latitude
longitude
Vehicle longitude
bearing
Vehicle bearing if defined
VehicleDescription attribute
Value
id
Vehicle objectid
...
Trip Update Entity example (in pseudo json content)
...
language | json |
---|
...
Code Block | ||
---|---|---|
| ||
{
"id": "trip:281721",
"trip_update": {
"trip": {
"trip_id": "281721",
"route_id": "3001I",
"start_time": "16:36:00"
},
"stop_time_update": [
{
"stop_sequence": 1,
"departure": {
"time": "1580135775"
},
"stop_id": "1020503"
},
{
"stop_sequence": 2,
"arrival": {
"time": "1580136050"
},
"departure": {
"time": "1580136050"
},
"stop_id": "1174501"
},
{
"stop_sequence": 3,
"arrival": {
"time": "1580136234"
},
"stop_id": "1250501"
}
]
}
} |
Broadcast Vehicle data via a GTFS-RT Vehicle Position Broadcaster
When the user requests the GTFS-RT Trip Updates, Ara returns a GTFS-RT Vehicle Position entity for each Vehicle with the following attributes:
TripDescriptor attribute | Value |
trip_id | Vehicle Journey objectid |
route_id | Line objectid |
start_time | First Stop Visit actual or expected or aimed departure time |
StopTimeUpdate attribute | Value |
stop_sequence | Stop Visit PassageOrder |
stop_id | Stop Area objectid |
arrival | Stop Visit absolute arrival time ( |
departure | Stop Visit absolute departure time ( |
VehiclePosition attribute | Value |
latitude | Vehicle latitude |
longitude | Vehicle longitude |
bearing | Vehicle bearing if defined |
VehicleDescription attribute | Value |
id | Vehicle objectid |
Vehicle Position Entity example (in pseudo json content)
Code Block | ||
---|---|---|
| ||
{
"id": "vehicle:943",
"vehicle": {
"trip": {
"trip_id": "281721",
"route_id": "3001I",
"start_time": "16:36:00"
},
"position": {
"latitude": 60.27628707885742,
"longitude": 24.856653213500977,
"bearing": 133
},
"vehicle": {
"id": "943"
}
}
} |
Broadcast Alert data via a GTFS-RT Service Alert Broadcaster
When the user requests the GTFS-RT Service Alert, Ara returns a GTFS-RT Alert entity for each Situation with the following attributes:
TimeRange attribute | Value |
start | Beginning of period when the Alert will be displayed |
end | End of period when the Alert will be displayed |
EntitySelector attribute | Value |
route_id | Line code |
stop_id | Stop Area code |
Cause attribute | Value |
cause | Cause of the Alert |
Effect attribute | Value |
effect | Effect of the Alert |
HeaderText attribute | Value |
Translation attribute | text → An UTF-8 string containing the message language → BCP-47 language code |
DescriptionText attribute | Value |
Translation attribute | text → An UTF-8 string containing the message language → BCP-47 language code |
SeverityLevel attribute | Value |
severity_level | Severity of the Alert |
Alert Entity example (in pseudo json content)
Code Block | ||
---|---|---|
| ||
{ "id": "d2fd41c5-8bee-4920-9c75-e3d505f82f01", "alert": { "active_period": [ { "start": 1720418400, "end": 1723671900 } ], "informed_entity": [ { "route_id": "7" } ], "cause": 10, "effect": 9, "header_text": { "translation": [ { "text": "route change", "language": "en" } ] }, "description_text": { "route_idtranslation": "3001I", [ "start_time": "16:36:00"{ }, "text"position": { "latitude": 60.27628707885742,: "Route change from July 10th to July 14th", "longitudelanguage": 24.856653213500977,"en" "bearing": 133 } }, ] "vehicle": { }, "idseverity_level": "943" }3 } } |