SlideShare une entreprise Scribd logo
1  sur  17
Télécharger pour lire hors ligne
REST	
  APIs	
  	
  
for	
  the	
  	
  
Internet	
  Of	
  Things	
  
Michael	
  J	
  Koster	
  
Open	
  Source	
  Internet	
  Of	
  Things	
  
Meetup	
  19	
  March	
  2014	
  
Resource	
  oriented	
  API	
  
•  Resource	
  ==	
  web	
  resource	
  (URI)	
  
•  Resources	
  change	
  state	
  in	
  response	
  to	
  what	
  is	
  
being	
  sensed	
  
•  Actuator	
  changes	
  state	
  in	
  response	
  to	
  web	
  
resource	
  update	
  
•  Abstract	
  data	
  sources	
  and	
  sinks	
  
•  REST	
  API	
  has	
  2	
  important	
  characterisJcs	
  for	
  
IoT	
  use	
  case…	
  
RepresentaJonal	
  State	
  Transfer	
  
•  Resource	
  interacJon	
  through	
  exchange	
  of	
  
representaJon	
  of	
  resource	
  state	
  
•  E.g.	
  a	
  representaJon	
  of	
  the	
  state	
  of	
  a	
  
temperature	
  sensor	
  might	
  be	
  “63.6”	
  	
  
•  Convenient	
  for	
  applicaJon	
  soTware	
  to	
  use	
  
read/write	
  semanJcs	
  to	
  interact	
  with	
  
resources	
  
•  Stateful	
  resource	
  representaJons	
  =>	
  Stateless	
  
applicaJon	
  soTware	
  
Based	
  on	
  Hypermedia	
  
•  Use	
  of	
  web	
  links	
  to	
  locate	
  resources	
  of	
  
interest	
  
•  IoT	
  needs	
  machine-­‐readable	
  links	
  that	
  enable	
  
applicaJon	
  soTware	
  to	
  discover	
  things	
  of	
  
interest	
  
•  Subset	
  of	
  web	
  linking,	
  semanJc	
  web	
  using	
  
relaJon/aribute	
  
•  Links	
  encode	
  metadata	
  about	
  the	
  resource,	
  
e.g.	
  type=‘temperature’,	
  ct=‘applicaJon/json’	
  
Web	
  Linking	
  for	
  IoT	
  
•  Links	
  are	
  managed	
  in	
  2	
  ways	
  
•  Object	
  encapsulaJon:	
  self-­‐describing	
  objects	
  
have	
  links	
  associated	
  with	
  endpoint,	
  e.g.	
  ./
well-­‐known/core	
  
•  Resource	
  Directory:	
  Directories	
  and	
  Catalogs	
  
of	
  links,	
  stored	
  at	
  well-­‐known	
  locaJons,	
  that	
  
point	
  to	
  resources	
  and	
  to	
  other	
  catalogs	
  
Web	
  Linking	
  for	
  IoT	
  
•  Links	
  can	
  be	
  registered	
  with	
  a	
  Resource	
  Directory	
  
when	
  sensors	
  are	
  brought	
  online	
  
•  A	
  crawler	
  can	
  discover	
  links	
  at	
  ./well-­‐known/core	
  
locaJons	
  and	
  populate	
  catalogs	
  
•  ApplicaJon	
  soTware	
  can	
  discover	
  resources	
  by	
  
aribute,	
  e.g.	
  query	
  using	
  type=‘temperature’,	
  
units=‘celsius’,	
  locaJon=‘outdoor’	
  etc.	
  	
  
•  System	
  returns	
  a	
  set	
  of	
  links	
  matching	
  the	
  query	
  
aributes	
  
CoAP	
  
•  Part	
  of	
  IPV6	
  for	
  Constrained	
  Resource	
  
Environments	
  (CoRE)	
  
•  IoT	
  oriented	
  REST	
  API	
  mapped	
  to	
  an	
  efficient	
  
binary	
  protocol	
  
•  End	
  devices	
  can	
  have	
  both	
  client	
  and	
  server	
  
roles,	
  can	
  also	
  communicate	
  directly	
  
•  Resource	
  representaJon	
  e.g.	
  ‘applicaJon/
json’,	
  is	
  negoJated	
  as	
  in	
  hp	
  protocol	
  
CoAP	
  
•  Observe	
  opJon	
  for	
  long-­‐term	
  event	
  stream	
  
response	
  to	
  GET,	
  asynchronous	
  updates	
  
•  Web	
  linking	
  using	
  IETF	
  standard	
  core-­‐link-­‐
format	
  (RFC	
  6690)	
  
•  Resource	
  discovery	
  using	
  ./well-­‐known/core	
  
