SlideShare a Scribd company logo
Introduction to the
WordPress REST API
Nick Batik
Nick Batik PleiadesServices.com @nick_batik
What Is an API?
Nick Batik PleiadesServices.com @nick_batik
What Is an API?
• API is short for Application Program Interface.
• An agreed set of standardized ways that
a particular software program can be used;
• The rules define how one program can talk
to a another, and how it will respond.
Nick Batik PleiadesServices.com @nick_batik
What Is an API?
ApplicationAPI
I Want
Informatio
n
From You
What info I want
The app’s info
I Have
Informatio
n
For You
What info the app needs
Did the app accept it?
Nick Batik PleiadesServices.com @nick_batik
Classic Problems of APIs
• How do you know the rules?
• The content is different for each rule
• You can’t change the rules
Nick Batik PleiadesServices.com @nick_batik
What is REST?
• Uniform Interface
• Resources
• Representations
• Hypermedia (Links)
• Metadata
Nick Batik PleiadesServices.com @nick_batik
What is REST?
• Stateless
• Cacheable
• Client-Server
• Layered System
• Code on Demand (optional)
Nick Batik PleiadesServices.com @nick_batik
What is a REST API?
A REST API defines a set of functions developers can
use to perform requests and receive responses via HTTP
protocol such as GET and POST.
Nick Batik PleiadesServices.com @nick_batik
What is a REST API?
Databases have 4 primary function - CRUD:
• Create
• Read
• Update
• Delete
Nick Batik PleiadesServices.com @nick_batik
What is a REST API?
The REST API implements the 4 main
database functions in through the HTTP protocol:
• Create = PUT with a new URI
• POST to a base URI returning a newly created
URI
• Read = GET
• Update = PUT with an existing URI
• Delete = DELETE
Nick Batik PleiadesServices.com @nick_batik
What is a REST API?
REST API turns the internet
into the world’s largest database
Nick Batik PleiadesServices.com @nick_batik
Acronym, Initialization, and Other Jargon
• HTTP Verbs
• HTTP Methods
• URLS, routes and Endpoints
• Representations
• Response Codes
• JSON
Nick Batik PleiadesServices.com @nick_batik
HTTP Verbs
• GET
• PUT
• DELETE
•POST
• HEAD
• OPTIONS
Nick Batik PleiadesServices.com @nick_batik
HTTP Methods
• Safe methods
• Unsafe methods
• Idempotent methods
Nick Batik PleiadesServices.com @nick_batik
URLs, routes and Endpoints
• Routes are URLs
• Endpoints - actions taken (HTTP verb) on the URL
e.g. GET http://example.com/wp-json/wp/v2/posts/123
POST http://example.com/wp-json/wp/v2/posts/123
• “GET” and “POST” are endpoints
•“wp/v2/posts/123” is the route
• /wp-json/ is the API “base”
Nick Batik PleiadesServices.com @nick_batik
URLs, routes and Endpoints
You can expose services in different endpoints:
http://www.example.com/soap
http://www.example.com/json
http://www.example.com/xml
Nick Batik PleiadesServices.com @nick_batik
Representations
• The HTTP client and HTTP server exchange
information about resources identified by URLs
• Both request and response contain a representation of
the resource
•The header and the body are part of the
representation
•HTTP headers contain metadata, defined by the HTTP
spec
Nick Batik PleiadesServices.com @nick_batik
Representations
• The HTTP response should specify the content type of
the body, example possibilities include:
•HTML
•XML
•XHTML
•SOAP+XM
•JSON
Nick Batik PleiadesServices.com @nick_batik
Response Codes
• 405 Method Not Allowed
• 409 Conflict
• 410 Gone
• 500 Internal Server Error
• 501 Not Implemented
• 200 OK
• 201 Created
• 400 Bad Request
•401 Unauthorized
• 404 Not Found
Nick Batik PleiadesServices.com @nick_batik
JSON
• JSON: JavaScript Object Notation.
• JSON is a syntax for storing and exchanging data.
• Human readable / writable
•Machine parse-able
Nick Batik PleiadesServices.com @nick_batik
JSON - Example
{"employees":[
{"firstName":"John", "lastName":"Doe"},
{"firstName":"Anna", "lastName":"Smith"},
{"firstName":"Peter", "lastName":"Jones"}
]}
Nick Batik PleiadesServices.com @nick_batik
JSON - Example
{"menu": {
"id": "file",
"value": "File",
"popup": {
"menuitem": [
{"value": "New", "onclick": "CreateNewDoc()"},
{"value": "Open", "onclick": "OpenDoc()"},
{"value": "Close", "onclick": "CloseDoc()"}
]
}
}}
Nick Batik PleiadesServices.com @nick_batik
The WordPress Implementation of REST API
• WordPress as a Data Store
• WordPress as an Editing Interface
• Access and Authentication
Nick Batik PleiadesServices.com @nick_batik
The WordPress Implementation of REST API
WordPress as a Data Store
https://css-tricks.com/thoughts-on-an-api-first-wordpress/
Nick Batik PleiadesServices.com @nick_batik
The WordPress Implementation of REST API
WordPress as an Editing Interface
• WYSIWYG / Text Editor
• Media Library
• Plugin Functionality
• Database Customization
• Custom Interfaces such as Calypso
Nick Batik PleiadesServices.com @nick_batik
The WordPress Implementation of REST API
Access and Authentication
• cookie authentication
• OAuth authentication
•basic authentication
Nick Batik PleiadesServices.com @nick_batik
WordPress REST API – Conclusion
• Open WordPress to new front-end platforms
• Heralds a new era in content exchange
• Introduces new levels of complexity

More Related Content

What's hot

