Introducing 

Prezi AI.

Your new presentation assistant.

Refine, enhance, and tailor your content, source relevant images, and edit visuals quicker than ever before.

Loading…
Transcript

Web Services

  • A mobile phone app retrieves recent news nodes
  • On-site Javascript creates taxonomy terms from user input
  • Deploying staging content entities to the production site
  • A public REST API that allows clients to place commerce orders
  • A private REST API to migrate third party data into Drupal
  • Connecting Drupal to external systems
  • Anything for which someone uses Kimono Labs on your site!

"I'm not only the Hair Club president, but I'm also a client."

RESTful API Modules in Drupal 8 core

  • RESTful Web Services (REST module)
  • Serialization module
  • HAL module
  • HTTP Basic Authentication module

Everything and more will be linked

Get a Specific Node

Hypermedia

http://www.infoq.com/news/2011/06/Is-REST-Successful

as the

Engine

benjamin melançon

agaric

a web technology collective

curl -H "Accept: application/hal+json" --request GET \

http://drupal-8.localhost/entity/node/1

{"_links":{"self":{"href":"http:\/\/definitive8dev.devcloud.acquia-sites.com\/node\/21"},"type":{"href":"http:\/\/definitive8dev.devcloud.acquia-sites.com\/rest\/type\/node\/summer_camp"},"http:\/\/definitive8dev.devcloud.acquia-sites.com\/rest\/relation\/node\/summer_camp\/uid":[{"href":"http:\/\/definitive8dev.devcloud.acquia-sites.com\/user\/6","lang":"en"}],"http:\/\/definitive8dev.devcloud.acquia-sites.com\/rest\/relation\/node\/summer_camp\/revision_uid":[{"href":"http:\/\/definitive8dev.devcloud.acquia-sites.com\/user\/0"}],"http:\/\/definitive8dev.devcloud.acquia-sites.com\/rest\/relation\/node\/summer_camp\/field_activity_type":[{"href":"http:\/\/definitive8dev.devcloud.acquia-sites.com\/node\/26"}],"http:\/\/definitive8dev.devcloud.acquia-sites.com\/rest\/relation\/node\/summer_camp\/field_featured_picture":[{"href":""}]},"uuid":[{"value":"dd68c904-997b-4749-9553-839295769129"}],"type":[{"target_id":"summer_camp"}],"langcode":[{"value":"en"}],"title":[{"value":"Camp Arrowhead","lang":"en"}],"_embedded":{"http:\/\/definitive8dev.devcloud.acquia-sites.com\/rest\/relation\/node\/summer_camp\/uid":[{"_links":{"self":{"href":"http:\/\/definitive8dev.devcloud.acquia-sites.com\/user\/6"},"type":{"href":"http:\/\/definitive8dev.devcloud.acquia-sites.com\/rest\/type\/user\/user"}},"uuid":[{"value":"51567066-87c8-46da-8f00-cd89030d45b7"}],"lang":"en"}],"http:\/\/definitive8dev.devcloud.acquia-sites.com\/rest\/relation\/node\/summer_camp\/revision_uid":[{"_links":{"self":{"href":"http:\/\/definitive8dev.devcloud.acquia-sites.com\/user\/0"},"type":{"href":"http:\/\/definitive8dev.devcloud.acquia-sites.com\/rest\/type\/user\/user"}},"uuid":[{"value":"664602a4-9c61-47cc-af00-c2e4a62fc413"}]}],"http:\/\/definitive8dev.devcloud.acquia-sites.com\/rest\/relation\/node\/summer_camp\/field_activity_type":[{"_links":{"self":{"href":"http:\/\/definitive8dev.devcloud.acquia-sites.com\/node\/26"},"type":{"href":"http:\/\/definitive8dev.devcloud.acquia-sites.com\/rest\/type\/node\/activity_type"}},"uuid":[{"value":"8004a05a-ee6d-4ac8-8908-08ec67e902ed"}]}],"http:\/\/definitive8dev.devcloud.acquia-sites.com\/rest\/relation\/node\/summer_camp\/field_featured_picture":[{"_links":{"self":{"href":""},"type":{"href":"http:\/\/definitive8dev.devcloud.acquia-sites.com\/rest\/type\/file\/file"}},"uuid":[{"value":"8659c5dd-c6b9-4771-9a00-ba6cb8ecfe17"}],"uri":[{"value":"http:\/\/definitive8dev.devcloud.acquia-sites.com\/"}]}]},"status":[{"value":"1","lang":"en"}],"created":[{"value":"1397150557","lang":"en"}],"changed":[{"value":"1397225383","lang":"en"}],"promote":[{"value":"1","lang":"en"}],"sticky":[{"value":"0","lang":"en"}],"revision_timestamp":[{"value":"0"}],"log":[{"value":"","lang":"en"}],"body":[{"value":"<p>Located in Natick, MA on the wooded shores of Lake Cochituate, Camp Arrowhead offers a six-week day camp and one-week residential camp that serves children and adults with special needs.<\/p>\r\n\r\n<p>Since 1958, our campers have enjoyed a warm and caring environment where their individual needs are met, while they learn skills to help promote sociability and independence.<\/p>\r\n\r\n<p>The philosophy of Camp Arrowhead is to strengthen each camper&rsquo;s self esteem and foster interaction with peers and staff within the Camp Arrowhead community.&nbsp; Arrowhead provides social and physical recreation for individuals with a variety of special needs who are five years or older.&nbsp; The program is sponsored by the Natick Recreation and Parks Department with the Parents Association of the Handicapped, Inc.&nbsp; The day camp portion runs for six weeks at the Amputee Veteran&rsquo;s Center from July 1, 2013 to August 9, 2013.&nbsp; The residential portion entails a five day\/four night trip to Lion&rsquo;s Camp Pride in New Durham, NH following the end of day camp.&nbsp; Information about dates and fees can be found under the <span><a href=\"http:\/\/camparrowheadnatick.com\/camp\/\" title=\"Day Camp &amp; Residential\">Day Camp &amp; Residential<\/a><\/span> tab.&nbsp; For any additional questions please do not hesitate to contact us.<\/p>\r\n","format":"basic_html","summary":""}]}

send complaints to

ben@agaric.com

and dissenting tweets to

@mlncn

REST

data.agaric.com/powering-your-api-drupal-8

Representational State Transfer

of

Application State

Made Possible By

Also known as HATEOAS

but probably easier to remember as HEAS

  • Lin Clark, gittip.com/linclark
  • Klaus Purer, gittip.com/klausi

Constraints

  • Client-Server
  • Stateless
  • Cacheable
  • Layered system
  • Code on Demand (optional)
  • Uniform interface

Powering APIs with Drupal 8

ask@agaric.com

Learn more about creating dynamic, engaging presentations with Prezi