SlideShare ist ein Scribd-Unternehmen logo
1 von 17
Downloaden Sie, um offline zu lesen
RESTful Web Services
    in Drupal 7
RESTful Web Services in Drupal 7



‣ Web Services introduction
‣   Why REST?
‣   The Bricks: Drupal 7, Entity API, RESTful Web Services
‣   Connector (REST client)
‣   Let’s go coding...
‣   Case Study
‣   Questions?
Web services




                 SOAP,
  Service      XML-RPC,
                              Service
 Requester     REST, etc...   Provider
Web services with Drupal




                      REST
  Service                    Service
 Requester                   Provider
Why REST?


‣   Use standard HTTP (simple client and simple API)

‣   Multiple data formats (JSON, XML, etc...)

‣   Performance and scalability (Cacheable)
The bricks




   Connector   REST   RESTws

    Drupal 6
        or            Entity API
    Drupal 7
    Service           Drupal 7
   Requester
                      Service
                      Provider
Entity API

This module extends the entity API of Drupal
core in order to provide a unified way to
deal with entities and their properties.

Additionally, it provides an entity CRUD
controller, which helps simplifying the
creation of new entity types.

http://drupal.org/project/entity
RESTful Web Services
Exposes Drupal resources (e.g. entities) as RESTful web services.
‣ Provides only RESTful services.
‣ Builds upon the Entity API, to provide support for all entity types out of the
box.
‣ Currently only CRUD operations supported
‣ Currently JSON, XML and RDF/XML are available out of the box.
‣ There are no "service endpoints" to configure as resources are just available
at uniform paths like "node/1", "user/1".




http://drupal.org/project/restws
RESTful Web Services: Test it!


To obtain the JSON representation of an entity use your
browser to visit:

http://yoursite.com/node/1.json or
http://yoursite.com/user/1.json or
http://yoursite.com/<entity type name>/<entity id>.json
Note: The module will respect your access permissions, so make sure you are logged in.
RESTful Web Services: CRUD
Supports full CRUD (Create, Read, Update, Delete) for resources:
‣   Create: HTTP PUT /<entity type name>
    (requires HTTP Content-Type header set to the MIME type of <format>)
‣   Read: HTTP GET /<entity type name>/<entity id>.<format>
    or HTTP GET /<entity type name>/<entity id>
  (requires HTTP Accept header set to the MIME type of <format>)
‣ Update: HTTP POST /<entity type name>/<entity id>.<format>
 or HTTP POST /<entity type name>/<entity id>
  (requires HTTP Content-Type header set to the MIME type of the posted format)
‣ Delete: HTTP DELETE /<entity type name>/<entity id>


Note: The representation <format> can be json, xml etc.
RESTful Web Services: Auth and Perms

               can be achieved via separate modules, maybe making use of
‣ Authentication
the standard Drupal cookie and session handling.

‣ The module comes with an optional HTTP Basic Authentication module
(restws_auth_basic) that performs a user login with the credentials provided
via the usual HTTP headers.

‣ Theusual Drupal permission system is respected, thus permissions are
checked for the logged in user account of the received requests.
Connector: REST Client
Connector: Example (webform hook)
Connector: Example (response)
Case Study




                 REST

  Pamm Travel             Tikal
    (Drupal 6)          (Drupal 7)

    Service             Service
   Requester            Provider
Case Study




                 REST

    Intersos              Tikal
    (Drupal 6)          (Drupal 7)

    Service             Service
   Requester            Provider
Questions?
                          http://bmeme.com




   Luca Corbo (lucor)                          Daniele Piaggesi (g0blin)
luca.corbo@bmeme.com                         daniele.piaggesi@bmeme.com
       @lucacorbo                                      @g0blin79

Weitere ähnliche Inhalte

Was ist angesagt?

Use Node.js to create a REST API
Use Node.js to create a REST APIUse Node.js to create a REST API
Use Node.js to create a REST APIFabien Vauchelles
 
