SlideShare una empresa de Scribd logo
1 de 59
Descargar para leer sin conexión
MAY 29 & 30, 2014
Barcelona
@alvar0hurtad0
Drupal’s API
SO
SO
SO
SO +18
W
T
Drupal sites
Dries Buytaert March 2012
~7%
CMS SITES
Dries Buytaert March 2012
30%
WEB SITES
Dries Buytaert March 2012
launch
top
deprecated
T
launch
top
deprecated
T
launch
top
deprecated
T
launch
top
deprecated
30%
WEB SITES
Dries Buytaert March 2012
Dries Buytaert March 2012
7 8
7 8
IM
7 8
IM
• MULTILINGUAL
• UX/ADMINISTRATION EXPERIENCE
• MOBILE FRIENDLY
• CONFIGURATION MANAGEMENT
• WEB SERVICES
Photo: Carlos Francisco Peña
Photo: Carlos Francisco Peña
D
Photo: Carlos Francisco Peña
D
• LAYOUT CLICK BY CLICK
• DATA MODEL CLICK BY CLICK
• DATABASE QUERYS CLICK BY CLICK
• TRIGGERS AND ACTIONS …
• USER PERMISSIONS …
• WEB SERVICES CLICK BY CLICK
Photo: Carlos Francisco Peña
DATA MODEL
Photo: Carlos Francisco Peña
DATA MODEL
Photo: Carlos Francisco Peña
DATA MODEL
Photo: Carlos Francisco Peña
DATA MODEL


CONTENT MODELING
• CONTENT TYPES
• COMMENTS
• USER PROFILES
• COMMERCE PRODUCTS
• ….
DATABASE QUERYS CLICK BY CLICK
DATABASE QUERYS CLICK BY CLICK
DATABASE QUERYS CLICK BY CLICK
DATABASE QUERYS CLICK BY CLICK
DATABASE QUERYS CLICK BY CLICK
USER PERMISSION CLICK BY CLICK
USER PERMISSION CLICK BY CLICK
USER PERMISSION CLICK BY CLICK
USER PERMISSION CLICK BY CLICK
REST SERVICES CLICK BY CLICK
REST SERVICES CLICK BY CLICK
REST SERVICES CLICK BY CLICK
SERVICES AUTHENTICATION
SERVICES AUTHENTICATION
IN CORE
• HTTP basic authentication
• Cookie
SERVICES AUTHENTICATION
IN CORE
• HTTP basic authentication
• Cookie
CONTRIBUTED MODULE
• Oauth
SHOW ME THE CODE
SHOW ME THE CODE


CURL
curl -H "Accept: application/hal+json" --request GET
http://drupal-8.localhost/node/1
SHOW ME THE CODE


CURL
curl -H "Accept: application/hal+json" --request GET
http://drupal-8.localhost/node/1


Guzzle
<?php
use GuzzleHttpClient;
$client = new Client('http://drupal-8.localhost');
// If in a Drupal environment use the HTTP client service.
$client = Drupal::httpClient()->setBaseUrl('http://drupal-8.localhost');
$request = $client->get('node/1');
$request->addHeader('Accept', 'application/hal+json');
$response = $request->send()->json();
print_r($response);
?>
SHOW ME THE CODE


CURL
curl -H "Accept: application/hal+json" --request GET
http://drupal-8.localhost/node/1


Guzzle
<?php
use GuzzleHttpClient;
$client = new Client('http://drupal-8.localhost');
// If in a Drupal environment use the HTTP client service.
$client = Drupal::httpClient()->setBaseUrl('http://drupal-8.localhost');
$request = $client->get('node/1');
$request->addHeader('Accept', 'application/hal+json');
$response = $request->send()->json();
print_r($response);
?>


CURL
curl --include --request POST
--user cleverFucker:secret
--header 'Content-type: application/hal+json' http://
drupal-8.localhost/entity/node
--data-binary '{"_links":{"type":{"href":"http://
drupal-8.localhost/rest/type/node/page"}}, "title":
[{"value":"APIdaysBNC"}]}'
SHOW ME THE CODE


CURL
curl -H "Accept: application/hal+json" --request GET
http://drupal-8.localhost/node/1


Guzzle
<?php
use GuzzleHttpClient;
$client = new Client('http://drupal-8.localhost');
// If in a Drupal environment use the HTTP client service.
$client = Drupal::httpClient()->setBaseUrl('http://drupal-8.localhost');
$request = $client->get('node/1');
$request->addHeader('Accept', 'application/hal+json');
$response = $request->send()->json();
print_r($response);
?>