or	
  external	
  Resource	
  Directory	
  
	
  
HTTP/REST	
  
•  HTTP	
  and	
  REST	
  is	
  useful	
  for	
  most	
  web	
  
applicaJons,	
  services,	
  and	
  gateways	
  
•  Uses	
  web	
  callbacks,	
  websockets,	
  HTTP	
  PUT	
  for	
  
asynchronous	
  updates	
  
•  Links	
  in	
  JSON,	
  Link-­‐format,	
  Hypercat,	
  linked	
  
data	
  
•  Well	
  defined	
  CoAP-­‐to-­‐HTTP	
  proxy	
  paerns,	
  
standard	
  middleware	
  
Hybrid	
  system	
  
•  It’s	
  possible	
  to	
  use	
  REST	
  for	
  resource	
  discovery	
  
and	
  other	
  stateful	
  interacJons,	
  and	
  messaging	
  
e.g.	
  MQTT	
  for	
  asynchronous	
  updates	
  
•  Various	
  methods	
  to	
  bind	
  message	
  endpoints	
  
to	
  REST	
  resources	
  
•  ApplicaJon	
  soTware	
  can	
  easily	
  use	
  both	
  REST	
  
API	
  and	
  event	
  handler	
  interfaces	
  like	
  
onUpdate	
  
•  IoT	
  Toolkit	
  uses	
  observers	
  to	
  bind	
  	
  
Standards	
  and	
  SoTware	
  
•  CoAP	
  	
  
hps://datatracker.iel.org/doc/draT-­‐iel-­‐core-­‐coap/	
  
•  CoRE	
  link-­‐format	
  
hp://tools.iel.org/html/rfc6690	
  
•  CoRE	
  Observe	
  
hps://datatracker.iel.org/doc/draT-­‐iel-­‐core-­‐observe/	
  
•  CoRE	
  Resource	
  Directory	
  
hps://tools.iel.org/html/draT-­‐iel-­‐core-­‐resource-­‐directory-­‐00	
  
•  Hypercat	
  
hp://wiki.1248.io/doku.php?id=hypercat	
  
IoT	
  Toolkit	
  Interoperability	
  Demo	
  
smartobjectservice.com	
  
Node-­‐RED	
  
Node-­‐RED	
  
MQTT	
  Observer	
  
MQTT	
  Broker	
  
REST	
  Endpoint	
  
ObservableProperty	
  
mqObserver	
  
PUT	
   GET	
  
Publish	
  from	
  
data	
  producer	
  
Publish	
  From	
  
REST	
  API	
  
Publish	
  to	
  Other	
  
Subscribers	
  
SUB	
  
Publish	
  to	
  
REST	
  API	
  	
  
Connects	
  REST	
  Resource	
  to	
  MQTT	
  Topic	
  
Publish	
  and	
  Subscribe	
  
MQTT	
  Observer	
  
MQTT	
  Broker	
  
REST	
  Endpoint	
  
ObservableProperty	
  
mqObserver	
  
PUT	
   GET	
  
Publish	
  from	
  
data	
  producer	
  
Publish	
  From	
  
REST	
  API	
  
Publish	
  to	
  Other	
  
Subscribers	
  
SUB	
  
Publish	
  to	
  
REST	
  API	
  	
  
Publisher	
  	
  
Publishes	
  REST	
  Resource	
  updates	
  to	
  the	
  broker	
  
MQTT	
  Observer	
  
MQTT	
  Broker	
  
REST	
  Endpoint	
  
ObservableProperty	
  
mqObserver	
  
PUT	
   GET	
  
Publish	
  from	
  
data	
  producer	
  
Publish	
  From	
  
REST	
  API	
  
Publish	
  to	
  Other	
  
Subscribers	
  
SUB	
  
Publish	
  to	
  
REST	
  API	
  	
  
Subscriber	
  	
  
Makes	
  last	
  published	
  data	
  available	
  at	
  the	
  REST	
  endpoint	
  
MQTT	
  Observer	
  
MQTT	
  Broker	
  
REST	
  Endpoint	
  
ObservableProperty	
  
mqObserver	
  
PUT	
   GET	
  
Publish	
  from	
  
data	
  producer	
  
Publish	
  From	
  
REST	
  API	
  
Publish	
  to	
  Other	
  
Subscribers	
  
SUB	
  
Publish	
  to	
  
REST	
  API	
  	
  
Pub+Sub	
  
Repeats	
  data	
  updates	
  in	
  both	
  direcJons	
  
MQTT	
  Bridge	
  to	
  mulJple	
  REST	
  endpoints	
  	
  