Angular 4 Tutorial | What's New In Angular 4 | Angular Training | Edureka
Angular 4 Tutorial | What's New In Angular 4 | Angular Training | EdurekaAngular 4 Tutorial | What's New In Angular 4 | Angular Training | Edureka
Angular 4 Tutorial | What's New In Angular 4 | Angular Training | EdurekaEdureka!
 
Graphql presentation
Graphql presentationGraphql presentation
Graphql presentationVibhor Grover
 
ES6 presentation
ES6 presentationES6 presentation
ES6 presentationritika1
 
Angular & RXJS: examples and use cases
Angular & RXJS: examples and use casesAngular & RXJS: examples and use cases
Angular & RXJS: examples and use casesFabio Biondi
 
ASP.NET Web API and HTTP Fundamentals
ASP.NET Web API and HTTP FundamentalsASP.NET Web API and HTTP Fundamentals
ASP.NET Web API and HTTP FundamentalsIdo Flatow
 
JPA and Hibernate Performance Tips
JPA and Hibernate Performance TipsJPA and Hibernate Performance Tips
JPA and Hibernate Performance TipsVlad Mihalcea
 
Angular 6 Form Validation with Material
Angular 6 Form Validation with MaterialAngular 6 Form Validation with Material
Angular 6 Form Validation with MaterialMalika Munaweera
 
Rest presentation
Rest  presentationRest  presentation
Rest presentationsrividhyau
 
Java Interview Questions
Java Interview QuestionsJava Interview Questions
Java Interview Questionssoniajessica2
 

Was ist angesagt? (20)

angular fundamentals.pdf
angular fundamentals.pdfangular fundamentals.pdf
angular fundamentals.pdf
 
Use Node.js to create a REST API
Use Node.js to create a REST APIUse Node.js to create a REST API
Use Node.js to create a REST API
 
Angular 4 Tutorial | What's New In Angular 4 | Angular Training | Edureka
Angular 4 Tutorial | What's New In Angular 4 | Angular Training | EdurekaAngular 4 Tutorial | What's New In Angular 4 | Angular Training | Edureka
Angular 4 Tutorial | What's New In Angular 4 | Angular Training | Edureka
 
Servlets
ServletsServlets
Servlets
 
Express node js
Express node jsExpress node js
Express node js
 
Flask
FlaskFlask
Flask
 
Rest API
Rest APIRest API
Rest API
 
Graphql presentation
Graphql presentationGraphql presentation
Graphql presentation
 
Retrofit
RetrofitRetrofit
Retrofit
 
Intro to GraphQL
 Intro to GraphQL Intro to GraphQL
Intro to GraphQL
 
ES6 presentation
ES6 presentationES6 presentation
ES6 presentation
 
Gradle Introduction
Gradle IntroductionGradle Introduction
Gradle Introduction
 
Introduction to GraphQL
Introduction to GraphQLIntroduction to GraphQL
Introduction to GraphQL
 
Angular & RXJS: examples and use cases
Angular & RXJS: examples and use casesAngular & RXJS: examples and use cases
Angular & RXJS: examples and use cases
 
ASP.NET Web API and HTTP Fundamentals
ASP.NET Web API and HTTP FundamentalsASP.NET Web API and HTTP Fundamentals
ASP.NET Web API and HTTP Fundamentals
 
JPA and Hibernate Performance Tips
JPA and Hibernate Performance TipsJPA and Hibernate Performance Tips
JPA and Hibernate Performance Tips
 
Angular 6 Form Validation with Material
Angular 6 Form Validation with MaterialAngular 6 Form Validation with Material
Angular 6 Form Validation with Material
 
Rest presentation
Rest  presentationRest  presentation
Rest presentation
 
GraphQL
GraphQLGraphQL
GraphQL
 
Java Interview Questions
Java Interview QuestionsJava Interview Questions
Java Interview Questions
 

Ähnlich wie RESTful Web Services in Drupal7

RestFul Web Services In Drupal 8
RestFul Web Services In Drupal 8RestFul Web Services In Drupal 8
RestFul Web Services In Drupal 8Gajendra Sharma
 
RESTful application with Drupal 8
RESTful application with Drupal 8RESTful application with Drupal 8
RESTful application with Drupal 8Patrick Morin
 
