-
Notifications
You must be signed in to change notification settings - Fork 1
Routes, lines, stations, etc. API
to see the list of available parameters and actions, check http://files.transilien.com/hackdays/Manuel_Integration_API_Microservice.pdf
##Possible actions
- ProximityList
- CompanyList
- NetworkList
- ModeTypeList
- ModeList
- LineList
- RouteList
- VehicleJourneyList
- StopAreaList
- StopPointList
- RoutePointList
###Proximity
Getting the stops close to a point in space
MSTransilienAPI api = new MSTransilienAPI();
Map<ActionParam, Object> params = new HashMap<ActionParam, Object>();
params.put(ActionProximityList.Params.Type, "StopPoint");
// proximity PARIS GARE DE LYON
params.put(ActionProximityList.Params.X, "602697,00");
params.put(ActionProximityList.Params.Y, "2427309,00");
ActionProximityList action = api.list(params, ActionProximityList.class);
ProximityList list = action.getList();
###Companies
Getting the list of companies
MSTransilienAPI api = new MSTransilienAPI();
CompanyList list = api.list(null, ActionCompanyList.class).getList();
Getting a specific company by its CompanyExternalCode
MSTransilienAPI api = new MSTransilienAPI();
Map<ActionParam, Object> params = new HashMap<ActionParam, Object>();
params.put(Action.Params.CompanyExternalCode, "DUA092");
CompanyList list = api.list(params, ActionCompanyList.class).getList();
Company company = list.companies.get(0);
###Networks
Getting the list of networks
MSTransilienAPI api = new MSTransilienAPI();
NetworkList list = api.list(null, ActionNetworkList.class).getList();
Getting a specific network by its NetworkExternalCode
MSTransilienAPI api = new MSTransilienAPI();
Map<ActionParam, Object> params = new HashMap<ActionParam, Object>();
params.put(Action.Params.NetworkExternalCode, "DUA801");
NetworkList list = api.list(params, ActionNetworkList.class).getList();
Network network = list.networks.get(0);
###Mode Types
Getting the list of mode types
MSTransilienAPI api = new MSTransilienAPI();
ModeTypeList list = api.list(null, ActionModeTypeList.class).getList();
Getting a specific mode type by its ModeTypeExternalCode
MSTransilienAPI api = new MSTransilienAPI();
Map<ActionParam, Object> params = new HashMap<ActionParam, Object>();
params.put(Action.Params.ModeTypeExternalCode, ModeType.Values.Tramway.name());
ModeTypeList list = api.list(params, ActionModeTypeList.class).getList();
ModeType type = list.modeTypes.get(0);
###Modes
Getting the list of modes
MSTransilienAPI api = new MSTransilienAPI();
ModeList list = api.list(null, ActionModeList.class).getList();
Getting a specific mode by a ModeTypeExternalCode
MSTransilienAPI api = new MSTransilienAPI();
Map<ActionParam, Object> params = new HashMap<ActionParam, Object>();
params.put(Action.Params.ModeTypeExternalCode, ModeType.Values.Tramway.name());
ModeList list = api.list(params, ActionModeList.class).getList();
Mode mode = list.modes.get(0);
###Lines
Getting the list of lines
MSTransilienAPI api = new MSTransilienAPI();
LineList list = api.list(null, ActionLineList.class).getList();
Getting a specific line by its LineExternalCode
MSTransilienAPI api = new MSTransilienAPI();
Map<ActionParam, Object> params = new HashMap<ActionParam, Object>();
params.put(Action.Params.LineExternalCode, "DUA810801400");
LineList list = api.list(params, ActionLineList.class).getList();
Line line = list.lines.get(0);
Getting a list of lines by a ModeTypeExternalCode
MSTransilienAPI api = new MSTransilienAPI();
Map<ActionParam, Object> params = new HashMap<ActionParam, Object>();
params.put(Action.Params.ModeTypeExternalCode, ModeType.Values.RapidTransit.name();
LineList list = api.list(params, ActionLineList.class).getList();
###Routes
Getting the list of routes
MSTransilienAPI api = new MSTransilienAPI();
RouteList list = api.list(null, ActionRouteList.class).getList();
Getting a specific route by its RouteExternalCode
MSTransilienAPI api = new MSTransilienAPI();
Map<ActionParam, Object> params = new HashMap<ActionParam, Object>();
params.put(Action.Params.RouteExternalCode, "DUA0141460142097");
RouteList list = api.list(params, ActionRouteList.class).getList();
Route = list.routes.get(0);
###Vehicle Journeys
Getting a list of journeys by a StopAreaExternalCode
, ModeTypeExternalCode
, StartTime
and EndTime
MSTransilienAPI api = new MSTransilienAPI();
Map<ActionParam, Object> params = new HashMap<ActionParam, Object>();
params.put(Action.Params.StopAreaExternalCode, "DUA8775819");
params.put(Action.Params.ModeTypeExternalCode, ModeType.Values.RapidTransit);
params.put(ActionVehicleJourneyList.Params.StartTime, "10|00");
params.put(ActionVehicleJourneyList.Params.EndTime, "11|00");
VehicleJourneyList list = api.list(params, ActionVehicleJourneyList.class).getList();
Getting a journey by its VehicleJourneyExternalCode
MSTransilienAPI api = new MSTransilienAPI();
Map<ActionParam, Object> params = new HashMap<ActionParam, Object>();
params.put(Action.Params.VehicleJourneyExternalCode, "DUASN080999F01001");
VehicleJourneyList list = api.list(params, ActionVehicleJourneyList.class).getList();
VehicleJourney = list.vehicleJourneys.get(0);
###Stop Areas
Getting the list of stop areas
MSTransilienAPI api = new MSTransilienAPI();
StopAreaList list = api.list(null, ActionStopAreaList.class).getList();
###Stop Points
Getting the list of stop points
MSTransilienAPI api = new MSTransilienAPI();
StopPointList list = api.list(null, ActionStopPointList.class).getList();
###Route Points
Getting the list of route points
MSTransilienAPI api = new MSTransilienAPI();
RoutePointList list = api.list(null, ActionRoutePointList.class).getList();
Getting the list of route points by a StopPointExternalCode
MSTransilienAPI api = new MSTransilienAPI();
Map<ActionParam, Object> params = new HashMap<ActionParam, Object>();
params.put(Action.Params.StopPointExternalCode, "DUA8775820");
RoutePointList list = api.list(params, ActionRoutePointList.class).getList();
RoutePoint point = list.points.get(0);