MQTT	
  Broker	
  
REST	
  Endpoint	
  
ObservableProperty	
  
mqObserver	
  
PUT	
   GET	
  
Publish	
  from	
  
data	
  producer	
  
Publish	
  to	
  Other	
  
Subscribers	
  
REST	
  Endpoint	
  
ObservableProperty	
  
mqObserver	
  
PUT	
   GET	
  

Contenu connexe

Tendances

SDN( Software Defined Network) and NFV(Network Function Virtualization) for I...
SDN( Software Defined Network) and NFV(Network Function Virtualization) for I...SDN( Software Defined Network) and NFV(Network Function Virtualization) for I...
SDN( Software Defined Network) and NFV(Network Function Virtualization) for I...Sagar Rai
 
LoRaWAN in Depth
LoRaWAN in DepthLoRaWAN in Depth
LoRaWAN in DepthAPNIC
 
IoT Communication Protocols
IoT Communication ProtocolsIoT Communication Protocols
IoT Communication ProtocolsPradeep Kumar TS
 
Introduction to Spark Streaming & Apache Kafka | Big Data Hadoop Spark Tutori...
Introduction to Spark Streaming & Apache Kafka | Big Data Hadoop Spark Tutori...Introduction to Spark Streaming & Apache Kafka | Big Data Hadoop Spark Tutori...
Introduction to Spark Streaming & Apache Kafka | Big Data Hadoop Spark Tutori...CloudxLab
 
A Modern C++ Kafka API | Kenneth Jia, Morgan Stanley
A Modern C++ Kafka API | Kenneth Jia, Morgan StanleyA Modern C++ Kafka API | Kenneth Jia, Morgan Stanley
A Modern C++ Kafka API | Kenneth Jia, Morgan StanleyHostedbyConfluent
 
Bringing API Management to AWS Powered Backends
Bringing API Management to AWS Powered BackendsBringing API Management to AWS Powered Backends
Bringing API Management to AWS Powered BackendsApigee | Google Cloud
 
Introduction to SDN and NFV
Introduction to SDN and NFVIntroduction to SDN and NFV
Introduction to SDN and NFVCoreStack
 
Kubernetes Problem-Solving
Kubernetes Problem-SolvingKubernetes Problem-Solving
Kubernetes Problem-SolvingAll Things Open
 
Spring Boot Tutorial | Microservices Spring Boot | Microservices Architecture...
Spring Boot Tutorial | Microservices Spring Boot | Microservices Architecture...Spring Boot Tutorial | Microservices Spring Boot | Microservices Architecture...
Spring Boot Tutorial | Microservices Spring Boot | Microservices Architecture...Edureka!
 
Cisco Internet of Things
Cisco Internet of ThingsCisco Internet of Things
Cisco Internet of ThingsPanduit
 
MQTT - REST Bridge using the Smart Object API
MQTT - REST Bridge using the Smart Object APIMQTT - REST Bridge using the Smart Object API
MQTT - REST Bridge using the Smart Object APIMichael Koster
 
IOT PROTOCOLS.pptx
IOT PROTOCOLS.pptxIOT PROTOCOLS.pptx
IOT PROTOCOLS.pptxDRREC
 
6-IoT protocol.pptx
6-IoT protocol.pptx6-IoT protocol.pptx
6-IoT protocol.pptxPratik Gohel
 
Chapter 5 IoT Design methodologies
Chapter 5 IoT Design methodologiesChapter 5 IoT Design methodologies
Chapter 5 IoT Design methodologiespavan penugonda
 

Tendances (20)

SDN( Software Defined Network) and NFV(Network Function Virtualization) for I...
SDN( Software Defined Network) and NFV(Network Function Virtualization) for I...SDN( Software Defined Network) and NFV(Network Function Virtualization) for I...
SDN( Software Defined Network) and NFV(Network Function Virtualization) for I...
 
LoRaWAN in Depth
LoRaWAN in DepthLoRaWAN in Depth
LoRaWAN in Depth
 
IoT Communication Protocols
IoT Communication ProtocolsIoT Communication Protocols
IoT Communication Protocols
 
Introduction to Spark Streaming & Apache Kafka | Big Data Hadoop Spark Tutori...
Introduction to Spark Streaming & Apache Kafka | Big Data Hadoop Spark Tutori...Introduction to Spark Streaming & Apache Kafka | Big Data Hadoop Spark Tutori...
Introduction to Spark Streaming & Apache Kafka | Big Data Hadoop Spark Tutori...
 