Pragmatic REST APIs
Pragmatic REST APIsPragmatic REST APIs
Pragmatic REST APIs
amesar0
 
React & GraphQL
React & GraphQLReact & GraphQL
React & GraphQL
Nikolas Burk
 
Diving into GraphQL, React & Apollo
Diving into GraphQL, React & ApolloDiving into GraphQL, React & Apollo
Diving into GraphQL, React & Apollo
Nikolas Burk
 
Log File Analysis: The most powerful tool in your SEO toolkit
Log File Analysis: The most powerful tool in your SEO toolkitLog File Analysis: The most powerful tool in your SEO toolkit
Log File Analysis: The most powerful tool in your SEO toolkit
Tom Bennet
 
GraphQL with Spring Boot
GraphQL with Spring BootGraphQL with Spring Boot
GraphQL with Spring Boot
Krzysztof Pawlowski
 
Pragmatic REST: recent trends in API design
Pragmatic REST: recent trends in API designPragmatic REST: recent trends in API design
Pragmatic REST: recent trends in API design
Marsh Gardiner
 
Building Your First App with MongoDB
Building Your First App with MongoDBBuilding Your First App with MongoDB
Building Your First App with MongoDB
MongoDB
 
JavaScript Frameworks for SharePoint add-ins Cambridge
JavaScript Frameworks for SharePoint add-ins CambridgeJavaScript Frameworks for SharePoint add-ins Cambridge
JavaScript Frameworks for SharePoint add-ins Cambridge
Sonja Madsen
 
A Survey of Elasticsearch Usage
A Survey of Elasticsearch UsageA Survey of Elasticsearch Usage
A Survey of Elasticsearch Usage
Greg Brown
 
Dev Jumpstart: Build Your First App with MongoDB
Dev Jumpstart: Build Your First App with MongoDBDev Jumpstart: Build Your First App with MongoDB
Dev Jumpstart: Build Your First App with MongoDB
MongoDB
 
Building Beautiful REST APIs with ASP.NET Core
Building Beautiful REST APIs with ASP.NET CoreBuilding Beautiful REST APIs with ASP.NET Core
Building Beautiful REST APIs with ASP.NET Core
Stormpath
 
REST and ASP.NET Web API (Milan)
REST and ASP.NET Web API (Milan)REST and ASP.NET Web API (Milan)
REST and ASP.NET Web API (Milan)Jef Claes
 
Reviewing RESTful Web Apps
Reviewing RESTful Web AppsReviewing RESTful Web Apps
Reviewing RESTful Web Apps
Takuto Wada
 
Hypermedia: The Missing Element to Building Adaptable Web APIs in Rails
Hypermedia: The Missing Element to Building Adaptable Web APIs in RailsHypermedia: The Missing Element to Building Adaptable Web APIs in Rails
Hypermedia: The Missing Element to Building Adaptable Web APIs in Rails
Toru Kawamura
 
JSON API: Não reinvente a roda
JSON API: Não reinvente a rodaJSON API: Não reinvente a roda
JSON API: Não reinvente a roda
Pedro Cavalheiro
 
Building a Realtime Chat with React & GraphQL Subscriptions
Building a Realtime Chat with React & GraphQL Subscriptions Building a Realtime Chat with React & GraphQL Subscriptions
Building a Realtime Chat with React & GraphQL Subscriptions
Nikolas Burk
 
Library Mashups & APIs
Library Mashups & APIsLibrary Mashups & APIs
Library Mashups & APIslibrarywebchic
 
The never-ending REST API design debate
The never-ending REST API design debateThe never-ending REST API design debate
The never-ending REST API design debate
Restlet
 
DomainTools Fingerprinting Threat Actors with Web Assets
DomainTools Fingerprinting Threat Actors with Web AssetsDomainTools Fingerprinting Threat Actors with Web Assets
DomainTools Fingerprinting Threat Actors with Web Assets
DomainTools
 
Episode 8 - Path To Code - Integrate Salesforce with external system using R...
Episode 8  - Path To Code - Integrate Salesforce with external system using R...Episode 8  - Path To Code - Integrate Salesforce with external system using R...
Episode 8 - Path To Code - Integrate Salesforce with external system using R...
Jitendra Zaa
 

What's hot (20)

Pragmatic REST APIs
Pragmatic REST APIsPragmatic REST APIs
Pragmatic REST APIs
 
React & GraphQL
React & GraphQLReact & GraphQL
React & GraphQL
 
Diving into GraphQL, React & Apollo
Diving into GraphQL, React & ApolloDiving into GraphQL, React & Apollo
Diving into GraphQL, React & Apollo
 
Log File Analysis: The most powerful tool in your SEO toolkit
Log File Analysis: The most powerful tool in your SEO toolkitLog File Analysis: The most powerful tool in your SEO toolkit
Log File Analysis: The most powerful tool in your SEO toolkit
 
GraphQL with Spring Boot
GraphQL with Spring BootGraphQL with Spring Boot
GraphQL with Spring Boot
 
Pragmatic REST: recent trends in API design
Pragmatic REST: recent trends in API designPragmatic REST: recent trends in API design
Pragmatic REST: recent trends in API design
 
Building Your First App with MongoDB
Building Your First App with MongoDBBuilding Your First App with MongoDB
Building Your First App with MongoDB
 
JavaScript Frameworks for SharePoint add-ins Cambridge
JavaScript Frameworks for SharePoint add-ins CambridgeJavaScript Frameworks for SharePoint add-ins Cambridge
JavaScript Frameworks for SharePoint add-ins Cambridge
 
A Survey of Elasticsearch Usage
A Survey of Elasticsearch UsageA Survey of Elasticsearch Usage
A Survey of Elasticsearch Usage
 