ADO.NET Data Services
ADO.NET Data ServicesADO.NET Data Services
ADO.NET Data Servicesukdpe
 
Building RESTful Applications with OData
Building RESTful Applications with ODataBuilding RESTful Applications with OData
Building RESTful Applications with ODataTodd Anglin
 
Pinterest like site using REST and Bottle
Pinterest like site using REST and Bottle Pinterest like site using REST and Bottle
Pinterest like site using REST and Bottle Gaurav Bhardwaj
 
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 Services PHP Tutorial
Web Services PHP TutorialWeb Services PHP Tutorial
Web Services PHP TutorialLorna Mitchell
 
Rest service in mule
Rest service in mule Rest service in mule
Rest service in mule Harish43
 
Restful web services rule financial
Restful web services   rule financialRestful web services   rule financial
Restful web services rule financialRule_Financial
 
Generating Unified APIs with Protocol Buffers and gRPC
Generating Unified APIs with Protocol Buffers and gRPCGenerating Unified APIs with Protocol Buffers and gRPC
Generating Unified APIs with Protocol Buffers and gRPCC4Media
 
Choisir entre une API RPC, SOAP, REST, GraphQL? 
Et si le problème était ai...
Choisir entre une API  RPC, SOAP, REST, GraphQL?  
Et si le problème était ai...Choisir entre une API  RPC, SOAP, REST, GraphQL?  
Et si le problème était ai...
Choisir entre une API RPC, SOAP, REST, GraphQL? 
Et si le problème était ai...François-Guillaume Ribreau
 
Drupal South 2015: Introduction to Web Services. Services in Drupal 8.
Drupal South 2015: Introduction to Web Services.  Services in Drupal 8.Drupal South 2015: Introduction to Web Services.  Services in Drupal 8.
Drupal South 2015: Introduction to Web Services. Services in Drupal 8.TechnocratAu
 
RESTful applications: The why and how by Maikel Mardjan
RESTful applications: The why and how by Maikel MardjanRESTful applications: The why and how by Maikel Mardjan
RESTful applications: The why and how by Maikel MardjanJexia
 

Ähnlich wie RESTful Web Services in Drupal7 (20)

RestFul Web Services In Drupal 8
RestFul Web Services In Drupal 8RestFul Web Services In Drupal 8
RestFul Web Services In Drupal 8
 
RESTful application with Drupal 8
RESTful application with Drupal 8RESTful application with Drupal 8
RESTful application with Drupal 8
 
ADO.NET Data Services
ADO.NET Data ServicesADO.NET Data Services
ADO.NET Data Services
 
Building RESTful Applications with OData
Building RESTful Applications with ODataBuilding RESTful Applications with OData
Building RESTful Applications with OData
 
Pinterest like site using REST and Bottle
Pinterest like site using REST and Bottle Pinterest like site using REST and Bottle
Pinterest like site using REST and Bottle
 
REST in Peace
REST in PeaceREST in Peace
REST in Peace
 
ASP.NET Mvc 4 web api
ASP.NET Mvc 4 web apiASP.NET Mvc 4 web api
ASP.NET Mvc 4 web api
 
Web Services PHP Tutorial
Web Services PHP TutorialWeb Services PHP Tutorial
Web Services PHP Tutorial
 
Drupalcon Mumbai
Drupalcon MumbaiDrupalcon Mumbai
Drupalcon Mumbai
 
Rest service in mule
Rest service in mule Rest service in mule
Rest service in mule
 
Web Services Tutorial
Web Services TutorialWeb Services Tutorial
Web Services Tutorial
 
Rest Service In Mule
Rest Service In Mule Rest Service In Mule
Rest Service In Mule
 
Restful web services rule financial
Restful web services   rule financialRestful web services   rule financial
Restful web services rule financial
 
Generating Unified APIs with Protocol Buffers and gRPC
Generating Unified APIs with Protocol Buffers and gRPCGenerating Unified APIs with Protocol Buffers and gRPC
Generating Unified APIs with Protocol Buffers and gRPC
 
