SlideShare une entreprise Scribd logo
1  sur  39
RESTful application with
Drupal 8
Concept / Overview / Demonstration / Happyness
Introduction
Digital agency established since
2008 in Mauritius
Recognized as one of the most
expert offshore web agencies in
Drupal
More than 150 projects in Drupal
Introduction
Technical Director at Esokia
10 years of experience in PHP
7 years of experience in Drupal
What is Drupal?
Free, community-built website development tool
Modular and extensible content management
Open source
Built on PHP
Created by Dries Buytaert
First release in January 2001
Drupal now
Drupal 8 released on November, 2015 (approx.)
Big architectural changes
Built with
About the
session
A little warm-up
An overview about Drupal 8 and this
new core capability to build RESTful
application. From a basic utilisation
to a more complexe use case, we
will made a global overview of
possible exploitation of Drupal 8
RESTful aspect.
Warm-up
Drupal 8 is the next main version of Drupal’s CMS, a quick overview and
presentation will be made for exposing the concept.
On the next topic, we will see what is REST and key concept about a RESTful
application, with basic exemple and application. A more advanced concept will
be see in the next topic, with a presentation about an utilisation of JavaScript to
use a Drupal 8 RESTful application and a more complex example with a
NodeJS / ExpressJS application.
RESTful?
REpresentational
State
Transfert
An application that implements the
REST architectural style is called a
RESTful application
REST Principle
Communicate over HTTP protocol
using HTTP verbs that web browsers
use between client and server
GET
PUT
DELETE
POST
PATCH
etc
REST Implementation - Two ways
GET → Retreive something
POST → Create something
DELETE → Delete something
PATCH → Update something
GET → Retrieve something
POST → Update something
DELETE → Delete something
PUT → Create something
What is REST in Drupal?
Make possible for other applications to read and update information on your
site via the Web.
REST is one of a number of different ways of making it available.
In contrast to other techniques such as SOAP or XML-RPC, REST encourages
developers to rely on HTTP methods (such as GET and POST) to operate on
"resources" (data managed by Drupal).
RESTful Web Service API
The RESTful Web Services API is new in Drupal 8.
For each REST resource, you can specify the supported verbs (i.e. GET,
POST…), and for each verb, you can specify the serialization formats &
authentication mechanisms.
In Drupal 8, there is a single central location to configure all REST resources
that a site exposes: rest.settings.yml.
A permission is generated for every resource + verb, users need this
permission to be able to interact with this REST resource.
GET
For reading content
entities.
Read-only method.
Considered as a safe method.
Results are automatically cached.
POST
For creating content
entities.
Some entities need a _links entry to
the user and / or to the referenced
entity.
Never POST a UUID (or node
ID/comment ID/…) as you create a
new entity.
Considered as an unsafe method.
Need a CSRF Token.
PATCH
For updading content
entities.
When PATCHing resources, only send
the changes.
Considered as an unsafe method.
Need a CSRF Token.
DELETE
For deleting content
entities.
Content-type header not necessary (no
request body).
Considered as an unsafe method.
Need a CSRF Token.
Basic Example
Read and write data from your Drupal installation with a couple of modules.
Requirements:
RESTful Web Services (rest)
Serialization (serialization)
Hypertext Application Language (hal)
HTTP Basic Authentication (basic_auth)
Core module to enable
REST UI interface
List of permissions for using REST
Basic example in action
Little
demonstration?
JS + D8 RESTful Web Services
Can be use with every kind of entities in Drupal 8 if they are exposed for REST.
Just implement an HTTP request and let’s go.
Easy to separate client and server.
Improve the client code’s portability.
Servers can be simpler and more scalable.
JQuery example
JQuery already loaded in Drupal
(JQuery 1.7)
Every Drupal 8 project can be easily
RESTful with client-server separation
GET / POST /PATCH / DELETE still
available
Advanced Example
Building a timesheet application in Drupal 8 with a separated front-end.
What we need?
A Drupal 8 installation with RESTful Web Services API
Something funny like NodeJS
ExpressJS or a similar framework
Requirements
LAMP Stack for the backend
Linux
Apache
MySQL
PHP
Requirements
MEAN Stack for the frontend
MongoDB
ExpressJS
AngularJS
NodeJS
Requirements
RESTful Web Services
Views
Field UI (nice to have)
REST UI (nice to have)
Drupal 8 installation
Live conding?
LAMP Stack
Be efficient: Google
Cloud + Bitnami is a good
combo! :-D
Good combo is a pre-installed
Drupal’s LAMP Stack.
MEAN Stack
Be efficient: Google
Cloud + Bitnami is a good
combo! :-D (really!)
NodeJS Locally
ExpressJS Locally
ExpressJS locally
Let’s try
Drupal:
● Content type
● Views
● Permissions
Remember to configure the
view for the REST Export!
Let’s try
ExpressJS
● Don’t forget to npm init before!
● And npm install express --save for dependencies
● You can add a template engine, add route with parameters, etc
Drupal <-> NodeJS
Need to install NPM Request
module
Load it in your Express App
Interact with Drupal!
Questions?
Thank you!

