SlideShare une entreprise Scribd logo
1  sur  18
Télécharger pour lire hors ligne
Gabriel Dragomir

Drupal 8 as a mobile
backend
RESTful web services
Credits: Lin Clark, Klaus Purer
Overview
1. RESTful Drupal: the building blocks
2. Setting up a Drupal REST web server
3. Verbalizing REST
4. Resource plugins
1. RESTful Drupal
• Drupal 8 REST out of the box:
• RESTful web services module
• Serialization
• HAL module: Hypertext Application
Language

• HTTP basic authentication
1. RESTful Drupal
1. RESTful Drupal
1. RESTful Drupal
2. Setting up a Drupal
REST WS
• Enable modules
• Configuration: generated

sites/default/files/config_XXXX/active/rest.settings.yml

• Set permissions
• Helper module: REST UI

https://drupal.org/project/restui
3. Verbalizing REST

• Resources and operations
• Authentication and access control
• Example requests
3.1 Resources and
operations
• Resource: the data structure that the
service is acting on (e.g. an entity)

• Operation: the specific action (HTTP
method)
3.1 Resources and
operations
3.1 Plug and use
• Entity API with field metadata
• All properties and fields of an entity are described
• Any available entity can have REST API support
enabled

• Each entity plugin has its own plugin
• Access control enforced:
• on the entity level
• on the field level
3.2 Authentication and
access control
• Handler by HTTP Basic Auth module
• AuthenticationProviderInterface in Drupal core
• Pluggable authentication providers:
• Standard Drupal session cookie (Drupal core)
• Basic HTTP Authentication (Drupal core)
• OAuth (Contrib)
• Provides user permissions to authorize web service
operations

• Each resource plugin provides own supplementary access

control (example: entity and field access in the entity plugin)
3.3 Example requests
• GET entity/node/1
• CSRF tokens: GET rest/session/token
• POST entity/node
• PATCH entity/node
4. Resource plugins
• Based on Drupal 8 plugin API
• Default plugin exposes all entities
• Contributed modules can override/
extend/provide plugins

• Example: dblog plugin
4. Resource plugins
Questions?
Contact me

• gabriel.dragomir@webikon.com
• twitter: gabidrg
Thank you!

Contenu connexe

Tendances

Drupal Services 3 - Drupal Dev Days 2011, Brussels
Drupal Services 3 - Drupal Dev Days 2011, BrusselsDrupal Services 3 - Drupal Dev Days 2011, Brussels
Drupal Services 3 - Drupal Dev Days 2011, Brusselsheyrocker
 
Tech talk live share extras extension modules feb 13
Tech talk live   share extras extension modules feb 13Tech talk live   share extras extension modules feb 13
Tech talk live share extras extension modules feb 13Alfresco Software
 
Azure doc db (slideshare)
Azure doc db (slideshare)Azure doc db (slideshare)
Azure doc db (slideshare)David Green
 
Globus Portal Framework (APS Workshop)
Globus Portal Framework (APS Workshop)Globus Portal Framework (APS Workshop)
Globus Portal Framework (APS Workshop)Globus
 
Creating REST Webservice With NetBeans
Creating REST Webservice With NetBeansCreating REST Webservice With NetBeans
Creating REST Webservice With NetBeansNeil Ghosh
 
6. hibernate
6. hibernate6. hibernate
6. hibernateAnusAhmad
 
Introduction à DocumentDB
Introduction à DocumentDBIntroduction à DocumentDB
Introduction à DocumentDBMSDEVMTL
 
Search api d8
Search api d8Search api d8
Search api d8Dropsolid
 
Benjamin Guinebertière - Microsoft Azure: Document DB and other noSQL databas...
Benjamin Guinebertière - Microsoft Azure: Document DB and other noSQL databas...Benjamin Guinebertière - Microsoft Azure: Document DB and other noSQL databas...
Benjamin Guinebertière - Microsoft Azure: Document DB and other noSQL databas...NoSQLmatters
 