Web services tutorial
Web services tutorialWeb services tutorial
Web services tutorial
 
Talking to Web Services
Talking to Web ServicesTalking to Web Services
Talking to Web Services
 
Choisir entre une API RPC, SOAP, REST, GraphQL? 
Et si le problème était ai...
Choisir entre une API  RPC, SOAP, REST, GraphQL?  
Et si le problème était ai...Choisir entre une API  RPC, SOAP, REST, GraphQL?  
Et si le problème était ai...
Choisir entre une API RPC, SOAP, REST, GraphQL? 
Et si le problème était ai...
 
Drupal South 2015: Introduction to Web Services. Services in Drupal 8.
Drupal South 2015: Introduction to Web Services.  Services in Drupal 8.Drupal South 2015: Introduction to Web Services.  Services in Drupal 8.
Drupal South 2015: Introduction to Web Services. Services in Drupal 8.
 
Switch to Backend 2023
Switch to Backend 2023Switch to Backend 2023
Switch to Backend 2023
 
RESTful applications: The why and how by Maikel Mardjan
RESTful applications: The why and how by Maikel MardjanRESTful applications: The why and how by Maikel Mardjan
RESTful applications: The why and how by Maikel Mardjan
 

Mehr von bmeme

Speed up your Drupal instance!!
Speed up your Drupal instance!!Speed up your Drupal instance!!
Speed up your Drupal instance!!bmeme
 
Drupal 4 stakeholder
Drupal 4 stakeholderDrupal 4 stakeholder
Drupal 4 stakeholderbmeme
 
"Twig e i belli dentro": panoramica sui nuovi standard di frontend-developmen...
"Twig e i belli dentro": panoramica sui nuovi standard di frontend-developmen..."Twig e i belli dentro": panoramica sui nuovi standard di frontend-developmen...
"Twig e i belli dentro": panoramica sui nuovi standard di frontend-developmen...bmeme
 
Sviluppo Code-driven e riusabilità del codice: CMI e Features per D8
Sviluppo Code-driven e riusabilità del codice: CMI e Features per D8Sviluppo Code-driven e riusabilità del codice: CMI e Features per D8
Sviluppo Code-driven e riusabilità del codice: CMI e Features per D8bmeme
 
La piattaforma web di CNA: Istanze Drupal replicabili integrate con Alfresco ...
La piattaforma web di CNA: Istanze Drupal replicabili integrate con Alfresco ...La piattaforma web di CNA: Istanze Drupal replicabili integrate con Alfresco ...
La piattaforma web di CNA: Istanze Drupal replicabili integrate con Alfresco ...bmeme
 
"Eventum project" - A Drupal platform for managing events and conferences
"Eventum project" - A Drupal platform for managing  events and conferences"Eventum project" - A Drupal platform for managing  events and conferences
"Eventum project" - A Drupal platform for managing events and conferencesbmeme
 
Features in love
Features in loveFeatures in love
Features in lovebmeme
 

Mehr von bmeme (7)

Speed up your Drupal instance!!
Speed up your Drupal instance!!Speed up your Drupal instance!!
Speed up your Drupal instance!!
 
Drupal 4 stakeholder
Drupal 4 stakeholderDrupal 4 stakeholder
Drupal 4 stakeholder
 
"Twig e i belli dentro": panoramica sui nuovi standard di frontend-developmen...
"Twig e i belli dentro": panoramica sui nuovi standard di frontend-developmen..."Twig e i belli dentro": panoramica sui nuovi standard di frontend-developmen...
"Twig e i belli dentro": panoramica sui nuovi standard di frontend-developmen...
 
Sviluppo Code-driven e riusabilità del codice: CMI e Features per D8
Sviluppo Code-driven e riusabilità del codice: CMI e Features per D8Sviluppo Code-driven e riusabilità del codice: CMI e Features per D8
Sviluppo Code-driven e riusabilità del codice: CMI e Features per D8
 