CURL
curl --include --request POST
--user cleverFucker:secret
--header 'Content-type: application/hal+json' http://
drupal-8.localhost/entity/node
--data-binary '{"_links":{"type":{"href":"http://
drupal-8.localhost/rest/type/node/page"}}, "title":
[{"value":"APIdaysBNC"}]}'


Guzzle (I)
<?php
use GuzzleHttpClient;
$client = new Client('http://drupal-8.localhost');
$client = Drupal::httpClient()->setBaseUrl('http://drupal-8.localhost');
$node = array(
'_links' => array(
'type' => array(
'href' => 'http://drupal-8.localhost/rest/type/node/page'
)
),
'title' => array(0 => array('value' => 'New node title')),
);
SHOW ME THE CODE


CURL
curl -H "Accept: application/hal+json" --request GET
http://drupal-8.localhost/node/1


Guzzle
<?php
use GuzzleHttpClient;
$client = new Client('http://drupal-8.localhost');
// If in a Drupal environment use the HTTP client service.
$client = Drupal::httpClient()->setBaseUrl('http://drupal-8.localhost');
$request = $client->get('node/1');
$request->addHeader('Accept', 'application/hal+json');
$response = $request->send()->json();
print_r($response);
?>


CURL
curl --include --request POST
--user cleverFucker:secret
--header 'Content-type: application/hal+json' http://
drupal-8.localhost/entity/node
--data-binary '{"_links":{"type":{"href":"http://
drupal-8.localhost/rest/type/node/page"}}, "title":
[{"value":"APIdaysBNC"}]}'


Guzzle (I)
<?php
use GuzzleHttpClient;
$client = new Client('http://drupal-8.localhost');
$client = Drupal::httpClient()->setBaseUrl('http://drupal-8.localhost');
$node = array(
'_links' => array(
'type' => array(
'href' => 'http://drupal-8.localhost/rest/type/node/page'
)
),
'title' => array(0 => array('value' => 'New node title')),
);


Guzzle (II)
$data = json_encode($node);
$response = $client->post('entity/node', array(
'Content-type' => 'application/hal+json',
), $data)
// Username and password for HTTP Basic Authentication.
->setAuth('klausi', 'secret')
->send();
if ($response->getStatusCode() == 201) {
print 'Node creation successful!';
}
?>
SOAP?
SOAP?
SOAP?
QUESTIONS !!! ?¿? !!!
I’ve a question
ONE MORE
THING
THANKS
Alvaro J. HurtadoVillegas	

www.twitter.com/aspgems	

www.twitter.com/alvar0hurtad0

Más contenido relacionado

Destacado

APIfying the Web with import.io (at APIdays mediterranea)
APIfying the Web with import.io (at APIdays mediterranea)APIfying the Web with import.io (at APIdays mediterranea)
APIfying the Web with import.io (at APIdays mediterranea)Ignacio Elola Villar
 
I want to be an efficient developer - APIdays Barcelona version
I want to be an efficient developer - APIdays Barcelona versionI want to be an efficient developer - APIdays Barcelona version
I want to be an efficient developer - APIdays Barcelona versionQuentin Adam
 
usable rest apis, by Javier Ramirez from teowaki (Apidays Mediterranea)
usable rest apis, by Javier Ramirez from teowaki (Apidays Mediterranea)usable rest apis, by Javier Ramirez from teowaki (Apidays Mediterranea)
usable rest apis, by Javier Ramirez from teowaki (Apidays Mediterranea)javier ramirez
 
Enhance the browser_experience
Enhance the browser_experienceEnhance the browser_experience
Enhance the browser_experienceHTML5 Spain
 
AIL Platform APIDays Mediterranea
AIL Platform APIDays MediterraneaAIL Platform APIDays Mediterranea
AIL Platform APIDays MediterraneaJoan Protasio
 
The importance of /me
The importance of /meThe importance of /me
The importance of /meBruno Pedro
 
Battelfield REST, API Development from the trenches
Battelfield REST, API Development from the trenchesBattelfield REST, API Development from the trenches
Battelfield REST, API Development from the trenchesDaniel Cerecedo
 
Gov APIs: The Notorious Case of Official Statistics
Gov APIs: The Notorious Case of Official StatisticsGov APIs: The Notorious Case of Official Statistics
Gov APIs: The Notorious Case of Official StatisticsXavier Badosa
 