Cejv659 week09 glassfish-s14
Cejv659 week09 glassfish-s14Cejv659 week09 glassfish-s14
Cejv659 week09 glassfish-s14Ken Fogel
 
RestFul Web Services In Drupal 8
RestFul Web Services In Drupal 8RestFul Web Services In Drupal 8
RestFul Web Services In Drupal 8Gajendra Sharma
 
Intresting changes in mongo 2.6
Intresting changes in mongo 2.6Intresting changes in mongo 2.6
Intresting changes in mongo 2.6David Murphy
 
6 Months PHP internship in Noida
6 Months PHP internship in Noida6 Months PHP internship in Noida
6 Months PHP internship in NoidaTech Mentro
 
Introduction to mongo db
Introduction to mongo dbIntroduction to mongo db
Introduction to mongo dbRohit Bishnoi
 
Webinar: What's new in the .NET Driver
Webinar: What's new in the .NET DriverWebinar: What's new in the .NET Driver
Webinar: What's new in the .NET DriverMongoDB
 
Electron, databases, and RxDB
Electron, databases, and RxDBElectron, databases, and RxDB
Electron, databases, and RxDBBen Gotow
 

Tendances (20)

Drupal Services 3 - Drupal Dev Days 2011, Brussels
Drupal Services 3 - Drupal Dev Days 2011, BrusselsDrupal Services 3 - Drupal Dev Days 2011, Brussels
Drupal Services 3 - Drupal Dev Days 2011, Brussels
 
Azure DocumentDB
Azure DocumentDBAzure DocumentDB
Azure DocumentDB
 
Tech talk live share extras extension modules feb 13
Tech talk live   share extras extension modules feb 13Tech talk live   share extras extension modules feb 13
Tech talk live share extras extension modules feb 13
 
Hibernate
HibernateHibernate
Hibernate
 
Azure doc db (slideshare)
Azure doc db (slideshare)Azure doc db (slideshare)
Azure doc db (slideshare)
 
Globus Portal Framework (APS Workshop)
Globus Portal Framework (APS Workshop)Globus Portal Framework (APS Workshop)
Globus Portal Framework (APS Workshop)
 
Creating REST Webservice With NetBeans
Creating REST Webservice With NetBeansCreating REST Webservice With NetBeans
Creating REST Webservice With NetBeans
 
6. hibernate
6. hibernate6. hibernate
6. hibernate
 
Introduction à DocumentDB
Introduction à DocumentDBIntroduction à DocumentDB
Introduction à DocumentDB
 
Search api d8
Search api d8Search api d8
Search api d8
 
Lokijs
LokijsLokijs
Lokijs
 
Kantara OTTO slides
Kantara OTTO slidesKantara OTTO slides
Kantara OTTO slides
 
Benjamin Guinebertière - Microsoft Azure: Document DB and other noSQL databas...
Benjamin Guinebertière - Microsoft Azure: Document DB and other noSQL databas...Benjamin Guinebertière - Microsoft Azure: Document DB and other noSQL databas...
Benjamin Guinebertière - Microsoft Azure: Document DB and other noSQL databas...
 
Cejv659 week09 glassfish-s14
Cejv659 week09 glassfish-s14Cejv659 week09 glassfish-s14
Cejv659 week09 glassfish-s14
 
RestFul Web Services In Drupal 8
RestFul Web Services In Drupal 8RestFul Web Services In Drupal 8
RestFul Web Services In Drupal 8
 
Intresting changes in mongo 2.6
Intresting changes in mongo 2.6Intresting changes in mongo 2.6
Intresting changes in mongo 2.6
 
6 Months PHP internship in Noida
6 Months PHP internship in Noida6 Months PHP internship in Noida
6 Months PHP internship in Noida
 
Introduction to mongo db
Introduction to mongo dbIntroduction to mongo db
Introduction to mongo db
 