Dev Jumpstart: Build Your First App with MongoDB
Dev Jumpstart: Build Your First App with MongoDBDev Jumpstart: Build Your First App with MongoDB
Dev Jumpstart: Build Your First App with MongoDB
 
Building Beautiful REST APIs with ASP.NET Core
Building Beautiful REST APIs with ASP.NET CoreBuilding Beautiful REST APIs with ASP.NET Core
Building Beautiful REST APIs with ASP.NET Core
 
REST and ASP.NET Web API (Milan)
REST and ASP.NET Web API (Milan)REST and ASP.NET Web API (Milan)
REST and ASP.NET Web API (Milan)
 
Reviewing RESTful Web Apps
Reviewing RESTful Web AppsReviewing RESTful Web Apps
Reviewing RESTful Web Apps
 
Hypermedia: The Missing Element to Building Adaptable Web APIs in Rails
Hypermedia: The Missing Element to Building Adaptable Web APIs in RailsHypermedia: The Missing Element to Building Adaptable Web APIs in Rails
Hypermedia: The Missing Element to Building Adaptable Web APIs in Rails
 
JSON API: Não reinvente a roda
JSON API: Não reinvente a rodaJSON API: Não reinvente a roda
JSON API: Não reinvente a roda
 
Building a Realtime Chat with React & GraphQL Subscriptions
Building a Realtime Chat with React & GraphQL Subscriptions Building a Realtime Chat with React & GraphQL Subscriptions
Building a Realtime Chat with React & GraphQL Subscriptions
 
Library Mashups & APIs
Library Mashups & APIsLibrary Mashups & APIs
Library Mashups & APIs
 
The never-ending REST API design debate
The never-ending REST API design debateThe never-ending REST API design debate
The never-ending REST API design debate
 
DomainTools Fingerprinting Threat Actors with Web Assets
DomainTools Fingerprinting Threat Actors with Web AssetsDomainTools Fingerprinting Threat Actors with Web Assets
DomainTools Fingerprinting Threat Actors with Web Assets
 
Episode 8 - Path To Code - Integrate Salesforce with external system using R...
Episode 8  - Path To Code - Integrate Salesforce with external system using R...Episode 8  - Path To Code - Integrate Salesforce with external system using R...
Episode 8 - Path To Code - Integrate Salesforce with external system using R...
 

Viewers also liked

Flagler accounting flyer
Flagler accounting flyerFlagler accounting flyer
Flagler accounting flyer
Tammy Smith Jimenez
 
Financing for the Grand Inga Dam Project
Financing for the Grand Inga Dam ProjectFinancing for the Grand Inga Dam Project
Financing for the Grand Inga Dam Project
Florian da Silva
 
Photoshop Narrative
Photoshop NarrativePhotoshop Narrative
Photoshop Narrative
Jordan Graley
 
8th PreAlg - L66--Mar1
8th PreAlg - L66--Mar18th PreAlg - L66--Mar1
8th PreAlg - L66--Mar1jdurst65
 
Hooked on photos: the power of visuals in content marketing
Hooked on photos: the power of visuals in content marketingHooked on photos: the power of visuals in content marketing
Hooked on photos: the power of visuals in content marketing
Communicatto Inc.
 
Educating your target audience: build awareness through digital media
Educating your target audience: build awareness through digital mediaEducating your target audience: build awareness through digital media
Educating your target audience: build awareness through digital media
Communicatto Inc.
 
ACC 544 Final Exam 2015 version
ACC 544 Final Exam 2015 versionACC 544 Final Exam 2015 version
ACC 544 Final Exam 2015 version
mahallbethena
 
เทคโนโลยีสารสนเทศและการสื่อสารPim
เทคโนโลยีสารสนเทศและการสื่อสารPimเทคโนโลยีสารสนเทศและการสื่อสารPim
เทคโนโลยีสารสนเทศและการสื่อสารPim
proncharita
 
Bagaimana untuk menjadibahagia
Bagaimana untuk menjadibahagiaBagaimana untuk menjadibahagia
Bagaimana untuk menjadibahagia
Husrinsamiun
 
Oleg+olga product meetup
Oleg+olga product meetupOleg+olga product meetup
Oleg+olga product meetupOleg Parinov
 
FAQ: planning and building a website
FAQ: planning and building a websiteFAQ: planning and building a website
FAQ: planning and building a website
Communicatto Inc.
 
SDOA 3.2 The Language of Design and Corporate Stakeholders
SDOA 3.2 The Language of Design and Corporate StakeholdersSDOA 3.2 The Language of Design and Corporate Stakeholders
SDOA 3.2 The Language of Design and Corporate Stakeholders
Florian Vollmer
 
6.5 strengths and challenges
6.5 strengths and challenges6.5 strengths and challenges
6.5 strengths and challenges
A M
 
Shot list
Shot listShot list
Shot list
joshmacqueen2
 
Staying Online: Keeping Your Website Safe and Secure
Staying Online: Keeping Your Website Safe and SecureStaying Online: Keeping Your Website Safe and Secure
Staying Online: Keeping Your Website Safe and Secure
Liam Dempsey
 
cellphone based control of electrical equipment
cellphone based control of electrical equipmentcellphone based control of electrical equipment
cellphone based control of electrical equipmentRohit Sharma
 
Tips for home buyers by alpine housing
Tips for home buyers by alpine housingTips for home buyers by alpine housing
Tips for home buyers by alpine housing
AlpineHousing
 

Viewers also liked (17)

Flagler accounting flyer
Flagler accounting flyerFlagler accounting flyer
Flagler accounting flyer
 
Financing for the Grand Inga Dam Project
Financing for the Grand Inga Dam ProjectFinancing for the Grand Inga Dam Project
Financing for the Grand Inga Dam Project
 