Design-first API Development using Swagger and Node
Design-first API Development using Swagger and NodeDesign-first API Development using Swagger and Node
Design-first API Development using Swagger and NodeApigee | Google Cloud
 

Destacado (11)

Patent wars, Innovation, Roads
Patent wars, Innovation, RoadsPatent wars, Innovation, Roads
Patent wars, Innovation, Roads
 
APIfying the Web with import.io (at APIdays mediterranea)
APIfying the Web with import.io (at APIdays mediterranea)APIfying the Web with import.io (at APIdays mediterranea)
APIfying the Web with import.io (at APIdays mediterranea)
 
I want to be an efficient developer - APIdays Barcelona version
I want to be an efficient developer - APIdays Barcelona versionI want to be an efficient developer - APIdays Barcelona version
I want to be an efficient developer - APIdays Barcelona version
 
usable rest apis, by Javier Ramirez from teowaki (Apidays Mediterranea)
usable rest apis, by Javier Ramirez from teowaki (Apidays Mediterranea)usable rest apis, by Javier Ramirez from teowaki (Apidays Mediterranea)
usable rest apis, by Javier Ramirez from teowaki (Apidays Mediterranea)
 
Enhance the browser_experience
Enhance the browser_experienceEnhance the browser_experience
Enhance the browser_experience
 
Api barcelona
Api barcelonaApi barcelona
Api barcelona
 
AIL Platform APIDays Mediterranea
AIL Platform APIDays MediterraneaAIL Platform APIDays Mediterranea
AIL Platform APIDays Mediterranea
 
The importance of /me
The importance of /meThe importance of /me
The importance of /me
 
Battelfield REST, API Development from the trenches
Battelfield REST, API Development from the trenchesBattelfield REST, API Development from the trenches
Battelfield REST, API Development from the trenches
 
Gov APIs: The Notorious Case of Official Statistics
Gov APIs: The Notorious Case of Official StatisticsGov APIs: The Notorious Case of Official Statistics
Gov APIs: The Notorious Case of Official Statistics
 
Design-first API Development using Swagger and Node
Design-first API Development using Swagger and NodeDesign-first API Development using Swagger and Node
Design-first API Development using Swagger and Node
 

Similar a Build a Restfull app using drupal

Building mobile applications with DrupalGap
Building mobile applications with DrupalGapBuilding mobile applications with DrupalGap
Building mobile applications with DrupalGapAlex S
 
Getting Started with DrupalGap
Getting Started with DrupalGapGetting Started with DrupalGap
Getting Started with DrupalGapAlex S
 
Deploy your Multi-tier Application in Cloud Foundry
Deploy your Multi-tier Application in Cloud FoundryDeploy your Multi-tier Application in Cloud Foundry
Deploy your Multi-tier Application in Cloud Foundrycornelia davis
 
DrupalGap. How to create native application for mobile devices based on Drupa...
DrupalGap. How to create native application for mobile devices based on Drupa...DrupalGap. How to create native application for mobile devices based on Drupa...
DrupalGap. How to create native application for mobile devices based on Drupa...Alex S
 
DrupalGap. How to create native application for mobile devices based on Drupa...
DrupalGap. How to create native application for mobile devices based on Drupa...DrupalGap. How to create native application for mobile devices based on Drupa...
DrupalGap. How to create native application for mobile devices based on Drupa...DrupalCampDN
 
Best Practices for Moving to Drupal 9
Best Practices for Moving to Drupal 9Best Practices for Moving to Drupal 9
Best Practices for Moving to Drupal 9Acquia
 
Drupalcon 2023 - How Drupal builds your pages.pdf
Drupalcon 2023 - How Drupal builds your pages.pdfDrupalcon 2023 - How Drupal builds your pages.pdf
Drupalcon 2023 - How Drupal builds your pages.pdfLuca Lusso
 
2023 - Drupalcon - How Drupal builds your pages
2023 - Drupalcon - How Drupal builds your pages2023 - Drupalcon - How Drupal builds your pages
2023 - Drupalcon - How Drupal builds your pagessparkfabrik
 
Headless Drupal
Headless DrupalHeadless Drupal
Headless Drupaldrubb
 
Best Practices for Moving to Drupal 9
Best Practices for Moving to Drupal 9Best Practices for Moving to Drupal 9
Best Practices for Moving to Drupal 9Mediacurrent
 