A Modern C++ Kafka API | Kenneth Jia, Morgan Stanley
A Modern C++ Kafka API | Kenneth Jia, Morgan StanleyA Modern C++ Kafka API | Kenneth Jia, Morgan Stanley
A Modern C++ Kafka API | Kenneth Jia, Morgan Stanley
 
Bringing API Management to AWS Powered Backends
Bringing API Management to AWS Powered BackendsBringing API Management to AWS Powered Backends
Bringing API Management to AWS Powered Backends
 
Introduction to SDN and NFV
Introduction to SDN and NFVIntroduction to SDN and NFV
Introduction to SDN and NFV
 
Kubernetes Problem-Solving
Kubernetes Problem-SolvingKubernetes Problem-Solving
Kubernetes Problem-Solving
 
Spring Boot Tutorial | Microservices Spring Boot | Microservices Architecture...
Spring Boot Tutorial | Microservices Spring Boot | Microservices Architecture...Spring Boot Tutorial | Microservices Spring Boot | Microservices Architecture...
Spring Boot Tutorial | Microservices Spring Boot | Microservices Architecture...
 
Iot data analytics
Iot data analyticsIot data analytics
Iot data analytics
 
An introduction to MQTT
An introduction to MQTTAn introduction to MQTT
An introduction to MQTT
 
Introduction to Software Defined Networking (SDN)
Introduction to Software Defined Networking (SDN)Introduction to Software Defined Networking (SDN)
Introduction to Software Defined Networking (SDN)
 
Cisco Internet of Things
Cisco Internet of ThingsCisco Internet of Things
Cisco Internet of Things
 
MQTT - REST Bridge using the Smart Object API
MQTT - REST Bridge using the Smart Object APIMQTT - REST Bridge using the Smart Object API
MQTT - REST Bridge using the Smart Object API
 
IOT PROTOCOLS.pptx
IOT PROTOCOLS.pptxIOT PROTOCOLS.pptx
IOT PROTOCOLS.pptx
 
Fog Computing
Fog ComputingFog Computing
Fog Computing
 
6-IoT protocol.pptx
6-IoT protocol.pptx6-IoT protocol.pptx
6-IoT protocol.pptx
 
Sophos XG Firewall
Sophos XG FirewallSophos XG Firewall
Sophos XG Firewall
 
Chapter 8
Chapter 8Chapter 8
Chapter 8
 
Chapter 5 IoT Design methodologies
Chapter 5 IoT Design methodologiesChapter 5 IoT Design methodologies
Chapter 5 IoT Design methodologies
 

En vedette

Ietf91 ad hoc-coap-lwm2m-ipso
Ietf91 ad hoc-coap-lwm2m-ipsoIetf91 ad hoc-coap-lwm2m-ipso
Ietf91 ad hoc-coap-lwm2m-ipsoMichael Koster
 
A Modular Open Source Platform for Web Scale IoT Interoperability
A Modular Open Source Platform for Web Scale IoT InteroperabilityA Modular Open Source Platform for Web Scale IoT Interoperability
A Modular Open Source Platform for Web Scale IoT InteroperabilityMichael Koster
 
Hypermedia System Architecture for a Web of Things
Hypermedia System Architecture for a Web of ThingsHypermedia System Architecture for a Web of Things
Hypermedia System Architecture for a Web of ThingsMichael Koster
 
Personal Agency on the IoT
Personal Agency on the IoTPersonal Agency on the IoT
Personal Agency on the IoTMichael Koster
 
Open Horizontal Platform - Web Scale Interoperability for IoT - CCNA 2013
Open Horizontal Platform - Web Scale Interoperability for IoT - CCNA 2013Open Horizontal Platform - Web Scale Interoperability for IoT - CCNA 2013
Open Horizontal Platform - Web Scale Interoperability for IoT - CCNA 2013Michael Koster
 
Research Topics in Machine Hypermedia
Research Topics in Machine HypermediaResearch Topics in Machine Hypermedia
Research Topics in Machine HypermediaMichael Koster
 
MQTT-REST Bridge using the Smart Object API
MQTT-REST Bridge using the Smart Object APIMQTT-REST Bridge using the Smart Object API
MQTT-REST Bridge using the Smart Object APIMichael Koster
 
Tools for the Open Source Internet Of Things
Tools for the Open Source Internet Of ThingsTools for the Open Source Internet Of Things
Tools for the Open Source Internet Of ThingsMichael Koster
 
Restful Asynchronous Notification
Restful Asynchronous NotificationRestful Asynchronous Notification
Restful Asynchronous NotificationMichael Koster
 
IoT Toolkit and the Smart Object API - Architecture for Interoperability
IoT Toolkit and the Smart Object API - Architecture for InteroperabilityIoT Toolkit and the Smart Object API - Architecture for Interoperability
IoT Toolkit and the Smart Object API - Architecture for InteroperabilityMichael Koster
 