Contenu connexe

Tendances

Wordpress Custom Child theme
Wordpress Custom Child themeWordpress Custom Child theme
Wordpress Custom Child themeYouSaf HasSan
 
Drupal 8 and iOS - an Open Source App
Drupal 8 and iOS - an Open Source AppDrupal 8 and iOS - an Open Source App
Drupal 8 and iOS - an Open Source ApplittleMAS
 
Oracle SQLcl: Formatting your Query Results
Oracle SQLcl: Formatting your Query ResultsOracle SQLcl: Formatting your Query Results
Oracle SQLcl: Formatting your Query ResultsJeff Smith
 
Drupal 8 Deep Dive: Plugin System
Drupal 8 Deep Dive: Plugin SystemDrupal 8 Deep Dive: Plugin System
Drupal 8 Deep Dive: Plugin SystemAcquia
 
Getting started with DSpace 7 REST API
Getting started with DSpace 7 REST APIGetting started with DSpace 7 REST API
Getting started with DSpace 7 REST API4Science
 
Apache Hive authorization models
Apache Hive authorization modelsApache Hive authorization models
Apache Hive authorization modelsThejas Nair
 
Elements_Content_Model_Overview.pdf
Elements_Content_Model_Overview.pdfElements_Content_Model_Overview.pdf
Elements_Content_Model_Overview.pdfJeff Smith
 

Tendances (8)

Wordpress Custom Child theme
Wordpress Custom Child themeWordpress Custom Child theme
Wordpress Custom Child theme
 
Drupal 8 and iOS - an Open Source App
Drupal 8 and iOS - an Open Source AppDrupal 8 and iOS - an Open Source App
Drupal 8 and iOS - an Open Source App
 
Oracle SQLcl: Formatting your Query Results
Oracle SQLcl: Formatting your Query ResultsOracle SQLcl: Formatting your Query Results
Oracle SQLcl: Formatting your Query Results
 
Drupal 8 Deep Dive: Plugin System
Drupal 8 Deep Dive: Plugin SystemDrupal 8 Deep Dive: Plugin System
Drupal 8 Deep Dive: Plugin System
 
Getting started with DSpace 7 REST API
Getting started with DSpace 7 REST APIGetting started with DSpace 7 REST API
Getting started with DSpace 7 REST API
 
Dspace 7 presentation
Dspace 7 presentationDspace 7 presentation
Dspace 7 presentation
 
Apache Hive authorization models
Apache Hive authorization modelsApache Hive authorization models
Apache Hive authorization models
 
Elements_Content_Model_Overview.pdf
Elements_Content_Model_Overview.pdfElements_Content_Model_Overview.pdf
Elements_Content_Model_Overview.pdf
 

En vedette

Drupal 8: frontend development
Drupal 8: frontend developmentDrupal 8: frontend development
Drupal 8: frontend developmentsparkfabrik
 
An introduction to Google Analytics
An introduction to Google AnalyticsAn introduction to Google Analytics
An introduction to Google AnalyticsJoris Roebben
 
Google Analytics 101 | 2015
Google Analytics 101 |  2015Google Analytics 101 |  2015
Google Analytics 101 | 2015Insivia
 