Webinar: What's new in the .NET Driver
Webinar: What's new in the .NET DriverWebinar: What's new in the .NET Driver
Webinar: What's new in the .NET Driver
 
Electron, databases, and RxDB
Electron, databases, and RxDBElectron, databases, and RxDB
Electron, databases, and RxDB
 

Similaire à Drupal 8 as a mobile backend

Introduction to Restful Web Services
Introduction to Restful Web ServicesIntroduction to Restful Web Services
Introduction to Restful Web Servicesweili_at_slideshare
 
Search all the things
Search all the thingsSearch all the things
Search all the thingscyberswat
 
Solr Recipes Workshop
Solr Recipes WorkshopSolr Recipes Workshop
Solr Recipes WorkshopErik Hatcher
 
The API Journey: from REST to GraphQL
The API Journey: from REST to GraphQLThe API Journey: from REST to GraphQL
The API Journey: from REST to GraphQLHaci Murat Yaman
 
A Second Look at Oracle RAC 12c
A Second Look at Oracle RAC 12cA Second Look at Oracle RAC 12c
A Second Look at Oracle RAC 12cLeighton Nelson
 
Advanced Web Development in PHP - Understanding REST API
Advanced Web Development in PHP - Understanding REST APIAdvanced Web Development in PHP - Understanding REST API
Advanced Web Development in PHP - Understanding REST APIRasan Samarasinghe
 
Elasticsearch python
Elasticsearch pythonElasticsearch python
Elasticsearch pythonvaliantval2
 
Webinar: What's new in CDAP 3.5?
Webinar: What's new in CDAP 3.5?Webinar: What's new in CDAP 3.5?
Webinar: What's new in CDAP 3.5?Cask Data
 
Azure DocumentDB for Healthcare Integration
Azure DocumentDB for Healthcare IntegrationAzure DocumentDB for Healthcare Integration
Azure DocumentDB for Healthcare IntegrationBizTalk360
 
Service-Oriented Design and Implement with Rails3
Service-Oriented Design and Implement with Rails3Service-Oriented Design and Implement with Rails3
Service-Oriented Design and Implement with Rails3Wen-Tien Chang
 
REST Methodologies
REST MethodologiesREST Methodologies
REST Methodologiesjrodbx
 
Restful webservice
Restful webserviceRestful webservice
Restful webserviceDong Ngoc
 
Introduction to Solr
Introduction to SolrIntroduction to Solr
Introduction to SolrErik Hatcher
 
Entities in Drupal 8 - Drupal Tech Talk - Bart Feenstra
Entities in Drupal 8 - Drupal Tech Talk - Bart FeenstraEntities in Drupal 8 - Drupal Tech Talk - Bart Feenstra
Entities in Drupal 8 - Drupal Tech Talk - Bart FeenstraTriquanta
 

Similaire à Drupal 8 as a mobile backend (20)

Introduction to Restful Web Services
Introduction to Restful Web ServicesIntroduction to Restful Web Services
Introduction to Restful Web Services
 
Search all the things
Search all the thingsSearch all the things
Search all the things
 
Solr Recipes Workshop
Solr Recipes WorkshopSolr Recipes Workshop
Solr Recipes Workshop
 
The API Journey: from REST to GraphQL
The API Journey: from REST to GraphQLThe API Journey: from REST to GraphQL
The API Journey: from REST to GraphQL
 
Rest web services
Rest web servicesRest web services
Rest web services
 
A Second Look at Oracle RAC 12c
A Second Look at Oracle RAC 12cA Second Look at Oracle RAC 12c
A Second Look at Oracle RAC 12c
 
Drupal online training - GoLogica
Drupal online training - GoLogicaDrupal online training - GoLogica
Drupal online training - GoLogica
 
DrupalCon 2011 Highlight
DrupalCon 2011 HighlightDrupalCon 2011 Highlight
DrupalCon 2011 Highlight
 