IoT Toolkit and Smart Object API Tutorial Introduction
IoT Toolkit and Smart Object API Tutorial IntroductionIoT Toolkit and Smart Object API Tutorial Introduction
IoT Toolkit and Smart Object API Tutorial IntroductionMichael Koster
 
Open Standards for IoT- GSC Workshop on IoT Atlanta 2013
Open Standards for IoT- GSC Workshop on IoT Atlanta 2013Open Standards for IoT- GSC Workshop on IoT Atlanta 2013
Open Standards for IoT- GSC Workshop on IoT Atlanta 2013Michael Koster
 
The Network Effect - Open Source and the Internet Of Things - Helsinki 2013 K...
The Network Effect - Open Source and the Internet Of Things - Helsinki 2013 K...The Network Effect - Open Source and the Internet Of Things - Helsinki 2013 K...
The Network Effect - Open Source and the Internet Of Things - Helsinki 2013 K...Michael Koster
 
Ietf91 ad hoc-coap-lwm2m-ipso
Ietf91 ad hoc-coap-lwm2m-ipsoIetf91 ad hoc-coap-lwm2m-ipso
Ietf91 ad hoc-coap-lwm2m-ipsoMichael Koster
 
M2M Protocol Interoperability using IoT Toolkit
M2M Protocol Interoperability using IoT ToolkitM2M Protocol Interoperability using IoT Toolkit
M2M Protocol Interoperability using IoT ToolkitMichael Koster
 

En vedette (17)

Ietf91 ad hoc-coap-lwm2m-ipso
Ietf91 ad hoc-coap-lwm2m-ipsoIetf91 ad hoc-coap-lwm2m-ipso
Ietf91 ad hoc-coap-lwm2m-ipso
 
A Modular Open Source Platform for Web Scale IoT Interoperability
A Modular Open Source Platform for Web Scale IoT InteroperabilityA Modular Open Source Platform for Web Scale IoT Interoperability
A Modular Open Source Platform for Web Scale IoT Interoperability
 
Hypermedia System Architecture for a Web of Things
Hypermedia System Architecture for a Web of ThingsHypermedia System Architecture for a Web of Things
Hypermedia System Architecture for a Web of Things
 
Personal Agency on the IoT
Personal Agency on the IoTPersonal Agency on the IoT
Personal Agency on the IoT
 
Open Horizontal Platform - Web Scale Interoperability for IoT - CCNA 2013
Open Horizontal Platform - Web Scale Interoperability for IoT - CCNA 2013Open Horizontal Platform - Web Scale Interoperability for IoT - CCNA 2013
Open Horizontal Platform - Web Scale Interoperability for IoT - CCNA 2013
 
Research Topics in Machine Hypermedia
Research Topics in Machine HypermediaResearch Topics in Machine Hypermedia
Research Topics in Machine Hypermedia
 
MQTT-REST Bridge using the Smart Object API
MQTT-REST Bridge using the Smart Object APIMQTT-REST Bridge using the Smart Object API
MQTT-REST Bridge using the Smart Object API
 
Tools for the Open Source Internet Of Things
Tools for the Open Source Internet Of ThingsTools for the Open Source Internet Of Things
Tools for the Open Source Internet Of Things
 
Restful Asynchronous Notification
Restful Asynchronous NotificationRestful Asynchronous Notification
Restful Asynchronous Notification
 
IoT Toolkit and the Smart Object API - Architecture for Interoperability
IoT Toolkit and the Smart Object API - Architecture for InteroperabilityIoT Toolkit and the Smart Object API - Architecture for Interoperability
IoT Toolkit and the Smart Object API - Architecture for Interoperability
 
IoT Toolkit and Smart Object API Tutorial Introduction
IoT Toolkit and Smart Object API Tutorial IntroductionIoT Toolkit and Smart Object API Tutorial Introduction
IoT Toolkit and Smart Object API Tutorial Introduction
 
Design patternsforiot
Design patternsforiotDesign patternsforiot
Design patternsforiot
 
Open Standards for IoT- GSC Workshop on IoT Atlanta 2013
Open Standards for IoT- GSC Workshop on IoT Atlanta 2013Open Standards for IoT- GSC Workshop on IoT Atlanta 2013
Open Standards for IoT- GSC Workshop on IoT Atlanta 2013
 
RESTful Notification
RESTful NotificationRESTful Notification
RESTful Notification
 