Photoshop Narrative
Photoshop NarrativePhotoshop Narrative
Photoshop Narrative
 
8th PreAlg - L66--Mar1
8th PreAlg - L66--Mar18th PreAlg - L66--Mar1
8th PreAlg - L66--Mar1
 
Hooked on photos: the power of visuals in content marketing
Hooked on photos: the power of visuals in content marketingHooked on photos: the power of visuals in content marketing
Hooked on photos: the power of visuals in content marketing
 
Educating your target audience: build awareness through digital media
Educating your target audience: build awareness through digital mediaEducating your target audience: build awareness through digital media
Educating your target audience: build awareness through digital media
 
ACC 544 Final Exam 2015 version
ACC 544 Final Exam 2015 versionACC 544 Final Exam 2015 version
ACC 544 Final Exam 2015 version
 
เทคโนโลยีสารสนเทศและการสื่อสารPim
เทคโนโลยีสารสนเทศและการสื่อสารPimเทคโนโลยีสารสนเทศและการสื่อสารPim
เทคโนโลยีสารสนเทศและการสื่อสารPim
 
Bagaimana untuk menjadibahagia
Bagaimana untuk menjadibahagiaBagaimana untuk menjadibahagia
Bagaimana untuk menjadibahagia
 
Oleg+olga product meetup
Oleg+olga product meetupOleg+olga product meetup
Oleg+olga product meetup
 
FAQ: planning and building a website
FAQ: planning and building a websiteFAQ: planning and building a website
FAQ: planning and building a website
 
SDOA 3.2 The Language of Design and Corporate Stakeholders
SDOA 3.2 The Language of Design and Corporate StakeholdersSDOA 3.2 The Language of Design and Corporate Stakeholders
SDOA 3.2 The Language of Design and Corporate Stakeholders
 
6.5 strengths and challenges
6.5 strengths and challenges6.5 strengths and challenges
6.5 strengths and challenges
 
Shot list
Shot listShot list
Shot list
 
Staying Online: Keeping Your Website Safe and Secure
Staying Online: Keeping Your Website Safe and SecureStaying Online: Keeping Your Website Safe and Secure
Staying Online: Keeping Your Website Safe and Secure
 
cellphone based control of electrical equipment
cellphone based control of electrical equipmentcellphone based control of electrical equipment
cellphone based control of electrical equipment
 
Tips for home buyers by alpine housing
Tips for home buyers by alpine housingTips for home buyers by alpine housing
Tips for home buyers by alpine housing
 

Similar to Austin Day of Rest - Introduction

Coding 100-session-slides
Coding 100-session-slidesCoding 100-session-slides
Coding 100-session-slides
Cisco DevNet
 
RESTful web
RESTful webRESTful web
RESTful web
Alvin Qi
 
Restful风格ž„web服务架构
Restful风格ž„web服务架构Restful风格ž„web服务架构
Restful风格ž„web服务架构
Benjamin Tan
 
Web Services PHP Tutorial
Web Services PHP TutorialWeb Services PHP Tutorial
Web Services PHP Tutorial
Lorna Mitchell
 
REST API Recommendations
REST API RecommendationsREST API Recommendations
REST API RecommendationsJeelani Shaik
 
Building RESTful APIs
Building RESTful APIsBuilding RESTful APIs
Building RESTful APIs
Silota Inc.
 
API Testing. Streamline your testing process.
API Testing. Streamline your testing process.API Testing. Streamline your testing process.
API Testing. Streamline your testing process.
Andrey Oleynik
 
Externalizing Authorization in Micro Services world
Externalizing Authorization in Micro Services worldExternalizing Authorization in Micro Services world
Externalizing Authorization in Micro Services world
Sitaraman Lakshminarayanan
 
Understanding and programming the SharePoint REST API
Understanding and programming the SharePoint REST APIUnderstanding and programming the SharePoint REST API
Understanding and programming the SharePoint REST API
Chris Beckett
 
Api fundamentals
Api fundamentalsApi fundamentals
Api fundamentals
AgileDenver
 
Best Practice in Web Service Design
Best Practice in Web Service DesignBest Practice in Web Service Design
Best Practice in Web Service Design
Lorna Mitchell
 
Api FUNdamentals #MHA2017
Api FUNdamentals #MHA2017Api FUNdamentals #MHA2017
Api FUNdamentals #MHA2017
JoEllen Carter
 
MongoDB.local Dallas 2019: Pissing Off IT and Delivery: A Tale of 2 ODS's
MongoDB.local Dallas 2019: Pissing Off IT and Delivery: A Tale of 2 ODS'sMongoDB.local Dallas 2019: Pissing Off IT and Delivery: A Tale of 2 ODS's
MongoDB.local Dallas 2019: Pissing Off IT and Delivery: A Tale of 2 ODS's
MongoDB
 
Building Software Backend (Web API)
Building Software Backend (Web API)Building Software Backend (Web API)
Building Software Backend (Web API)
Alexander Goida
 
Don't Loose Sleep - Secure Your Rest - php[tek] 2017
Don't Loose Sleep - Secure Your Rest - php[tek] 2017Don't Loose Sleep - Secure Your Rest - php[tek] 2017
Don't Loose Sleep - Secure Your Rest - php[tek] 2017
Adam Englander
 
Introduction to Restful Web Services
Introduction to Restful Web ServicesIntroduction to Restful Web Services
Introduction to Restful Web Services
weili_at_slideshare
 
Webservices Overview : XML RPC, SOAP and REST
Webservices Overview : XML RPC, SOAP and RESTWebservices Overview : XML RPC, SOAP and REST
Webservices Overview : XML RPC, SOAP and REST
Pradeep Kumar
 