La piattaforma web di CNA: Istanze Drupal replicabili integrate con Alfresco ...
La piattaforma web di CNA: Istanze Drupal replicabili integrate con Alfresco ...La piattaforma web di CNA: Istanze Drupal replicabili integrate con Alfresco ...
La piattaforma web di CNA: Istanze Drupal replicabili integrate con Alfresco ...
 
"Eventum project" - A Drupal platform for managing events and conferences
"Eventum project" - A Drupal platform for managing  events and conferences"Eventum project" - A Drupal platform for managing  events and conferences
"Eventum project" - A Drupal platform for managing events and conferences
 
Features in love
Features in loveFeatures in love
Features in love
 

Kürzlich hochgeladen

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 

Kürzlich hochgeladen (20)

The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 

RESTful Web Services in Drupal7

  • 1. RESTful Web Services in Drupal 7
  • 2. RESTful Web Services in Drupal 7 ‣ Web Services introduction ‣ Why REST? ‣ The Bricks: Drupal 7, Entity API, RESTful Web Services ‣ Connector (REST client) ‣ Let’s go coding... ‣ Case Study ‣ Questions?
  • 3. Web services SOAP, Service XML-RPC, Service Requester REST, etc... Provider
  • 4. Web services with Drupal REST Service Service Requester Provider
  • 5. Why REST? ‣ Use standard HTTP (simple client and simple API) ‣ Multiple data formats (JSON, XML, etc...) ‣ Performance and scalability (Cacheable)
  • 6. The bricks Connector REST RESTws Drupal 6 or Entity API Drupal 7 Service Drupal 7 Requester Service Provider
  • 7. Entity API This module extends the entity API of Drupal core in order to provide a unified way to deal with entities and their properties. Additionally, it provides an entity CRUD controller, which helps simplifying the creation of new entity types. http://drupal.org/project/entity
  • 8. RESTful Web Services Exposes Drupal resources (e.g. entities) as RESTful web services. ‣ Provides only RESTful services. ‣ Builds upon the Entity API, to provide support for all entity types out of the box. ‣ Currently only CRUD operations supported ‣ Currently JSON, XML and RDF/XML are available out of the box. ‣ There are no "service endpoints" to configure as resources are just available at uniform paths like "node/1", "user/1". http://drupal.org/project/restws
  • 9. RESTful Web Services: Test it! To obtain the JSON representation of an entity use your browser to visit: http://yoursite.com/node/1.json or http://yoursite.com/user/1.json or http://yoursite.com/<entity type name>/<entity id>.json Note: The module will respect your access permissions, so make sure you are logged in.
  • 10. RESTful Web Services: CRUD Supports full CRUD (Create, Read, Update, Delete) for resources: ‣ Create: HTTP PUT /<entity type name> (requires HTTP Content-Type header set to the MIME type of <format>) ‣ Read: HTTP GET /<entity type name>/<entity id>.<format> or HTTP GET /<entity type name>/<entity id> (requires HTTP Accept header set to the MIME type of <format>) ‣ Update: HTTP POST /<entity type name>/<entity id>.<format> or HTTP POST /<entity type name>/<entity id> (requires HTTP Content-Type header set to the MIME type of the posted format) ‣ Delete: HTTP DELETE /<entity type name>/<entity id> Note: The representation <format> can be json, xml etc.
  • 11. RESTful Web Services: Auth and Perms can be achieved via separate modules, maybe making use of ‣ Authentication the standard Drupal cookie and session handling. ‣ The module comes with an optional HTTP Basic Authentication module (restws_auth_basic) that performs a user login with the credentials provided via the usual HTTP headers. ‣ Theusual Drupal permission system is respected, thus permissions are checked for the logged in user account of the received requests.
  • 15. Case Study REST Pamm Travel Tikal (Drupal 6) (Drupal 7) Service Service Requester Provider
  • 16. Case Study REST Intersos Tikal (Drupal 6) (Drupal 7) Service Service Requester Provider
  • 17. Questions? http://bmeme.com Luca Corbo (lucor) Daniele Piaggesi (g0blin) luca.corbo@bmeme.com daniele.piaggesi@bmeme.com @lucacorbo @g0blin79