[drupalday2017] - Drupal come frontend che consuma servizi: HTTP Client Manager
[drupalday2017] - Drupal come frontend che consuma servizi: HTTP Client Manager[drupalday2017] - Drupal come frontend che consuma servizi: HTTP Client Manager
[drupalday2017] - Drupal come frontend che consuma servizi: HTTP Client ManagerDrupalDay
 
Convert modules from 6.x to 7.x
Convert modules from 6.x to 7.xConvert modules from 6.x to 7.x
Convert modules from 6.x to 7.xJoão Ventura
 
Drupal 8 simple page: Mi primer proyecto en Drupal 8.
Drupal 8 simple page: Mi primer proyecto en Drupal 8.Drupal 8 simple page: Mi primer proyecto en Drupal 8.
Drupal 8 simple page: Mi primer proyecto en Drupal 8.Samuel Solís Fuentes
 
RedisConf18 - Writing modular & encapsulated Redis code
RedisConf18 - Writing modular & encapsulated Redis codeRedisConf18 - Writing modular & encapsulated Redis code
RedisConf18 - Writing modular & encapsulated Redis codeRedis Labs
 
Advanced moduledevelopment d6_slideshare
Advanced moduledevelopment d6_slideshareAdvanced moduledevelopment d6_slideshare
Advanced moduledevelopment d6_slideshareOpevel
 
Adriano Di Luzio - Davvy - PyconSEI Talk
Adriano Di Luzio - Davvy - PyconSEI TalkAdriano Di Luzio - Davvy - PyconSEI Talk
Adriano Di Luzio - Davvy - PyconSEI Talkaldur999
 
Drupal security
Drupal securityDrupal security
Drupal securityJozef Toth
 

Similar a Build a Restfull app using drupal (20)

Building mobile applications with DrupalGap
Building mobile applications with DrupalGapBuilding mobile applications with DrupalGap
Building mobile applications with DrupalGap
 
Getting Started with DrupalGap
Getting Started with DrupalGapGetting Started with DrupalGap
Getting Started with DrupalGap
 
Deploy your Multi-tier Application in Cloud Foundry
Deploy your Multi-tier Application in Cloud FoundryDeploy your Multi-tier Application in Cloud Foundry
Deploy your Multi-tier Application in Cloud Foundry
 
DrupalGap. How to create native application for mobile devices based on Drupa...
DrupalGap. How to create native application for mobile devices based on Drupa...DrupalGap. How to create native application for mobile devices based on Drupa...
DrupalGap. How to create native application for mobile devices based on Drupa...
 
DrupalGap. How to create native application for mobile devices based on Drupa...
DrupalGap. How to create native application for mobile devices based on Drupa...DrupalGap. How to create native application for mobile devices based on Drupa...
DrupalGap. How to create native application for mobile devices based on Drupa...
 
Best Practices for Moving to Drupal 9
Best Practices for Moving to Drupal 9Best Practices for Moving to Drupal 9
Best Practices for Moving to Drupal 9
 
Drupalcon 2023 - How Drupal builds your pages.pdf
Drupalcon 2023 - How Drupal builds your pages.pdfDrupalcon 2023 - How Drupal builds your pages.pdf
Drupalcon 2023 - How Drupal builds your pages.pdf
 
2023 - Drupalcon - How Drupal builds your pages
2023 - Drupalcon - How Drupal builds your pages2023 - Drupalcon - How Drupal builds your pages
2023 - Drupalcon - How Drupal builds your pages
 
Migrating data to drupal 8
Migrating data to drupal 8Migrating data to drupal 8
Migrating data to drupal 8
 
Headless Drupal
Headless DrupalHeadless Drupal
Headless Drupal
 
AngularJS
AngularJSAngularJS
AngularJS
 
Best Practices for Moving to Drupal 9
Best Practices for Moving to Drupal 9Best Practices for Moving to Drupal 9
Best Practices for Moving to Drupal 9
 
RESTful web services
RESTful web servicesRESTful web services
RESTful web services
 
[drupalday2017] - Drupal come frontend che consuma servizi: HTTP Client Manager
[drupalday2017] - Drupal come frontend che consuma servizi: HTTP Client Manager[drupalday2017] - Drupal come frontend che consuma servizi: HTTP Client Manager
[drupalday2017] - Drupal come frontend che consuma servizi: HTTP Client Manager
 
Convert modules from 6.x to 7.x
Convert modules from 6.x to 7.xConvert modules from 6.x to 7.x
Convert modules from 6.x to 7.x
 