The Network Effect - Open Source and the Internet Of Things - Helsinki 2013 K...
The Network Effect - Open Source and the Internet Of Things - Helsinki 2013 K...The Network Effect - Open Source and the Internet Of Things - Helsinki 2013 K...
The Network Effect - Open Source and the Internet Of Things - Helsinki 2013 K...
 
Ietf91 ad hoc-coap-lwm2m-ipso
Ietf91 ad hoc-coap-lwm2m-ipsoIetf91 ad hoc-coap-lwm2m-ipso
Ietf91 ad hoc-coap-lwm2m-ipso
 
M2M Protocol Interoperability using IoT Toolkit
M2M Protocol Interoperability using IoT ToolkitM2M Protocol Interoperability using IoT Toolkit
M2M Protocol Interoperability using IoT Toolkit
 

Similaire à REST APIs for Connecting IoT Devices and Web Apps

Hypermedia for Machine APIs
Hypermedia for Machine APIsHypermedia for Machine APIs
Hypermedia for Machine APIsMichael Koster
 
Web of Things to the edge
Web of Things to the edgeWeb of Things to the edge
Web of Things to the edgeMichael Koster
 
Arabidopsis Information Portal, Developer Workshop 2014, Introduction
Arabidopsis Information Portal, Developer Workshop 2014, IntroductionArabidopsis Information Portal, Developer Workshop 2014, Introduction
Arabidopsis Information Portal, Developer Workshop 2014, IntroductionJasonRafeMiller
 
IP based standards for IoT
IP based standards for IoTIP based standards for IoT
IP based standards for IoTMichael Koster
 
RESTful Web Service using Swagger
RESTful Web Service using SwaggerRESTful Web Service using Swagger
RESTful Web Service using SwaggerHong-Jhih Lin
 
M2M Protocol Interoperability using IoT Toolkit
M2M Protocol Interoperability using IoT ToolkitM2M Protocol Interoperability using IoT Toolkit
M2M Protocol Interoperability using IoT ToolkitMichael Koster
 
Object models for interoperability
Object models for interoperabilityObject models for interoperability
Object models for interoperabilityMichael Koster
 
(ATS6-PLAT04) Query service
(ATS6-PLAT04) Query service (ATS6-PLAT04) Query service
(ATS6-PLAT04) Query service BIOVIA
 
Arabidopsis Information Portal overview from Plant Biology Europe 2014
Arabidopsis Information Portal overview from Plant Biology Europe 2014Arabidopsis Information Portal overview from Plant Biology Europe 2014
Arabidopsis Information Portal overview from Plant Biology Europe 2014Matthew Vaughn
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiTiago Knoch
 
web connectivity in IoT
web connectivity in IoTweb connectivity in IoT
web connectivity in IoTFabMinds
 
Web of things introduction
Web of things introductionWeb of things introduction
Web of things introduction承翰 蔡
 
Resting on your laurels will get you powned
Resting on your laurels will get you pownedResting on your laurels will get you powned
Resting on your laurels will get you pownedDinis Cruz
 
Together Cheerfully to Walk with Hypermedia
Together Cheerfully to Walk with HypermediaTogether Cheerfully to Walk with Hypermedia
Together Cheerfully to Walk with HypermediaVladimir Tsukur
 
IoT Toolkit and the Smart Object API - Architecture for Interoperability
IoT Toolkit and the Smart Object API - Architecture for InteroperabilityIoT Toolkit and the Smart Object API - Architecture for Interoperability
IoT Toolkit and the Smart Object API - Architecture for InteroperabilityMichael Koster
 
Iot Toolkit and the Smart Object API - Architecture for Interoperability
Iot Toolkit and the Smart Object API - Architecture for InteroperabilityIot Toolkit and the Smart Object API - Architecture for Interoperability
Iot Toolkit and the Smart Object API - Architecture for InteroperabilityMichael Koster
 
Ladies Be Architects - Integration - Multi-Org, Security, JSON, Backup & Restore
Ladies Be Architects - Integration - Multi-Org, Security, JSON, Backup & RestoreLadies Be Architects - Integration - Multi-Org, Security, JSON, Backup & Restore
Ladies Be Architects - Integration - Multi-Org, Security, JSON, Backup & Restoregemziebeth
 

Similaire à REST APIs for Connecting IoT Devices and Web Apps (20)

Hypermedia for Machine APIs
Hypermedia for Machine APIsHypermedia for Machine APIs
Hypermedia for Machine APIs
 
Web of Things to the edge
Web of Things to the edgeWeb of Things to the edge
Web of Things to the edge
 
Ipso eclipse-summary
Ipso eclipse-summaryIpso eclipse-summary
Ipso eclipse-summary
 