aip-workshop1-dev-tutorial
aip-workshop1-dev-tutorialaip-workshop1-dev-tutorial
aip-workshop1-dev-tutorial
Matthew Vaughn
 
Api crash
Api crashApi crash
Api crash
Hoang Nguyen
 

Similar to Austin Day of Rest - Introduction (20)

Coding 100-session-slides
Coding 100-session-slidesCoding 100-session-slides
Coding 100-session-slides
 
RESTful web
RESTful webRESTful web
RESTful web
 
Restful风格ž„web服务架构
Restful风格ž„web服务架构Restful风格ž„web服务架构
Restful风格ž„web服务架构
 
Web Services PHP Tutorial
Web Services PHP TutorialWeb Services PHP Tutorial
Web Services PHP Tutorial
 
REST API Recommendations
REST API RecommendationsREST API Recommendations
REST API Recommendations
 
Building RESTful APIs
Building RESTful APIsBuilding RESTful APIs
Building RESTful APIs
 
API Testing. Streamline your testing process.
API Testing. Streamline your testing process.API Testing. Streamline your testing process.
API Testing. Streamline your testing process.
 
Externalizing Authorization in Micro Services world
Externalizing Authorization in Micro Services worldExternalizing Authorization in Micro Services world
Externalizing Authorization in Micro Services world
 
Understanding and programming the SharePoint REST API
Understanding and programming the SharePoint REST APIUnderstanding and programming the SharePoint REST API
Understanding and programming the SharePoint REST API
 
Api fundamentals
Api fundamentalsApi fundamentals
Api fundamentals
 
Best Practice in Web Service Design
Best Practice in Web Service DesignBest Practice in Web Service Design
Best Practice in Web Service Design
 
Api FUNdamentals #MHA2017
Api FUNdamentals #MHA2017Api FUNdamentals #MHA2017
Api FUNdamentals #MHA2017
 
MongoDB.local Dallas 2019: Pissing Off IT and Delivery: A Tale of 2 ODS's
MongoDB.local Dallas 2019: Pissing Off IT and Delivery: A Tale of 2 ODS'sMongoDB.local Dallas 2019: Pissing Off IT and Delivery: A Tale of 2 ODS's
MongoDB.local Dallas 2019: Pissing Off IT and Delivery: A Tale of 2 ODS's
 
Building Software Backend (Web API)
Building Software Backend (Web API)Building Software Backend (Web API)
Building Software Backend (Web API)
 
Don't Loose Sleep - Secure Your Rest - php[tek] 2017
Don't Loose Sleep - Secure Your Rest - php[tek] 2017Don't Loose Sleep - Secure Your Rest - php[tek] 2017
Don't Loose Sleep - Secure Your Rest - php[tek] 2017
 
Introduction to Restful Web Services
Introduction to Restful Web ServicesIntroduction to Restful Web Services
Introduction to Restful Web Services
 
Webservices Overview : XML RPC, SOAP and REST
Webservices Overview : XML RPC, SOAP and RESTWebservices Overview : XML RPC, SOAP and REST
Webservices Overview : XML RPC, SOAP and REST
 
aip-workshop1-dev-tutorial
aip-workshop1-dev-tutorialaip-workshop1-dev-tutorial
aip-workshop1-dev-tutorial
 
Api crash
Api crashApi crash
Api crash
 
Api crash
Api crashApi crash
Api crash
 

More from HandsOnWP.com

Building an Information Structure for your WordPress Site
Building an Information Structure for your WordPress SiteBuilding an Information Structure for your WordPress Site
Building an Information Structure for your WordPress Site
HandsOnWP.com
 
How word press themes work 2.19.18
How word press themes work 2.19.18How word press themes work 2.19.18
How word press themes work 2.19.18
HandsOnWP.com
 
Women who-code-wpcms-4-7-17
Women who-code-wpcms-4-7-17Women who-code-wpcms-4-7-17
Women who-code-wpcms-4-7-17
HandsOnWP.com
 
How the WordPress CMS Really Works
How the WordPress CMS Really WorksHow the WordPress CMS Really Works
How the WordPress CMS Really Works
HandsOnWP.com
 
How WordPress Themes Work
How WordPress Themes WorkHow WordPress Themes Work
How WordPress Themes Work
HandsOnWP.com
 
Structuring Processes and Workflows for Your WordPress Business
Structuring Processes and Workflows for Your WordPress BusinessStructuring Processes and Workflows for Your WordPress Business
Structuring Processes and Workflows for Your WordPress Business
HandsOnWP.com
 
Starting Off Right with WordPress- WP-BootCamp
Starting Off Right with WordPress- WP-BootCampStarting Off Right with WordPress- WP-BootCamp
Starting Off Right with WordPress- WP-BootCamp
HandsOnWP.com
 
Expanding Your Freelance Business With Automated Marketing Funnels
Expanding Your Freelance Business With Automated Marketing FunnelsExpanding Your Freelance Business With Automated Marketing Funnels
Expanding Your Freelance Business With Automated Marketing Funnels
HandsOnWP.com
 
How the Wordpress CMS Really Works
How the Wordpress CMS Really WorksHow the Wordpress CMS Really Works
How the Wordpress CMS Really Works
HandsOnWP.com
 
Project management for WordPress Freelancers
Project management for WordPress FreelancersProject management for WordPress Freelancers
Project management for WordPress Freelancers
HandsOnWP.com
 
How Word Press Works
How Word Press WorksHow Word Press Works
How Word Press Works
HandsOnWP.com
 
How to structure a content strategy that works
How to structure a content strategy that worksHow to structure a content strategy that works
How to structure a content strategy that works
HandsOnWP.com
 