Paragraphs and the Fieldable Authoring Experience in Drupal 7
Paragraphs and the Fieldable Authoring Experience in Drupal 7Paragraphs and the Fieldable Authoring Experience in Drupal 7
Paragraphs and the Fieldable Authoring Experience in Drupal 7Peter Macinkovic
 
Bootstrap framework and drupal paragraphs
Bootstrap framework and drupal paragraphsBootstrap framework and drupal paragraphs
Bootstrap framework and drupal paragraphsJim Birch
 
Politische Ponerologie
Politische PonerologiePolitische Ponerologie
Politische PonerologieMCExorzist
 
Muammar al-Gaddafi - Das Grüne Buch
Muammar al-Gaddafi - Das Grüne BuchMuammar al-Gaddafi - Das Grüne Buch
Muammar al-Gaddafi - Das Grüne BuchMCExorzist
 
Real History - The Bad War (english 115s)
Real History - The Bad War (english 115s)Real History - The Bad War (english 115s)
Real History - The Bad War (english 115s)MCExorzist
 
Gerd Honsik - Freispruch für Hitler - 1988 - 233S
Gerd Honsik - Freispruch für Hitler - 1988 - 233SGerd Honsik - Freispruch für Hitler - 1988 - 233S
Gerd Honsik - Freispruch für Hitler - 1988 - 233SMCExorzist
 
Thomas Goodrich - Hellstorm The Death Of Nazi Germany
Thomas Goodrich - Hellstorm The Death Of Nazi GermanyThomas Goodrich - Hellstorm The Death Of Nazi Germany
Thomas Goodrich - Hellstorm The Death Of Nazi GermanyMCExorzist
 
JavaScript - The Universal Platform?
JavaScript - The Universal Platform?JavaScript - The Universal Platform?
JavaScript - The Universal Platform?Jonas Bandi
 
Angela Merkel - Doktorarbeit
Angela Merkel - DoktorarbeitAngela Merkel - Doktorarbeit
Angela Merkel - DoktorarbeitMCExorzist
 
Drupal 8: Forms
Drupal 8: FormsDrupal 8: Forms
Drupal 8: Formsdrubb
 
Cross-Platform Desktop Apps with Electron (JSConf UY)
Cross-Platform Desktop Apps with Electron (JSConf UY)Cross-Platform Desktop Apps with Electron (JSConf UY)
Cross-Platform Desktop Apps with Electron (JSConf UY)David Neal
 
Cross-Platform Desktop Apps with Electron (CodeStock Edition)
Cross-Platform Desktop Apps with Electron (CodeStock Edition)Cross-Platform Desktop Apps with Electron (CodeStock Edition)
Cross-Platform Desktop Apps with Electron (CodeStock Edition)David Neal
 
JavaScript and Desktop Apps - Introduction to Electron
JavaScript and Desktop Apps - Introduction to ElectronJavaScript and Desktop Apps - Introduction to Electron
JavaScript and Desktop Apps - Introduction to ElectronBrainhub
 
Architecture of Drupal - Drupal Camp
Architecture of Drupal - Drupal CampArchitecture of Drupal - Drupal Camp
Architecture of Drupal - Drupal CampDipen Chaudhary
 
State of Search, Solr and Facets in Drupal 8 - Drupalcamp Belgium 2015
State of Search, Solr and Facets in Drupal 8 - Drupalcamp Belgium 2015State of Search, Solr and Facets in Drupal 8 - Drupalcamp Belgium 2015
State of Search, Solr and Facets in Drupal 8 - Drupalcamp Belgium 2015Dropsolid
 

En vedette (20)

Drupal 8: frontend development
Drupal 8: frontend developmentDrupal 8: frontend development
Drupal 8: frontend development
 
An introduction to Google Analytics
An introduction to Google AnalyticsAn introduction to Google Analytics
An introduction to Google Analytics
 
Google Analytics 101 | 2015
Google Analytics 101 |  2015Google Analytics 101 |  2015
Google Analytics 101 | 2015
 
Paragraphs and the Fieldable Authoring Experience in Drupal 7
Paragraphs and the Fieldable Authoring Experience in Drupal 7Paragraphs and the Fieldable Authoring Experience in Drupal 7
Paragraphs and the Fieldable Authoring Experience in Drupal 7
 