Arabidopsis Information Portal, Developer Workshop 2014, Introduction
Arabidopsis Information Portal, Developer Workshop 2014, IntroductionArabidopsis Information Portal, Developer Workshop 2014, Introduction
Arabidopsis Information Portal, Developer Workshop 2014, Introduction
 
IP based standards for IoT
IP based standards for IoTIP based standards for IoT
IP based standards for IoT
 
RESTful Web Service using Swagger
RESTful Web Service using SwaggerRESTful Web Service using Swagger
RESTful Web Service using Swagger
 
M2M Protocol Interoperability using IoT Toolkit
M2M Protocol Interoperability using IoT ToolkitM2M Protocol Interoperability using IoT Toolkit
M2M Protocol Interoperability using IoT Toolkit
 
Object models for interoperability
Object models for interoperabilityObject models for interoperability
Object models for interoperability
 
(ATS6-PLAT04) Query service
(ATS6-PLAT04) Query service (ATS6-PLAT04) Query service
(ATS6-PLAT04) Query service
 
Arabidopsis Information Portal overview from Plant Biology Europe 2014
Arabidopsis Information Portal overview from Plant Biology Europe 2014Arabidopsis Information Portal overview from Plant Biology Europe 2014
Arabidopsis Information Portal overview from Plant Biology Europe 2014
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web api
 
web connectivity in IoT
web connectivity in IoTweb connectivity in IoT
web connectivity in IoT
 
Web of things introduction
Web of things introductionWeb of things introduction
Web of things introduction
 
Resting on your laurels will get you powned
Resting on your laurels will get you pownedResting on your laurels will get you powned
Resting on your laurels will get you powned
 
Together Cheerfully to Walk with Hypermedia
Together Cheerfully to Walk with HypermediaTogether Cheerfully to Walk with Hypermedia
Together Cheerfully to Walk with Hypermedia
 
IoT Toolkit and the Smart Object API - Architecture for Interoperability
IoT Toolkit and the Smart Object API - Architecture for InteroperabilityIoT Toolkit and the Smart Object API - Architecture for Interoperability
IoT Toolkit and the Smart Object API - Architecture for Interoperability
 
Iot Toolkit and the Smart Object API - Architecture for Interoperability
Iot Toolkit and the Smart Object API - Architecture for InteroperabilityIot Toolkit and the Smart Object API - Architecture for Interoperability
Iot Toolkit and the Smart Object API - Architecture for Interoperability
 
APITalkMeetupSharable
APITalkMeetupSharableAPITalkMeetupSharable
APITalkMeetupSharable
 
Ladies Be Architects - Integration - Multi-Org, Security, JSON, Backup & Restore
Ladies Be Architects - Integration - Multi-Org, Security, JSON, Backup & RestoreLadies Be Architects - Integration - Multi-Org, Security, JSON, Backup & Restore
Ladies Be Architects - Integration - Multi-Org, Security, JSON, Backup & Restore
 
Coinage
CoinageCoinage
Coinage
 

Dernier

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 

Dernier (20)

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 

