A Secure and Reliable Document Management System is Essential.docx
MOBILITYLABS Madrid OPENAPI
1. Government API strategies
OPENAPI MADRID EXPERIENCE
17th-18th October 2018
European Commission, Ispra Andrés Recio
EMT MADRID (@MobilityLabsMad)
2. API HISTORY
OPENAPI MADRID EXPERIENCE EMT MADRID
Government API
strategies
17th-18th October 2018European Commission, Ispra
Optitrans FP7
(Proto-API)
2010
First EMT APP
API deploy thinking on
internal use only
2012
First API
Agreement
Why not open
our data?
2013
35.000.00
0
hits/mont
h
2015
New security
model
New server
infraestructure
2016
MobilityLab
s model
concept
100.000.000
hits/month
2018
Api for
Mobility
and City
Concept
170.000.000
hits/month
(60
hits/second)
3. MOTIVATIONS
OPENAPI MADRID EXPERIENCE EMT MADRID
Government API
strategies
17th-18th October 2018European Commission, Ispra
As of 2012, EMT managers start a debate due to some issues that happen:
• Official EMT Webpage seemed to be under attack (scraping)
Some developers getting data in wrong way by offer transport information into their
apps
• The Democracy of the Data.
Many independent developers claimed the right to open, free and public data.
• The fear of change.
On the other hand, EMT responsibles had to understand the advantage of offering
data in a controllable way.
• More APPS = More Knowledge of Transport = More users in buses.
Above all WE ARE A COMPANY OF PUBLIC TRANSPORT, our business is not software
development.
• Oportunities in invest and cost.
EMT going to develop Apps for Mobiles so … why not using APIs and why not offer the
same API in open?
4. RESULTS
OPENAPI MADRID EXPERIENCE EMT MADRID
Government API
strategies
17th-18th October 2018European Commission, Ispra
The result of developing an API for our Apps was:
• Important saving in the development of the Apps.
• Available data always updated in the Apps
• Ease of maintenance and content control.
• Simplicity to extend the model to other solutions and third developers.
• Zero maintenance cost extra in software, only the necessary for our own infrastructure.
• Greater effort in security (There are always developers who put us to the test)
• Increased investment in servers and databases (Some third-party solutions are not well
optimized)
5. UNIQUE API USERS
OPENAPI MADRID EXPERIENCE EMT MADRID
Government API
strategies
17th-18th October 2018European Commission, Ispra
More than 50
Apps connected
0
200
400
600
800
1000
1200
1400
1600
1800
2010_11
2012_01
2012_08
2013_08
2014_01
2014_08
2015_01
2015_06
2015_11
2016_04
2016_09
2017_02
2017_07
2017_12
2018_05
2018_10
6. SOME METRICS
OPENAPI MADRID EXPERIENCE EMT MADRID
Government API
strategies
17th-18th October 2018European Commission, Ispra
22%
29%
49%
USES OF API
EMTMADRID APPS
NON EMTMADRID APPS
REALTIME vs GENERAL DATA
ESTIMATIONS OF ARRIVAL BUS OTHER WEBMETHODS
7. USER REGISTER PROCESS
OPENAPI MADRID EXPERIENCE EMT MADRID
Government API
strategies
17th-18th October 2018European Commission, Ispra
1.- ACCESS TO PORTAL
2.- FILLREGISTER
FORM
CONFIRM
VIA EMAIL READY TO USE
THE API AND
PORTAL
PRIVATE AREA
8. FEATURES OF MOBILITYLABS API
SYSTEMS
OPENAPI MADRID EXPERIENCE EMT MADRID
Government API
strategies
17th-18th October 2018European Commission, Ispra
ENABLED for data producers. Developers can get, load and share their own data.
SECURITY MODEL: oAuth2 (900 seconds alive, auto-extensible)
STANDARDIZATION: Structures on JSON, Geo data in GEO-JSON
Classic API RESTFUL for classic applications developers
(https://openapi.emtmadrid.es/)
Reactive websocket connector for IoT developers (wss://rbmobility.emtmadrid.es)
Geographical WMS services for data Journalist (https://mynavega.emtmadrid.es)
Queues for data producers (amqp.emtmadrid.es)
9. Classic API REST STRUCTURE
OPENAPI MADRID EXPERIENCE EMT MADRID
Government API
strategies
17th-18th October 2018European Commission, Ispra
PUBLIC SIDE
INTERNAL &
EXTERNAL DATA
RESOURCES (SQL &
NO-SQL BBDD)
Real Time &
DATA PARKINGS
Real Time &
DATA EMT BUS
Real Time &
DATA PUBLIC
BIKE
GIS RESOURCES
ACCESS CONTROL
& SECURITY
INTERNAL API
CLUSTER INTERNET
INFORMATION SERVER
PUBLIC API
DOCKER STACK
MACHINES
FIREWALL
PRIVATE SIDECLIENTS
https://openapi.emtmadrid.es/v1/
10. USING DISCOVERING DATA METHODS
OPENAPI MADRID EXPERIENCE EMT MADRID
Government API
strategies
17th-18th October 2018European Commission, Ispra
Categories
Subcategory 1 Subcategory 2
Collection 1
Link data 1
Link data N
Collection N
Subcategory N
Security /
Permissions
https://openapi.emtmadrid.es/v1/
mobilitylabs/discover/categories
mobilitylabs/discover/collections/<CD_SUBCATEGORY>/
mobilitylabs/collection/reactive/<CD_COLLECTION>/<CD_LINK>/
mobilitylabs/collection/static/<CD_COLLECTION>/<CD_LINK>/
user/login
mobilitylabs/collection/webservice/<CD_COLLECTION>/<CD_LINK>/
11. EXAMPLE FOR USING TRANSPORT & CITY CATEGORIES
OPENAPI MADRID EXPERIENCE EMT MADRID
Government API
strategies
17th-18th October 2018European Commission, Ispra
https://openapi.emtmadrid.es/v1/
user/login/ transport/
busemtmad/
lines/<lineId>/
route/<direction>/
timetable/
stops/<stopId>/
arrives/<option>/
citymad/
streets/<name>/<number>/
parking/
12. REACTIVE API SERVER
OPENAPI MADRID EXPERIENCE EMT MADRID
Government API
strategies
17th-18th October 2018European Commission, Ispra
OBSERVING DATA IN REAL TIME USING WEBSOCKETS
DEVELOPERS CAN USE A GEOMAP FOR
SUPPORTING THEIR DEVELOPEMENTS
(https://rbmobility.emtmadrid.es/)
Rbmobility.emtmadrid.es External Data
Resources
CLIENT SIDE
(Real Time
Observer)
DDP
Security
(wss://rbmobility.emtmadrid.es/)
13. QUEUE SERVER
OPENAPI MADRID EXPERIENCE EMT MADRID
Government API
strategies
17th-18th October 2018European Commission, Ispra
Client Producer
SECURITY
(amqp.emtmadrid.es)
PRODUCERS CAN LOAD INFORMATION INTO THE SYSTEM (OPENDATA MADE BY USERS)
External Data
Resources
14. MAPS FOR DATA
JOURNALIST
OPENAPI MADRID EXPERIENCE EMT MADRID
Government API
strategies
17th-18th October 2018European Commission, Ispra
(https://mynavega.emtmadrid.es)
MEDIA PUBLICATIONS
CAN CREATE
CUSTOMIZED MAPS
USING WMS SERVER API
15. MORE REFERENCES
17th-18th October 2018
European Commission, Ispra Andrés Recio
EMT MADRID (@MobilityLabsMad)
Government API
strategies
17th-18th October 2018European Commission, Ispra
Portal Data Information:
https://mobilitylabs.emtmadrid.es
Documents, helps and source code examples:
https://gitlab.com/mobilitylabsmadrid
16. CHALLENGES and Open Discussions
OPENAPI MADRID EXPERIENCE EMT MADRID
Government API
strategies
17th-18th October 2018European Commission, Ispra
Need to Improve Metrics and control API activity. We are
thinking about registering the activity, i.e. with Elastic
Search & Kibana.
How to maintain the Level of Service in the new
challenge of Mobility as a Service (MaaS) that starts in
EMT.
Increase Services = Increase Challenges: integrate
payments, tokens, user identities, mobility analysis,
customer service, monitoring, etc.
17. THANKS
17th-18th October 2018
European Commission, Ispra Andrés Recio
EMT MADRID (@MobilityLabsMad)
Government API
strategies
17th-18th October 2018European Commission, Ispra