Bootstrap framework and drupal paragraphs
Bootstrap framework and drupal paragraphsBootstrap framework and drupal paragraphs
Bootstrap framework and drupal paragraphs
 
Politische Ponerologie
Politische PonerologiePolitische Ponerologie
Politische Ponerologie
 
Muammar al-Gaddafi - Das Grüne Buch
Muammar al-Gaddafi - Das Grüne BuchMuammar al-Gaddafi - Das Grüne Buch
Muammar al-Gaddafi - Das Grüne Buch
 
JS Class 2016
JS Class 2016JS Class 2016
JS Class 2016
 
Real History - The Bad War (english 115s)
Real History - The Bad War (english 115s)Real History - The Bad War (english 115s)
Real History - The Bad War (english 115s)
 
Gerd Honsik - Freispruch für Hitler - 1988 - 233S
Gerd Honsik - Freispruch für Hitler - 1988 - 233SGerd Honsik - Freispruch für Hitler - 1988 - 233S
Gerd Honsik - Freispruch für Hitler - 1988 - 233S
 
Thomas Goodrich - Hellstorm The Death Of Nazi Germany
Thomas Goodrich - Hellstorm The Death Of Nazi GermanyThomas Goodrich - Hellstorm The Death Of Nazi Germany
Thomas Goodrich - Hellstorm The Death Of Nazi Germany
 
JavaScript - The Universal Platform?
JavaScript - The Universal Platform?JavaScript - The Universal Platform?
JavaScript - The Universal Platform?
 
Angela Merkel - Doktorarbeit
Angela Merkel - DoktorarbeitAngela Merkel - Doktorarbeit
Angela Merkel - Doktorarbeit
 
Drupal 8: Forms
Drupal 8: FormsDrupal 8: Forms
Drupal 8: Forms
 
Cross-Platform Desktop Apps with Electron (JSConf UY)
Cross-Platform Desktop Apps with Electron (JSConf UY)Cross-Platform Desktop Apps with Electron (JSConf UY)
Cross-Platform Desktop Apps with Electron (JSConf UY)
 
Cross-Platform Desktop Apps with Electron (CodeStock Edition)
Cross-Platform Desktop Apps with Electron (CodeStock Edition)Cross-Platform Desktop Apps with Electron (CodeStock Edition)
Cross-Platform Desktop Apps with Electron (CodeStock Edition)
 
Electron
ElectronElectron
Electron
 
JavaScript and Desktop Apps - Introduction to Electron
JavaScript and Desktop Apps - Introduction to ElectronJavaScript and Desktop Apps - Introduction to Electron
JavaScript and Desktop Apps - Introduction to Electron
 
Architecture of Drupal - Drupal Camp
Architecture of Drupal - Drupal CampArchitecture of Drupal - Drupal Camp
Architecture of Drupal - Drupal Camp
 
State of Search, Solr and Facets in Drupal 8 - Drupalcamp Belgium 2015
State of Search, Solr and Facets in Drupal 8 - Drupalcamp Belgium 2015State of Search, Solr and Facets in Drupal 8 - Drupalcamp Belgium 2015
State of Search, Solr and Facets in Drupal 8 - Drupalcamp Belgium 2015
 

Similaire à RESTful application with Drupal 8

RestFul Web Services In Drupal 8
RestFul Web Services In Drupal 8RestFul Web Services In Drupal 8
RestFul Web Services In Drupal 8Gajendra Sharma
 
Serving the Internet of Things (IoT) with Drupal - DrupalCon Barcelona 2015
Serving the Internet of Things (IoT) with Drupal - DrupalCon Barcelona 2015Serving the Internet of Things (IoT) with Drupal - DrupalCon Barcelona 2015
Serving the Internet of Things (IoT) with Drupal - DrupalCon Barcelona 2015Exove
 
Understanding and Using Rest APIs (SocialDevCamp Chicago 2009)
Understanding and Using Rest APIs (SocialDevCamp Chicago 2009)Understanding and Using Rest APIs (SocialDevCamp Chicago 2009)
Understanding and Using Rest APIs (SocialDevCamp Chicago 2009)Pete Morano
 