REST APIs for Connecting IoT Devices and Web Apps

  • 1. REST  APIs     for  the     Internet  Of  Things   Michael  J  Koster   Open  Source  Internet  Of  Things   Meetup  19  March  2014  
  • 2. Resource  oriented  API   •  Resource  ==  web  resource  (URI)   •  Resources  change  state  in  response  to  what  is   being  sensed   •  Actuator  changes  state  in  response  to  web   resource  update   •  Abstract  data  sources  and  sinks   •  REST  API  has  2  important  characterisJcs  for   IoT  use  case…  
  • 3. RepresentaJonal  State  Transfer   •  Resource  interacJon  through  exchange  of   representaJon  of  resource  state   •  E.g.  a  representaJon  of  the  state  of  a   temperature  sensor  might  be  “63.6”     •  Convenient  for  applicaJon  soTware  to  use   read/write  semanJcs  to  interact  with   resources   •  Stateful  resource  representaJons  =>  Stateless   applicaJon  soTware  
  • 4. Based  on  Hypermedia   •  Use  of  web  links  to  locate  resources  of   interest   •  IoT  needs  machine-­‐readable  links  that  enable   applicaJon  soTware  to  discover  things  of   interest   •  Subset  of  web  linking,  semanJc  web  using   relaJon/aribute   •  Links  encode  metadata  about  the  resource,   e.g.  type=‘temperature’,  ct=‘applicaJon/json’  
  • 5. Web  Linking  for  IoT   •  Links  are  managed  in  2  ways   •  Object  encapsulaJon:  self-­‐describing  objects   have  links  associated  with  endpoint,  e.g.  ./ well-­‐known/core   •  Resource  Directory:  Directories  and  Catalogs   of  links,  stored  at  well-­‐known  locaJons,  that   point  to  resources  and  to  other  catalogs  
  • 6. Web  Linking  for  IoT   •  Links  can  be  registered  with  a  Resource  Directory   when  sensors  are  brought  online   •  A  crawler  can  discover  links  at  ./well-­‐known/core   locaJons  and  populate  catalogs   •  ApplicaJon  soTware  can  discover  resources  by   aribute,  e.g.  query  using  type=‘temperature’,   units=‘celsius’,  locaJon=‘outdoor’  etc.     •  System  returns  a  set  of  links  matching  the  query   aributes  
  • 7. CoAP   •  Part  of  IPV6  for  Constrained  Resource   Environments  (CoRE)   •  IoT  oriented  REST  API  mapped  to  an  efficient   binary  protocol   •  End  devices  can  have  both  client  and  server   roles,  can  also  communicate  directly   •  Resource  representaJon  e.g.  ‘applicaJon/ json’,  is  negoJated  as  in  hp  protocol  
  • 8. CoAP   •  Observe  opJon  for  long-­‐term  event  stream   response  to  GET,  asynchronous  updates   •  Web  linking  using  IETF  standard  core-­‐link-­‐ format  (RFC  6690)   •  Resource  discovery  using  ./well-­‐known/core   or  external  Resource  Directory    
  • 9. HTTP/REST   •  HTTP  and  REST  is  useful  for  most  web   applicaJons,  services,  and  gateways   •  Uses  web  callbacks,  websockets,  HTTP  PUT  for   asynchronous  updates   •  Links  in  JSON,  Link-­‐format,  Hypercat,  linked   data   •  Well  defined  CoAP-­‐to-­‐HTTP  proxy  paerns,   standard  middleware  
  • 10. Hybrid  system   •  It’s  possible  to  use  REST  for  resource  discovery   and  other  stateful  interacJons,  and  messaging   e.g.  MQTT  for  asynchronous  updates   •  Various  methods  to  bind  message  endpoints   to  REST  resources   •  ApplicaJon  soTware  can  easily  use  both  REST   API  and  event  handler  interfaces  like   onUpdate   •  IoT  Toolkit  uses  observers  to  bind    
  • 11. Standards  and  SoTware   •  CoAP     hps://datatracker.iel.org/doc/draT-­‐iel-­‐core-­‐coap/   •  CoRE  link-­‐format   hp://tools.iel.org/html/rfc6690   •  CoRE  Observe   hps://datatracker.iel.org/doc/draT-­‐iel-­‐core-­‐observe/   •  CoRE  Resource  Directory   hps://tools.iel.org/html/draT-­‐iel-­‐core-­‐resource-­‐directory-­‐00   •  Hypercat   hp://wiki.1248.io/doku.php?id=hypercat  
  • 12. IoT  Toolkit  Interoperability  Demo   smartobjectservice.com   Node-­‐RED   Node-­‐RED  
  • 13. MQTT  Observer   MQTT  Broker   REST  Endpoint   ObservableProperty   mqObserver   PUT   GET   Publish  from   data  producer   Publish  From   REST  API   Publish  to  Other   Subscribers   SUB   Publish  to   REST  API     Connects  REST  Resource  to  MQTT  Topic   Publish  and  Subscribe  
  • 14. MQTT  Observer   MQTT  Broker   REST  Endpoint   ObservableProperty   mqObserver   PUT   GET   Publish  from   data  producer   Publish  From   REST  API   Publish  to  Other   Subscribers   SUB   Publish  to   REST  API     Publisher     Publishes  REST  Resource  updates  to  the  broker  
  • 15. MQTT  Observer   MQTT  Broker   REST  Endpoint   ObservableProperty   mqObserver   PUT   GET   Publish  from   data  producer   Publish  From   REST  API   Publish  to  Other   Subscribers   SUB   Publish  to   REST  API     Subscriber     Makes  last  published  data  available  at  the  REST  endpoint  
  • 16. MQTT  Observer   MQTT  Broker   REST  Endpoint   ObservableProperty   mqObserver   PUT   GET   Publish  from   data  producer   Publish  From   REST  API   Publish  to  Other   Subscribers   SUB   Publish  to   REST  API     Pub+Sub   Repeats  data  updates  in  both  direcJons  
  • 17. MQTT  Bridge  to  mulJple  REST  endpoints     MQTT  Broker   REST  Endpoint   ObservableProperty   mqObserver   PUT   GET   Publish  from   data  producer   Publish  to  Other   Subscribers   REST  Endpoint   ObservableProperty   mqObserver   PUT   GET