Introverted Freelancer Guide To Writing Proposals
Introverted Freelancer Guide To Writing ProposalsIntroverted Freelancer Guide To Writing Proposals
Introverted Freelancer Guide To Writing Proposals
HandsOnWP.com
 
The Introverted Freelancer's Guide to Finding Clients
The Introverted Freelancer's Guide to Finding ClientsThe Introverted Freelancer's Guide to Finding Clients
The Introverted Freelancer's Guide to Finding Clients
HandsOnWP.com
 
A Conversation About the WordPress JSON REST API
A Conversation About the WordPress JSON REST APIA Conversation About the WordPress JSON REST API
A Conversation About the WordPress JSON REST API
HandsOnWP.com
 
E mail marketing
E mail marketingE mail marketing
E mail marketing
HandsOnWP.com
 
Word press meetup getting started
Word press meetup   getting startedWord press meetup   getting started
Word press meetup getting started
HandsOnWP.com
 

More from HandsOnWP.com (17)

Building an Information Structure for your WordPress Site
Building an Information Structure for your WordPress SiteBuilding an Information Structure for your WordPress Site
Building an Information Structure for your WordPress Site
 
How word press themes work 2.19.18
How word press themes work 2.19.18How word press themes work 2.19.18
How word press themes work 2.19.18
 
Women who-code-wpcms-4-7-17
Women who-code-wpcms-4-7-17Women who-code-wpcms-4-7-17
Women who-code-wpcms-4-7-17
 
How the WordPress CMS Really Works
How the WordPress CMS Really WorksHow the WordPress CMS Really Works
How the WordPress CMS Really Works
 
How WordPress Themes Work
How WordPress Themes WorkHow WordPress Themes Work
How WordPress Themes Work
 
Structuring Processes and Workflows for Your WordPress Business
Structuring Processes and Workflows for Your WordPress BusinessStructuring Processes and Workflows for Your WordPress Business
Structuring Processes and Workflows for Your WordPress Business
 
Starting Off Right with WordPress- WP-BootCamp
Starting Off Right with WordPress- WP-BootCampStarting Off Right with WordPress- WP-BootCamp
Starting Off Right with WordPress- WP-BootCamp
 
Expanding Your Freelance Business With Automated Marketing Funnels
Expanding Your Freelance Business With Automated Marketing FunnelsExpanding Your Freelance Business With Automated Marketing Funnels
Expanding Your Freelance Business With Automated Marketing Funnels
 
How the Wordpress CMS Really Works
How the Wordpress CMS Really WorksHow the Wordpress CMS Really Works
How the Wordpress CMS Really Works
 
Project management for WordPress Freelancers
Project management for WordPress FreelancersProject management for WordPress Freelancers
Project management for WordPress Freelancers
 
How Word Press Works
How Word Press WorksHow Word Press Works
How Word Press Works
 
How to structure a content strategy that works
How to structure a content strategy that worksHow to structure a content strategy that works
How to structure a content strategy that works
 
Introverted Freelancer Guide To Writing Proposals
Introverted Freelancer Guide To Writing ProposalsIntroverted Freelancer Guide To Writing Proposals
Introverted Freelancer Guide To Writing Proposals
 
The Introverted Freelancer's Guide to Finding Clients
The Introverted Freelancer's Guide to Finding ClientsThe Introverted Freelancer's Guide to Finding Clients
The Introverted Freelancer's Guide to Finding Clients
 
A Conversation About the WordPress JSON REST API
A Conversation About the WordPress JSON REST APIA Conversation About the WordPress JSON REST API
A Conversation About the WordPress JSON REST API
 
E mail marketing
E mail marketingE mail marketing
E mail marketing
 
Word press meetup getting started
Word press meetup   getting startedWord press meetup   getting started
Word press meetup getting started
 

Recently uploaded

Gen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needsGen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needs
Laura Szabó
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
3ipehhoa
 
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
cuobya
 
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
zoowe
 
Understanding User Behavior with Google Analytics.pdf
Understanding User Behavior with Google Analytics.pdfUnderstanding User Behavior with Google Analytics.pdf
Understanding User Behavior with Google Analytics.pdf
SEO Article Boost
 
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
vmemo1
 
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdfJAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
Javier Lasa
 
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
eutxy
 
Explore-Insanony: Watch Instagram Stories Secretly
Explore-Insanony: Watch Instagram Stories SecretlyExplore-Insanony: Watch Instagram Stories Secretly
Explore-Insanony: Watch Instagram Stories Secretly
Trending Blogers
 
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdfMeet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Florence Consulting
 
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
cuobya
 
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
CIOWomenMagazine
 
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
3ipehhoa
 
Search Result Showing My Post is Now Buried
Search Result Showing My Post is Now BuriedSearch Result Showing My Post is Now Buried
Search Result Showing My Post is Now Buried
Trish Parr
 
Italy Agriculture Equipment Market Outlook to 2027
Italy Agriculture Equipment Market Outlook to 2027Italy Agriculture Equipment Market Outlook to 2027
Italy Agriculture Equipment Market Outlook to 2027
harveenkaur52
 
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC
 
[HUN][hackersuli] Red Teaming alapok 2024
[HUN][hackersuli] Red Teaming alapok 2024[HUN][hackersuli] Red Teaming alapok 2024
[HUN][hackersuli] Red Teaming alapok 2024
hackersuli
 
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Brad Spiegel Macon GA
 
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
3ipehhoa
 
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
keoku
 

Recently uploaded (20)

Gen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needsGen Z and the marketplaces - let's translate their needs
Gen Z and the marketplaces - let's translate their needs
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
 
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
假文凭国外(Adelaide毕业证)澳大利亚国立大学毕业证成绩单办理
 
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
国外证书(Lincoln毕业证)新西兰林肯大学毕业证成绩单不能毕业办理
 
