Getting the trip-trip-transfer time
This API returns the transfer time between two trips.
In addition, it returns an alert if the real-time transfer time computed exceeds the schedule by a specific threshold.
Authentication phase
Before using the endpoint, you must run the authentication phase (→ Login).
After the authentication, a session opens and a valid session token persists until:
- The end of the session time-out, that is set through the parameter sessionTimeout (→ OptimaWSI configuration > OptimaAuth node).
- An explicit Logout call (→ Logout).
Request
GET
https://<OPTIMA_HOST_IP_ADDRESS>:<PORT_NUMBER>/optima-put/transfer/trip/{from_public_stop_id}/{from_trip _id}/{to_public_stop_id}/{to_trip _id}/
All path parameters are required.
The transfer is between two trips at a specified pair of transit stops.
- from_trip_id is the ID of the first trip.
- to_trip_id is the ID of the second trip.
- from_public_stop_id is the ID of the first transit stop. The from_public_stop_id must belong to the route of the from_trip_id.
- to_public_stop_id is the ID of the second transit stop. The to_public_stop_id must belong to the route of the to_trip_id.
If you need additional details, see → Transfer alert service.
Request parameters
| Parameter | Required | Description |
|---|---|---|
|
format |
NO |
Response format. It can be bytes or text. The default is bytes. |
|
timeStamp |
NO |
Reference timestamp used to compute the transfer time. Default is now. |
|
minTransferTime |
YES |
Minimum transfer time in seconds. It must be a positive number. |
|
alertThreshold |
YES |
The alert threshold must be a positive number. The API returns an alert in the response if: trr − trs > alertThreshold with:
The unit is [s]. |
Request content-type
Not applicable.
Request body (payload)
Not applicable.
Response status
| HTTP status | Description |
|---|---|
|
200 OK |
Result of the processed request. |
|
400 Bad request |
Several conditions can be classified under this code. Generally, when the API has been called with wrong arguments. In particular, the service returns this code whenever a path parameter or a request parameter is not consistent with the declared rules. |
Response content-type
If in the request:
- format=bytes, the format of the response is application/x-google-protobuf.
- format=text, the format of the response is text/plain.
Response output
Text containing all information about the trip-trip transfer.
In case of a bad request, a text message is returned, explaining what has caused the problem.
Request
https://<OPTIMA_HOST_IP_ADDRESS>:<PORT_NUMBER>/optima-put/transfer/trip/3382/924164/3382/924459?minTransferTime=100&alertThreshold=300&timeStamp=2016-05-27T00:00:00&format=text
Response status
| HTTP status | Description |
|---|---|
|
200 OK |
The processing request has been accepted. |
Response content-type
text/plain
Response output
header {
gtfs_realtime_version: "1.0"
timestamp: 1749465820
}
entity {
id: "1"
[transit_realtime.transfer] {
id: "predefined_transfer_1"
from_trip_id: "trip1"
to_trip_id: "trip2"
transfer_time: 280
alert: false
public_stop_from: "101020"
public_stop_to: "102021"
route_from: "6"
route_to: "3"
threshold: 300
transfer_time_min: 100
transfer_time_planned: 280
waiting_time: 20
time_from {
seconds: 1395911280
}
time_to {
seconds: 1395911400
}
}
}