RESTful Web Services in Drupal7
RESTful Web Services in Drupal7RESTful Web Services in Drupal7
RESTful Web Services in Drupal7bmeme
 
What Makes Drupal 8 so Great!
What Makes Drupal 8 so Great!What Makes Drupal 8 so Great!
What Makes Drupal 8 so Great!Drupal Durban
 
Serving the Internet of Things (IoT) with Drupal - DrupalCamp Baltics 2015:
Serving the Internet of Things (IoT) with Drupal - DrupalCamp Baltics 2015: Serving the Internet of Things (IoT) with Drupal - DrupalCamp Baltics 2015:
Serving the Internet of Things (IoT) with Drupal - DrupalCamp Baltics 2015: Exove
 
Oleg Bogut - Decoupled Drupal: how to build stable solution with JSON:API, Re...
Oleg Bogut - Decoupled Drupal: how to build stable solution with JSON:API, Re...Oleg Bogut - Decoupled Drupal: how to build stable solution with JSON:API, Re...
Oleg Bogut - Decoupled Drupal: how to build stable solution with JSON:API, Re...DrupalCamp Kyiv
 
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
 
Oracle REST Data Services
Oracle REST Data ServicesOracle REST Data Services
Oracle REST Data ServicesChris Muir
 
RESTful Web services in Drupal 8
RESTful Web services in Drupal 8RESTful Web services in Drupal 8
RESTful Web services in Drupal 8valuebound
 
Restful web services_tutorial
Restful web services_tutorialRestful web services_tutorial
Restful web services_tutorialphilip75020
 
RESTful Web Development with CakePHP
RESTful Web Development with CakePHPRESTful Web Development with CakePHP
RESTful Web Development with CakePHPAndru Weir
 
[drupalday2017] - Decoupled frontend con Drupal 8 e OpenUI 5
[drupalday2017] - Decoupled frontend con Drupal 8 e OpenUI 5[drupalday2017] - Decoupled frontend con Drupal 8 e OpenUI 5
[drupalday2017] - Decoupled frontend con Drupal 8 e OpenUI 5DrupalDay
 
Unleash the power of HTTP with ASP.NET Web API
Unleash the power of HTTP with ASP.NET Web APIUnleash the power of HTTP with ASP.NET Web API
Unleash the power of HTTP with ASP.NET Web APIFilip W
 
Drupal 8 preview_slideshow
Drupal 8 preview_slideshowDrupal 8 preview_slideshow
Drupal 8 preview_slideshowTee Malapela
 

Similaire à RESTful application with Drupal 8 (20)

RestFul Web Services In Drupal 8
RestFul Web Services In Drupal 8RestFul Web Services In Drupal 8
RestFul Web Services In Drupal 8
 
Serving the Internet of Things (IoT) with Drupal - DrupalCon Barcelona 2015
Serving the Internet of Things (IoT) with Drupal - DrupalCon Barcelona 2015Serving the Internet of Things (IoT) with Drupal - DrupalCon Barcelona 2015
Serving the Internet of Things (IoT) with Drupal - DrupalCon Barcelona 2015
 
REST Servers in Delphi XE Using DataSnap
REST Servers in Delphi XE Using DataSnapREST Servers in Delphi XE Using DataSnap
REST Servers in Delphi XE Using DataSnap
 
Understanding and Using Rest APIs (SocialDevCamp Chicago 2009)
Understanding and Using Rest APIs (SocialDevCamp Chicago 2009)Understanding and Using Rest APIs (SocialDevCamp Chicago 2009)
Understanding and Using Rest APIs (SocialDevCamp Chicago 2009)
 
Unerstanding and Using RESTful APIs
Unerstanding and Using RESTful APIsUnerstanding and Using RESTful APIs
Unerstanding and Using RESTful APIs
 
RESTful Web Services in Drupal7
RESTful Web Services in Drupal7RESTful Web Services in Drupal7
RESTful Web Services in Drupal7
 
What Makes Drupal 8 so Great!
What Makes Drupal 8 so Great!What Makes Drupal 8 so Great!
What Makes Drupal 8 so Great!
 