Understanding User Behavior with Google Analytics.pdf
Understanding User Behavior with Google Analytics.pdfUnderstanding User Behavior with Google Analytics.pdf
Understanding User Behavior with Google Analytics.pdf
 
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
重新申请毕业证书(RMIT毕业证)皇家墨尔本理工大学毕业证成绩单精仿办理
 
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdfJAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
JAVIER LASA-EXPERIENCIA digital 1986-2024.pdf
 
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
一比一原版(LBS毕业证)伦敦商学院毕业证成绩单专业办理
 
Explore-Insanony: Watch Instagram Stories Secretly
Explore-Insanony: Watch Instagram Stories SecretlyExplore-Insanony: Watch Instagram Stories Secretly
Explore-Insanony: Watch Instagram Stories Secretly
 
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdfMeet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
Meet up Milano 14 _ Axpo Italia_ Migration from Mule3 (On-prem) to.pdf
 
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
制作毕业证书(ANU毕业证)莫纳什大学毕业证成绩单官方原版办理
 
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
Internet of Things in Manufacturing: Revolutionizing Efficiency & Quality | C...
 
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
 
Search Result Showing My Post is Now Buried
Search Result Showing My Post is Now BuriedSearch Result Showing My Post is Now Buried
Search Result Showing My Post is Now Buried
 
Italy Agriculture Equipment Market Outlook to 2027
Italy Agriculture Equipment Market Outlook to 2027Italy Agriculture Equipment Market Outlook to 2027
Italy Agriculture Equipment Market Outlook to 2027
 
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
APNIC Foundation, presented by Ellisha Heppner at the PNG DNS Forum 2024
 
[HUN][hackersuli] Red Teaming alapok 2024
[HUN][hackersuli] Red Teaming alapok 2024[HUN][hackersuli] Red Teaming alapok 2024
[HUN][hackersuli] Red Teaming alapok 2024
 
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptxBridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
Bridging the Digital Gap Brad Spiegel Macon, GA Initiative.pptx
 
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
 
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
一比一原版(SLU毕业证)圣路易斯大学毕业证成绩单专业办理
 

Austin Day of Rest - Introduction

  • 1. Introduction to the WordPress REST API Nick Batik
  • 2. Nick Batik PleiadesServices.com @nick_batik What Is an API?
  • 3. Nick Batik PleiadesServices.com @nick_batik What Is an API? • API is short for Application Program Interface. • An agreed set of standardized ways that a particular software program can be used; • The rules define how one program can talk to a another, and how it will respond.
  • 4. Nick Batik PleiadesServices.com @nick_batik What Is an API? ApplicationAPI I Want Informatio n From You What info I want The app’s info I Have Informatio n For You What info the app needs Did the app accept it?
  • 5. Nick Batik PleiadesServices.com @nick_batik Classic Problems of APIs • How do you know the rules? • The content is different for each rule • You can’t change the rules
  • 6. Nick Batik PleiadesServices.com @nick_batik What is REST? • Uniform Interface • Resources • Representations • Hypermedia (Links) • Metadata
  • 7. Nick Batik PleiadesServices.com @nick_batik What is REST? • Stateless • Cacheable • Client-Server • Layered System • Code on Demand (optional)
  • 8. Nick Batik PleiadesServices.com @nick_batik What is a REST API? A REST API defines a set of functions developers can use to perform requests and receive responses via HTTP protocol such as GET and POST.
  • 9. Nick Batik PleiadesServices.com @nick_batik What is a REST API? Databases have 4 primary function - CRUD: • Create • Read • Update • Delete
  • 10. Nick Batik PleiadesServices.com @nick_batik What is a REST API? The REST API implements the 4 main database functions in through the HTTP protocol: • Create = PUT with a new URI • POST to a base URI returning a newly created URI • Read = GET • Update = PUT with an existing URI • Delete = DELETE
  • 11. Nick Batik PleiadesServices.com @nick_batik What is a REST API? REST API turns the internet into the world’s largest database
  • 12. Nick Batik PleiadesServices.com @nick_batik Acronym, Initialization, and Other Jargon • HTTP Verbs • HTTP Methods • URLS, routes and Endpoints • Representations • Response Codes • JSON
  • 13. Nick Batik PleiadesServices.com @nick_batik HTTP Verbs • GET • PUT • DELETE •POST • HEAD • OPTIONS
  • 14. Nick Batik PleiadesServices.com @nick_batik HTTP Methods • Safe methods • Unsafe methods • Idempotent methods
  • 15. Nick Batik PleiadesServices.com @nick_batik URLs, routes and Endpoints • Routes are URLs • Endpoints - actions taken (HTTP verb) on the URL e.g. GET http://example.com/wp-json/wp/v2/posts/123 POST http://example.com/wp-json/wp/v2/posts/123 • “GET” and “POST” are endpoints •“wp/v2/posts/123” is the route • /wp-json/ is the API “base”
  • 16. Nick Batik PleiadesServices.com @nick_batik URLs, routes and Endpoints You can expose services in different endpoints: http://www.example.com/soap http://www.example.com/json http://www.example.com/xml
  • 17. Nick Batik PleiadesServices.com @nick_batik Representations • The HTTP client and HTTP server exchange information about resources identified by URLs • Both request and response contain a representation of the resource •The header and the body are part of the representation •HTTP headers contain metadata, defined by the HTTP spec
  • 18. Nick Batik PleiadesServices.com @nick_batik Representations • The HTTP response should specify the content type of the body, example possibilities include: •HTML •XML •XHTML •SOAP+XM •JSON
  • 19. Nick Batik PleiadesServices.com @nick_batik Response Codes • 405 Method Not Allowed • 409 Conflict • 410 Gone • 500 Internal Server Error • 501 Not Implemented • 200 OK • 201 Created • 400 Bad Request •401 Unauthorized • 404 Not Found
  • 20. Nick Batik PleiadesServices.com @nick_batik JSON • JSON: JavaScript Object Notation. • JSON is a syntax for storing and exchanging data. • Human readable / writable •Machine parse-able
  • 21. Nick Batik PleiadesServices.com @nick_batik JSON - Example {"employees":[ {"firstName":"John", "lastName":"Doe"}, {"firstName":"Anna", "lastName":"Smith"}, {"firstName":"Peter", "lastName":"Jones"} ]}
  • 22. Nick Batik PleiadesServices.com @nick_batik JSON - Example {"menu": { "id": "file", "value": "File", "popup": { "menuitem": [ {"value": "New", "onclick": "CreateNewDoc()"}, {"value": "Open", "onclick": "OpenDoc()"}, {"value": "Close", "onclick": "CloseDoc()"} ] } }}
  • 23. Nick Batik PleiadesServices.com @nick_batik The WordPress Implementation of REST API • WordPress as a Data Store • WordPress as an Editing Interface • Access and Authentication
  • 24. Nick Batik PleiadesServices.com @nick_batik The WordPress Implementation of REST API WordPress as a Data Store https://css-tricks.com/thoughts-on-an-api-first-wordpress/
  • 25. Nick Batik PleiadesServices.com @nick_batik The WordPress Implementation of REST API WordPress as an Editing Interface • WYSIWYG / Text Editor • Media Library • Plugin Functionality • Database Customization • Custom Interfaces such as Calypso
  • 26. Nick Batik PleiadesServices.com @nick_batik The WordPress Implementation of REST API Access and Authentication • cookie authentication • OAuth authentication •basic authentication
  • 27. Nick Batik PleiadesServices.com @nick_batik WordPress REST API – Conclusion • Open WordPress to new front-end platforms • Heralds a new era in content exchange • Introduces new levels of complexity

