RESTful in Drupal 8 and Services module - New`n`Tasty!

Post on 14-Apr-2017

325 views 0 download

Transcript of RESTful in Drupal 8 and Services module - New`n`Tasty!

Dmytro Olareskodolaresko@adyax.com

RESTful in Drupal 8 and Services module

RESTful Drupal Core

RESTful Web Services (rest) Serialization (serialization) Hypertext Application Language (hal) HTTP Basic Authentication (basic_auth)

REST UIhttps://www.drupal.org/project/restui

RESTful Views

X-CSRF-Token(POST / PATCH / DELETE)

REQUESTURI: rest/session/tokenMETHOD: GET

RESPONSEGbAqLrLo6K2TZFbXxm65JZCHlSINcm0lIZOsyw5dkJQ

`

RESTful Web Services API

Hooks

Serialization API

ce_sync_rest.services.yml

https://api.drupal.org/api/drupal/core!modules!serialization!serialization.services.yml/8.2.x

Encoder / Decoder

https://www.drupal.org/project/csv_serialization

Authentication API

OAuth https://www.drupal.org/project/oauth

Simple OAuthhttps://www.drupal.org/project/simple_oauth

IP Consumer Auth

https://www.drupal.org/project/ip_consumer_auth

OAuth2 Server

https://www.drupal.org/project/oauth2_server

Services Module (4.x)

Allows to modify/hook into entities, and add actions/targetable actions or indexes in a standard Non-RESTful Web services way.

Provide endpoint capabilities to put your API behind a centralized URL

Accept header-based negotiation Provide and extension to some of Cores

capabilities. Provide multiple response formats Version your API's

https://www.drupal.org/documentation/modules/rest https://drupalize.me/blog/201401/introduction-restful-web-servic

es-drupal-8 http://www.slideshare.net/KateMarshalkina/rest-in-peace-52160

880 http://enzolutions.com/articles/2014/12/16/how-to-create-a-rest-r

esource-in-drupal-8/ https://www.acquia.com/resources/webinars/drupal-8-deep-dive-

what-it-means-developers-now-rest-core https://www.drupal.org/documentation/modules/serialization https://entitypilot.com/content/working-normalizers-drupal-8 https://portland2013.drupal.org/session/rest-and-serialization-dr

upal-8.html https://www.drupal.org/developing/api/8/authentication https://drupalwatchdog.com/volume-4/issue-2/protecting-your-dr

upal-8-resources https://dev.acquia.com/blog/apis-in-drupal-8/apis-in-drupal--8-th

e-services-module-/29/03/2016/10136

Dmytro Olareskodolaresko@adyax.com

Thank you!

Dmytro Olareskodolaresko@adyax.com

RESTful in Drupal 8 and Services module