Drupal 8 simple page: Mi primer proyecto en Drupal 8.
Drupal 8 simple page: Mi primer proyecto en Drupal 8.Drupal 8 simple page: Mi primer proyecto en Drupal 8.
Drupal 8 simple page: Mi primer proyecto en Drupal 8.
 
RedisConf18 - Writing modular & encapsulated Redis code
RedisConf18 - Writing modular & encapsulated Redis codeRedisConf18 - Writing modular & encapsulated Redis code
RedisConf18 - Writing modular & encapsulated Redis code
 
Advanced moduledevelopment d6_slideshare
Advanced moduledevelopment d6_slideshareAdvanced moduledevelopment d6_slideshare
Advanced moduledevelopment d6_slideshare
 
Adriano Di Luzio - Davvy - PyconSEI Talk
Adriano Di Luzio - Davvy - PyconSEI TalkAdriano Di Luzio - Davvy - PyconSEI Talk
Adriano Di Luzio - Davvy - PyconSEI Talk
 
Drupal security
Drupal securityDrupal security
Drupal security
 

Último

On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024APNIC
 
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$kojalkojal131
 
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
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Callshivangimorya083
 
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 Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableSeo
 
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...Neha Pandey
 
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Delhi Call girls
 
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Call Girls in Nagpur High Profile
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...APNIC
 
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663Call Girls Mumbai
 
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
 

Último (20)

On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024
 
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
Call Girls Dubai Prolapsed O525547819 Call Girls In Dubai Princes$
 
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
 
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Defence Colony Delhi 💯Call Us 🔝8264348440🔝
 
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 6 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip CallDelhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
Delhi Call Girls Rohini 9711199171 ☎✔👌✔ Whatsapp Hard And Sexy Vip Call
 
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 Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
 
@9999965857 🫦 Sexy Desi Call Girls Laxmi Nagar 💓 High Profile Escorts Delhi 🫶
@9999965857 🫦 Sexy Desi Call Girls Laxmi Nagar 💓 High Profile Escorts Delhi 🫶@9999965857 🫦 Sexy Desi Call Girls Laxmi Nagar 💓 High Profile Escorts Delhi 🫶
@9999965857 🫦 Sexy Desi Call Girls Laxmi Nagar 💓 High Profile Escorts Delhi 🫶
 
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
Russian Call Girls in %(+971524965298  )#  Call Girls in DubaiRussian Call Girls in %(+971524965298  )#  Call Girls in Dubai
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
 
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
𓀤Call On 7877925207 𓀤 Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
 