Advanced Web Development in PHP - Understanding REST API
Advanced Web Development in PHP - Understanding REST APIAdvanced Web Development in PHP - Understanding REST API
Advanced Web Development in PHP - Understanding REST API
 
Webscripts Server
Webscripts ServerWebscripts Server
Webscripts Server
 
Elasticsearch python
Elasticsearch pythonElasticsearch python
Elasticsearch python
 
Webinar: What's new in CDAP 3.5?
Webinar: What's new in CDAP 3.5?Webinar: What's new in CDAP 3.5?
Webinar: What's new in CDAP 3.5?
 
Solr Recipes
Solr RecipesSolr Recipes
Solr Recipes
 
Azure DocumentDB for Healthcare Integration
Azure DocumentDB for Healthcare IntegrationAzure DocumentDB for Healthcare Integration
Azure DocumentDB for Healthcare Integration
 
Service-Oriented Design and Implement with Rails3
Service-Oriented Design and Implement with Rails3Service-Oriented Design and Implement with Rails3
Service-Oriented Design and Implement with Rails3
 
REST Methodologies
REST MethodologiesREST Methodologies
REST Methodologies
 
Restful webservice
Restful webserviceRestful webservice
Restful webservice
 
Hadoop introduction
Hadoop introductionHadoop introduction
Hadoop introduction
 
Introduction to Solr
Introduction to SolrIntroduction to Solr
Introduction to Solr
 
Entities in Drupal 8 - Drupal Tech Talk - Bart Feenstra
Entities in Drupal 8 - Drupal Tech Talk - Bart FeenstraEntities in Drupal 8 - Drupal Tech Talk - Bart Feenstra
Entities in Drupal 8 - Drupal Tech Talk - Bart Feenstra
 

Dernier

Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
"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
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
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
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
"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
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
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
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
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
 
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
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 

Dernier (20)

Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
"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...
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
"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
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
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
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
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
 
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
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 

Drupal 8 as a mobile backend

  • 1. Gabriel Dragomir Drupal 8 as a mobile backend RESTful web services Credits: Lin Clark, Klaus Purer
  • 2. Overview 1. RESTful Drupal: the building blocks 2. Setting up a Drupal REST web server 3. Verbalizing REST 4. Resource plugins
  • 3. 1. RESTful Drupal • Drupal 8 REST out of the box: • RESTful web services module • Serialization • HAL module: Hypertext Application Language • HTTP basic authentication
  • 7. 2. Setting up a Drupal REST WS • Enable modules • Configuration: generated sites/default/files/config_XXXX/active/rest.settings.yml • Set permissions • Helper module: REST UI https://drupal.org/project/restui
  • 8. 3. Verbalizing REST • Resources and operations • Authentication and access control • Example requests
  • 9. 3.1 Resources and operations • Resource: the data structure that the service is acting on (e.g. an entity) • Operation: the specific action (HTTP method)
  • 11. 3.1 Plug and use • Entity API with field metadata • All properties and fields of an entity are described • Any available entity can have REST API support enabled • Each entity plugin has its own plugin • Access control enforced: • on the entity level • on the field level
  • 12. 3.2 Authentication and access control • Handler by HTTP Basic Auth module • AuthenticationProviderInterface in Drupal core • Pluggable authentication providers: • Standard Drupal session cookie (Drupal core) • Basic HTTP Authentication (Drupal core) • OAuth (Contrib) • Provides user permissions to authorize web service operations • Each resource plugin provides own supplementary access control (example: entity and field access in the entity plugin)
  • 13. 3.3 Example requests • GET entity/node/1 • CSRF tokens: GET rest/session/token • POST entity/node • PATCH entity/node
  • 14. 4. Resource plugins • Based on Drupal 8 plugin API • Default plugin exposes all entities • Contributed modules can override/ extend/provide plugins • Example: dblog plugin