Serving the Internet of Things (IoT) with Drupal - DrupalCamp Baltics 2015:
Serving the Internet of Things (IoT) with Drupal - DrupalCamp Baltics 2015: Serving the Internet of Things (IoT) with Drupal - DrupalCamp Baltics 2015:
Serving the Internet of Things (IoT) with Drupal - DrupalCamp Baltics 2015:
 
REST full API Design
REST full API DesignREST full API Design
REST full API Design
 
REST API Laravel
REST API LaravelREST API Laravel
REST API Laravel
 
Oleg Bogut - Decoupled Drupal: how to build stable solution with JSON:API, Re...
Oleg Bogut - Decoupled Drupal: how to build stable solution with JSON:API, Re...Oleg Bogut - Decoupled Drupal: how to build stable solution with JSON:API, Re...
Oleg Bogut - Decoupled Drupal: how to build stable solution with JSON:API, Re...
 
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
 
Oracle REST Data Services
Oracle REST Data ServicesOracle REST Data Services
Oracle REST Data Services
 
RESTful Web services in Drupal 8
RESTful Web services in Drupal 8RESTful Web services in Drupal 8
RESTful Web services in Drupal 8
 
Restful web services_tutorial
Restful web services_tutorialRestful web services_tutorial
Restful web services_tutorial
 
RESTful Web Development with CakePHP
RESTful Web Development with CakePHPRESTful Web Development with CakePHP
RESTful Web Development with CakePHP
 
Drupalcon Mumbai
Drupalcon MumbaiDrupalcon Mumbai
Drupalcon Mumbai
 
[drupalday2017] - Decoupled frontend con Drupal 8 e OpenUI 5
[drupalday2017] - Decoupled frontend con Drupal 8 e OpenUI 5[drupalday2017] - Decoupled frontend con Drupal 8 e OpenUI 5
[drupalday2017] - Decoupled frontend con Drupal 8 e OpenUI 5
 
Unleash the power of HTTP with ASP.NET Web API
Unleash the power of HTTP with ASP.NET Web APIUnleash the power of HTTP with ASP.NET Web API
Unleash the power of HTTP with ASP.NET Web API
 
Drupal 8 preview_slideshow
Drupal 8 preview_slideshowDrupal 8 preview_slideshow
Drupal 8 preview_slideshow
 

Dernier

Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.soniya singh
 
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...tanu pandey
 
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...SUHANI PANDEY
 
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl ServiceRussian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl Servicegwenoracqe6
 
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night StandHot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Standkumarajju5765
 
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...SUHANI PANDEY
 
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.soniya singh
 
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...singhpriety023
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLimonikaupta
 
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Delhi Call girls
 
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445ruhi
 
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...SUHANI PANDEY
 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirtrahman018755
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersDamian Radcliffe
 

Dernier (20)

VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
 
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Rani Bagh Escort Service Delhi N.C.R.
 
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
 
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Pratap Nagar Delhi 💯Call Us 🔝8264348440🔝
 
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
 
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl ServiceRussian Call girl in Ajman +971563133746 Ajman Call girl Service
Russian Call girl in Ajman +971563133746 Ajman Call girl Service
 
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night StandHot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
 
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
 
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
 
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
 
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
 
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
 
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRLLucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
Lucknow ❤CALL GIRL 88759*99948 ❤CALL GIRLS IN Lucknow ESCORT SERVICE❤CALL GIRL
 
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
 
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
 
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
 
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirt
 
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
 