Editor's Notes

  1. Uniform interface: Components throughout the network share a uniform interface Resources: There are an infinite number of resources, all of which have unique addresses and share a common interface for manipulation Representations: A resource may be represented by multiple media types, and the representation is the primary vehicle for a resource’s transfer of state Hypermedia (Links): Resources should be linked to other resources Metadata: Metadata comes in the form of name-value pairs that can describe both the representation and the resource data returned in the response - rel=“alternate" type="text/html" hreflang="en" href="rest.en.html"
  2. Stateless: Each request contains all of the information necessary to be understood and processed; no shared context exists between the client and server (i.e. cookies, sessions) Cache: Clients may reuse data that is labeled as cacheable, improving network efficiency Client-server: Provides full separation of concerns - assumes a disconnected system Layered: All components in the network can understand all requests as they travel from client to server but they cannot see beyond the current layer; provides scalability and efficiency of requests Don’t know who I’m talking to Code-on-demand: Extends the functionality of the client with client-side scripts, etc.
  3. GET is the one that browsers use each time you click a link or type a URL into the address bar. It instructs the server to transmit the data identified by the URL to the client. PUT request is used when you wish to create or update the resource identified by the URL. REST is backend agnostic; nothing informs the server how the data should be created - just that it should. PUT requests contain the data to use in updating or creating the resource in the body. DELETE is be used when you want to delete the resource identified by the URL of the request. POST is used when the processing you wish to happen on the server should be repeated (idempotent) should cause processing of the request body as a subordinate of the URL you are posting to. HEAD: Used to check if a resource exists without returning its representation OPTIONS: Used to retrieve all the verbs supported by a resource
  4. Safe methods are those that never modify resources. The only safe methods, from the four listed is GET. The others are unsafe, because they may result in a modification of the resources. The only non idempotent method is POST All other use exact URLs
  5. By representation, we mean information, in a certain format, about the state of the resource or how that state should be in the future. The body can contain data in any format you can send plain text, pictures, HTML, and XML in any human language. Through request metadata or different URLs, you can choose between different representations for the same resource.
  6. By representation, we mean information, in a certain format, about the state of the resource or how that state should be in the future. The body can contain data in any format you can send plain text, pictures, HTML, and XML in any human language. Through request metadata or different URLs, you can choose between different representations for the same resource.
  7. 200 OK - This response code indicates that the request was successful. 201 Created - The request was successful and a resource was created. Confirms success of a PUT or POST request. 400 Bad Request - malformed request. POST / PUT request data does not pass validation, or is wrong format. 401 Unauthorized - This error indicates that you need to perform authentication before accessing the resource. 405 Method Not Allowed - The HTTP method used is not supported for this resource. 409 Conflict - For instance, you are using a PUT request to create the same resource twice. 410 - Gone: Means that a resource has been moved to another location. An example might be trying to delete an already deleted resource that has been moved to trash. 500 Internal Server Error - When all else fails; generally, a 500 response is used when processing fails due to unanticipated circumstances on the server side, which causes the server to error out. 501 - Not Implemented: Means that the server doesn’t support the functionality to complete the request. Usually occurs when a server receives a request method that it doesn’t recognize.
  8. ◦ ◦ WordPress as an Editing Interface ◦ Access and Authentication
  9. There are people using WordPress just for the Media Library
  10. Basic authentication requires passing your username and password on every request, as well as giving your credentials to clients Application passwords - instead of providing your normal account password, unique and easily revokable passwords are generated from your edit profile screen in the WordPress admin. These application passwords are valid exclusively for the REST API - may not be used to log in to WordPress