(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
 
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 22 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
 
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
 
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...Top Rated  Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
Top Rated Pune Call Girls Daund ⟟ 6297143586 ⟟ Call Me For Genuine Sex Servi...
 
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
'Future Evolution of the Internet' delivered by Geoff Huston at Everything Op...
 
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
✂️ 👅 Independent Andheri Escorts With Room Vashi Call Girls 💃 9004004663
 
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.
 
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...
 

Build a Restfull app using drupal

  • 1. MAY 29 & 30, 2014 Barcelona @alvar0hurtad0 Drupal’s API
  • 2.
  • 3. SO
  • 4. SO
  • 5. SO
  • 7.
  • 8. W
  • 9.
  • 10. T
  • 20.
  • 21. 7 8
  • 23. 7 8 IM • MULTILINGUAL • UX/ADMINISTRATION EXPERIENCE • MOBILE FRIENDLY • CONFIGURATION MANAGEMENT • WEB SERVICES
  • 26. Photo: Carlos Francisco Peña D • LAYOUT CLICK BY CLICK • DATA MODEL CLICK BY CLICK • DATABASE QUERYS CLICK BY CLICK • TRIGGERS AND ACTIONS … • USER PERMISSIONS … • WEB SERVICES CLICK BY CLICK
  • 27. Photo: Carlos Francisco Peña DATA MODEL
  • 28. Photo: Carlos Francisco Peña DATA MODEL
  • 29. Photo: Carlos Francisco Peña DATA MODEL
  • 30. Photo: Carlos Francisco Peña DATA MODEL 
 CONTENT MODELING • CONTENT TYPES • COMMENTS • USER PROFILES • COMMERCE PRODUCTS • ….
  • 44. SERVICES AUTHENTICATION IN CORE • HTTP basic authentication • Cookie
  • 45. SERVICES AUTHENTICATION IN CORE • HTTP basic authentication • Cookie CONTRIBUTED MODULE • Oauth
  • 46. SHOW ME THE CODE
  • 47. SHOW ME THE CODE 
 CURL curl -H "Accept: application/hal+json" --request GET http://drupal-8.localhost/node/1
  • 48. SHOW ME THE CODE 
 CURL curl -H "Accept: application/hal+json" --request GET http://drupal-8.localhost/node/1 
 Guzzle <?php use GuzzleHttpClient; $client = new Client('http://drupal-8.localhost'); // If in a Drupal environment use the HTTP client service. $client = Drupal::httpClient()->setBaseUrl('http://drupal-8.localhost'); $request = $client->get('node/1'); $request->addHeader('Accept', 'application/hal+json'); $response = $request->send()->json(); print_r($response); ?>
  • 49. SHOW ME THE CODE 
 CURL curl -H "Accept: application/hal+json" --request GET http://drupal-8.localhost/node/1 
 Guzzle <?php use GuzzleHttpClient; $client = new Client('http://drupal-8.localhost'); // If in a Drupal environment use the HTTP client service. $client = Drupal::httpClient()->setBaseUrl('http://drupal-8.localhost'); $request = $client->get('node/1'); $request->addHeader('Accept', 'application/hal+json'); $response = $request->send()->json(); print_r($response); ?> 
 CURL curl --include --request POST --user cleverFucker:secret --header 'Content-type: application/hal+json' http:// drupal-8.localhost/entity/node --data-binary '{"_links":{"type":{"href":"http:// drupal-8.localhost/rest/type/node/page"}}, "title": [{"value":"APIdaysBNC"}]}'
  • 50. SHOW ME THE CODE 
 CURL curl -H "Accept: application/hal+json" --request GET http://drupal-8.localhost/node/1 
 Guzzle <?php use GuzzleHttpClient; $client = new Client('http://drupal-8.localhost'); // If in a Drupal environment use the HTTP client service. $client = Drupal::httpClient()->setBaseUrl('http://drupal-8.localhost'); $request = $client->get('node/1'); $request->addHeader('Accept', 'application/hal+json'); $response = $request->send()->json(); print_r($response); ?> 
 CURL curl --include --request POST --user cleverFucker:secret --header 'Content-type: application/hal+json' http:// drupal-8.localhost/entity/node --data-binary '{"_links":{"type":{"href":"http:// drupal-8.localhost/rest/type/node/page"}}, "title": [{"value":"APIdaysBNC"}]}' 
 Guzzle (I) <?php use GuzzleHttpClient; $client = new Client('http://drupal-8.localhost'); $client = Drupal::httpClient()->setBaseUrl('http://drupal-8.localhost'); $node = array( '_links' => array( 'type' => array( 'href' => 'http://drupal-8.localhost/rest/type/node/page' ) ), 'title' => array(0 => array('value' => 'New node title')), );
  • 51. SHOW ME THE CODE 
 CURL curl -H "Accept: application/hal+json" --request GET http://drupal-8.localhost/node/1 
 Guzzle <?php use GuzzleHttpClient; $client = new Client('http://drupal-8.localhost'); // If in a Drupal environment use the HTTP client service. $client = Drupal::httpClient()->setBaseUrl('http://drupal-8.localhost'); $request = $client->get('node/1'); $request->addHeader('Accept', 'application/hal+json'); $response = $request->send()->json(); print_r($response); ?> 
 CURL curl --include --request POST --user cleverFucker:secret --header 'Content-type: application/hal+json' http:// drupal-8.localhost/entity/node --data-binary '{"_links":{"type":{"href":"http:// drupal-8.localhost/rest/type/node/page"}}, "title": [{"value":"APIdaysBNC"}]}' 
 Guzzle (I) <?php use GuzzleHttpClient; $client = new Client('http://drupal-8.localhost'); $client = Drupal::httpClient()->setBaseUrl('http://drupal-8.localhost'); $node = array( '_links' => array( 'type' => array( 'href' => 'http://drupal-8.localhost/rest/type/node/page' ) ), 'title' => array(0 => array('value' => 'New node title')), ); 
 Guzzle (II) $data = json_encode($node); $response = $client->post('entity/node', array( 'Content-type' => 'application/hal+json', ), $data) // Username and password for HTTP Basic Authentication. ->setAuth('klausi', 'secret') ->send(); if ($response->getStatusCode() == 201) { print 'Node creation successful!'; } ?>
  • 52. SOAP?
  • 53. SOAP?
  • 54. SOAP?
  • 55. QUESTIONS !!! ?¿? !!! I’ve a question
  • 57.
  • 58.