RESTful application with Drupal 8

  • 1. RESTful application with Drupal 8 Concept / Overview / Demonstration / Happyness
  • 2. Introduction Digital agency established since 2008 in Mauritius Recognized as one of the most expert offshore web agencies in Drupal More than 150 projects in Drupal
  • 3. Introduction Technical Director at Esokia 10 years of experience in PHP 7 years of experience in Drupal
  • 4. What is Drupal? Free, community-built website development tool Modular and extensible content management Open source Built on PHP Created by Dries Buytaert First release in January 2001
  • 5. Drupal now Drupal 8 released on November, 2015 (approx.) Big architectural changes Built with
  • 6. About the session A little warm-up An overview about Drupal 8 and this new core capability to build RESTful application. From a basic utilisation to a more complexe use case, we will made a global overview of possible exploitation of Drupal 8 RESTful aspect.
  • 7. Warm-up Drupal 8 is the next main version of Drupal’s CMS, a quick overview and presentation will be made for exposing the concept. On the next topic, we will see what is REST and key concept about a RESTful application, with basic exemple and application. A more advanced concept will be see in the next topic, with a presentation about an utilisation of JavaScript to use a Drupal 8 RESTful application and a more complex example with a NodeJS / ExpressJS application.
  • 8. RESTful? REpresentational State Transfert An application that implements the REST architectural style is called a RESTful application
  • 9. REST Principle Communicate over HTTP protocol using HTTP verbs that web browsers use between client and server GET PUT DELETE POST PATCH etc
  • 10. REST Implementation - Two ways GET → Retreive something POST → Create something DELETE → Delete something PATCH → Update something GET → Retrieve something POST → Update something DELETE → Delete something PUT → Create something
  • 11. What is REST in Drupal? Make possible for other applications to read and update information on your site via the Web. REST is one of a number of different ways of making it available. In contrast to other techniques such as SOAP or XML-RPC, REST encourages developers to rely on HTTP methods (such as GET and POST) to operate on "resources" (data managed by Drupal).
  • 12. RESTful Web Service API The RESTful Web Services API is new in Drupal 8. For each REST resource, you can specify the supported verbs (i.e. GET, POST…), and for each verb, you can specify the serialization formats & authentication mechanisms. In Drupal 8, there is a single central location to configure all REST resources that a site exposes: rest.settings.yml. A permission is generated for every resource + verb, users need this permission to be able to interact with this REST resource.
  • 13. GET For reading content entities. Read-only method. Considered as a safe method. Results are automatically cached.
  • 14. POST For creating content entities. Some entities need a _links entry to the user and / or to the referenced entity. Never POST a UUID (or node ID/comment ID/…) as you create a new entity. Considered as an unsafe method. Need a CSRF Token.
  • 15. PATCH For updading content entities. When PATCHing resources, only send the changes. Considered as an unsafe method. Need a CSRF Token.
  • 16. DELETE For deleting content entities. Content-type header not necessary (no request body). Considered as an unsafe method. Need a CSRF Token.
  • 17. Basic Example Read and write data from your Drupal installation with a couple of modules. Requirements: RESTful Web Services (rest) Serialization (serialization) Hypertext Application Language (hal) HTTP Basic Authentication (basic_auth)
  • 18. Core module to enable
  • 20. List of permissions for using REST
  • 23. JS + D8 RESTful Web Services Can be use with every kind of entities in Drupal 8 if they are exposed for REST. Just implement an HTTP request and let’s go. Easy to separate client and server. Improve the client code’s portability. Servers can be simpler and more scalable.
  • 24. JQuery example JQuery already loaded in Drupal (JQuery 1.7) Every Drupal 8 project can be easily RESTful with client-server separation GET / POST /PATCH / DELETE still available
  • 25. Advanced Example Building a timesheet application in Drupal 8 with a separated front-end. What we need? A Drupal 8 installation with RESTful Web Services API Something funny like NodeJS ExpressJS or a similar framework
  • 26. Requirements LAMP Stack for the backend Linux Apache MySQL PHP
  • 27. Requirements MEAN Stack for the frontend MongoDB ExpressJS AngularJS NodeJS
  • 28. Requirements RESTful Web Services Views Field UI (nice to have) REST UI (nice to have) Drupal 8 installation
  • 30. LAMP Stack Be efficient: Google Cloud + Bitnami is a good combo! :-D Good combo is a pre-installed Drupal’s LAMP Stack.
  • 31. MEAN Stack Be efficient: Google Cloud + Bitnami is a good combo! :-D (really!)
  • 35. Let’s try Drupal: ● Content type ● Views ● Permissions Remember to configure the view for the REST Export!
  • 36. Let’s try ExpressJS ● Don’t forget to npm init before! ● And npm install express --save for dependencies ● You can add a template engine, add route with parameters, etc
  • 37. Drupal <-> NodeJS Need to install NPM Request module Load it in your Express App Interact with Drupal!