SlideShare a Scribd company logo
1 of 16
Download to read offline
WP REST API:
Adding Your Own Endpoint
Keanan Koppenhaver
http://levelupwp.net
https://www.facebook.com/levelupwp
http://github.com/kkoppenhaver
Who Am I?
• WordPress Developer at doejo for 3 years
• Worked on WP sites large (XX,XXX posts) and
small (5 simple pages)
• Have recently been using just pieces of the
WP REST API in production
Why are we here today?
• Learn a little about the WP REST API
• See some real world examples
• Learn which pieces of the API are available in
core
• Learn how to create our own endpoint
Questions?
Ask them anytime in the chat box below.
How did the REST API
come about?
• Proposed just after the WP Community Summit in
2012
• JSON over XML because of how it maps to
programming language constructs
• REST because the REST paradigm matches up
well with the CMS structure
• Merged* into Core on October 8, 2015 

(https://core.trac.wordpress.org/changeset/34928)
Source: https://youtu.be/tV4IuS_KnvU?t=19m24s
WP REST API in the wild
• ustwo.com
• WP Live Search
• A “Digital Newspaper” with the WP API
• WP Powered Mobile Apps
• Any many more…
Demo: ustwo.com
Demo: ustwo on Github
Is the WP REST API part of
WP Core?
• Yes*
• Infrastructure is in core
• Prebuilt endpoints aren’t in core
• We can create our own endpoints without an
additional plugin
• If we want all the endpoints we need a plugin
What does the plugin give us?
• Endpoints on posts, pages, revisions, media,
post types, post statuses, comments,
taxonomies, categories, tags and users
• Can be enabled for CPT or custom taxonomy
• For a full list, see the reference
And without the plugin?
• No endpoints available, but they can be
created
• Step 1: Create a function to return the
necessary data
• Step 2: Register with register_rest_route
• Step 3: Flush Rewrite Rules
• Step 4: Profit!
Step 1
Create a function to return the necessary data
Step 2
Register with register_rest_route
Step 3
Flush Rewrite Rules
Step 4
Profit!
Q&A
Keanan Koppenhaver
http://levelupwp.net
https://www.facebook.com/levelupwp
http://github.com/kkoppenhaver

More Related Content

What's hot

Versioning strategy for a complex internal API (Konstantin Yakushev)
Versioning strategy for a complex internal API (Konstantin Yakushev)Versioning strategy for a complex internal API (Konstantin Yakushev)
Versioning strategy for a complex internal API (Konstantin Yakushev)Nordic APIs
 
Postman Webinar: Postman 101
Postman Webinar: Postman 101Postman Webinar: Postman 101
Postman Webinar: Postman 101Nikita Sharma
 
Space Camp :: Introduction to API Security
Space Camp :: Introduction to API SecuritySpace Camp :: Introduction to API Security
Space Camp :: Introduction to API SecurityPostman
 
Neotys PAC 2018 - Wilson Mar
Neotys PAC 2018 - Wilson MarNeotys PAC 2018 - Wilson Mar
Neotys PAC 2018 - Wilson MarNeotys_Partner
 
Accelerate Quality with Postman - Basics
Accelerate Quality with Postman - BasicsAccelerate Quality with Postman - Basics
Accelerate Quality with Postman - BasicsKnoldus Inc.
 
Londons Calling 2021
Londons Calling 2021Londons Calling 2021
Londons Calling 2021Keir Bowden
 
Migrate PHP E-Commerce Site to Go
Migrate PHP E-Commerce Site to GoMigrate PHP E-Commerce Site to Go
Migrate PHP E-Commerce Site to GoWeng Wei
 
It Takes a Village to Make WordPress
It Takes a Village to Make WordPressIt Takes a Village to Make WordPress
It Takes a Village to Make WordPressDrewAPicture
 
JavaScript Build System Battle Royale | PrDC 2017
JavaScript Build System Battle Royale | PrDC 2017JavaScript Build System Battle Royale | PrDC 2017
JavaScript Build System Battle Royale | PrDC 2017David Wesst
 
Story Testing Approach for Enterprise Applications using Selenium Framework
Story Testing Approach for Enterprise Applications using Selenium FrameworkStory Testing Approach for Enterprise Applications using Selenium Framework
Story Testing Approach for Enterprise Applications using Selenium FrameworkOleksiy Rezchykov
 
Austin Elixir: Slack Bots With Hedwig
Austin Elixir: Slack Bots With HedwigAustin Elixir: Slack Bots With Hedwig
Austin Elixir: Slack Bots With Hedwigedebill
 
Super tools to boost productivity in React dev env!
Super tools to boost productivity in React dev env!Super tools to boost productivity in React dev env!
Super tools to boost productivity in React dev env!Souvik Basu
 
POST/CON Keynote 2019
POST/CON Keynote 2019POST/CON Keynote 2019
POST/CON Keynote 2019Postman
 
How to Supercharge your PHP Web API
How to Supercharge your PHP Web APIHow to Supercharge your PHP Web API
How to Supercharge your PHP Web APIAurimas Niekis
 
Postman: An Introduction for Testers
Postman: An Introduction for TestersPostman: An Introduction for Testers
Postman: An Introduction for TestersPostman
 
DevNet 1056 WIT Spark API and Chat Bot Workshop
DevNet 1056 WIT Spark API and Chat Bot WorkshopDevNet 1056 WIT Spark API and Chat Bot Workshop
DevNet 1056 WIT Spark API and Chat Bot WorkshopTessa Mero
 
Design & Prototype an API
Design & Prototype an APIDesign & Prototype an API
Design & Prototype an APIPostman
 

What's hot (19)

Versioning strategy for a complex internal API (Konstantin Yakushev)
Versioning strategy for a complex internal API (Konstantin Yakushev)Versioning strategy for a complex internal API (Konstantin Yakushev)
Versioning strategy for a complex internal API (Konstantin Yakushev)
 
Postman Webinar: Postman 101
Postman Webinar: Postman 101Postman Webinar: Postman 101
Postman Webinar: Postman 101
 
Space Camp :: Introduction to API Security
Space Camp :: Introduction to API SecuritySpace Camp :: Introduction to API Security
Space Camp :: Introduction to API Security
 
Neotys PAC 2018 - Wilson Mar
Neotys PAC 2018 - Wilson MarNeotys PAC 2018 - Wilson Mar
Neotys PAC 2018 - Wilson Mar
 
Accelerate Quality with Postman - Basics
Accelerate Quality with Postman - BasicsAccelerate Quality with Postman - Basics
Accelerate Quality with Postman - Basics
 
Londons Calling 2021
Londons Calling 2021Londons Calling 2021
Londons Calling 2021
 
Build social apps for Facebook
Build social apps for FacebookBuild social apps for Facebook
Build social apps for Facebook
 
Migrate PHP E-Commerce Site to Go
Migrate PHP E-Commerce Site to GoMigrate PHP E-Commerce Site to Go
Migrate PHP E-Commerce Site to Go
 
It Takes a Village to Make WordPress
It Takes a Village to Make WordPressIt Takes a Village to Make WordPress
It Takes a Village to Make WordPress
 
JavaScript Build System Battle Royale | PrDC 2017
JavaScript Build System Battle Royale | PrDC 2017JavaScript Build System Battle Royale | PrDC 2017
JavaScript Build System Battle Royale | PrDC 2017
 
Story Testing Approach for Enterprise Applications using Selenium Framework
Story Testing Approach for Enterprise Applications using Selenium FrameworkStory Testing Approach for Enterprise Applications using Selenium Framework
Story Testing Approach for Enterprise Applications using Selenium Framework
 
WordPress 4.1
WordPress 4.1WordPress 4.1
WordPress 4.1
 
Austin Elixir: Slack Bots With Hedwig
Austin Elixir: Slack Bots With HedwigAustin Elixir: Slack Bots With Hedwig
Austin Elixir: Slack Bots With Hedwig
 
Super tools to boost productivity in React dev env!
Super tools to boost productivity in React dev env!Super tools to boost productivity in React dev env!
Super tools to boost productivity in React dev env!
 
POST/CON Keynote 2019
POST/CON Keynote 2019POST/CON Keynote 2019
POST/CON Keynote 2019
 
How to Supercharge your PHP Web API
How to Supercharge your PHP Web APIHow to Supercharge your PHP Web API
How to Supercharge your PHP Web API
 
Postman: An Introduction for Testers
Postman: An Introduction for TestersPostman: An Introduction for Testers
Postman: An Introduction for Testers
 
DevNet 1056 WIT Spark API and Chat Bot Workshop
DevNet 1056 WIT Spark API and Chat Bot WorkshopDevNet 1056 WIT Spark API and Chat Bot Workshop
DevNet 1056 WIT Spark API and Chat Bot Workshop
 
Design & Prototype an API
Design & Prototype an APIDesign & Prototype an API
Design & Prototype an API
 

Viewers also liked

RESTFul API Design and Documentation - an Introduction
RESTFul API Design and Documentation - an IntroductionRESTFul API Design and Documentation - an Introduction
RESTFul API Design and Documentation - an IntroductionMiredot
 
API Design Essentials - Akana Platform Overview
API Design Essentials - Akana Platform OverviewAPI Design Essentials - Akana Platform Overview
API Design Essentials - Akana Platform OverviewAkana
 
Building a REST API for Longevity
Building a REST API for LongevityBuilding a REST API for Longevity
Building a REST API for LongevityMuleSoft
 
Deep-dive into Microservice Outer Architecture
Deep-dive into Microservice Outer ArchitectureDeep-dive into Microservice Outer Architecture
Deep-dive into Microservice Outer ArchitectureWSO2
 
Beautiful REST+JSON APIs with Ion
Beautiful REST+JSON APIs with IonBeautiful REST+JSON APIs with Ion
Beautiful REST+JSON APIs with IonStormpath
 
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 CoreStormpath
 

Viewers also liked (7)

RESTFul API Design and Documentation - an Introduction
RESTFul API Design and Documentation - an IntroductionRESTFul API Design and Documentation - an Introduction
RESTFul API Design and Documentation - an Introduction
 
API Design Essentials - Akana Platform Overview
API Design Essentials - Akana Platform OverviewAPI Design Essentials - Akana Platform Overview
API Design Essentials - Akana Platform Overview
 
Building a REST API for Longevity
Building a REST API for LongevityBuilding a REST API for Longevity
Building a REST API for Longevity
 
Deep-dive into Microservice Outer Architecture
Deep-dive into Microservice Outer ArchitectureDeep-dive into Microservice Outer Architecture
Deep-dive into Microservice Outer Architecture
 
Beautiful REST+JSON APIs with Ion
Beautiful REST+JSON APIs with IonBeautiful REST+JSON APIs with Ion
Beautiful REST+JSON APIs with Ion
 
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
 
RESTful API Design, Second Edition
RESTful API Design, Second EditionRESTful API Design, Second Edition
RESTful API Design, Second Edition
 

Similar to WP REST API - Adding Your Own Endpoint

REST In Action: The Live Coverage Platform at the New York Times
REST In Action: The Live Coverage Platform at the New York TimesREST In Action: The Live Coverage Platform at the New York Times
REST In Action: The Live Coverage Platform at the New York TimesScott Taylor
 
WordPress Rest API
WordPress Rest APIWordPress Rest API
WordPress Rest APIBrian Layman
 
STC Summit 2015: API Documentation, an Example-Based Approach
STC Summit 2015: API Documentation, an Example-Based ApproachSTC Summit 2015: API Documentation, an Example-Based Approach
STC Summit 2015: API Documentation, an Example-Based ApproachLois Patterson
 
2015 WordCamp Maine Keynote
2015 WordCamp Maine Keynote2015 WordCamp Maine Keynote
2015 WordCamp Maine KeynoteScott Taylor
 
Live Coverage at The New York Times
Live Coverage at The New York TimesLive Coverage at The New York Times
Live Coverage at The New York TimesScott Taylor
 
Why & How to Create a WordPress Plugin
Why & How to Create a WordPress PluginWhy & How to Create a WordPress Plugin
Why & How to Create a WordPress PluginJoe Querin
 
WooCommerce & Apple TV
WooCommerce & Apple TVWooCommerce & Apple TV
WooCommerce & Apple TVMarko Heijnen
 
WordPress 4.4 and Beyond
WordPress 4.4 and BeyondWordPress 4.4 and Beyond
WordPress 4.4 and BeyondScott Taylor
 
The WordPress REST API as a Springboard for Website Greatness
The WordPress REST API as a Springboard for Website GreatnessThe WordPress REST API as a Springboard for Website Greatness
The WordPress REST API as a Springboard for Website GreatnessWP Engine UK
 
Getting Started with WordPress JSON REST API
Getting Started with WordPress JSON REST APIGetting Started with WordPress JSON REST API
Getting Started with WordPress JSON REST APIHishikawa Takuro
 
Maine WordPress Meetup JSON REST API, 3/16/2016
Maine WordPress Meetup JSON REST API, 3/16/2016Maine WordPress Meetup JSON REST API, 3/16/2016
Maine WordPress Meetup JSON REST API, 3/16/2016Andre Gagnon
 
Cross CMS plugin development using AWF
Cross CMS plugin development using AWFCross CMS plugin development using AWF
Cross CMS plugin development using AWFTim Plummer
 
Building a mobile app connected to WordPress with WP-AppKit
Building a mobile app connected to WordPress with WP-AppKitBuilding a mobile app connected to WordPress with WP-AppKit
Building a mobile app connected to WordPress with WP-AppKitBenjamin LUPU
 
Decoupled Architecture and WordPress
Decoupled Architecture and WordPressDecoupled Architecture and WordPress
Decoupled Architecture and WordPressPantheon
 
Untangling spring week11
Untangling spring week11Untangling spring week11
Untangling spring week11Derek Jacoby
 
Experience Session - Hari
Experience Session - HariExperience Session - Hari
Experience Session - HariSV.CO
 
SV.CO’s iterative product development
SV.CO’s iterative product developmentSV.CO’s iterative product development
SV.CO’s iterative product developmenthari
 
Bringing Dev and Ops together with ChatOps
Bringing Dev and Ops together with ChatOpsBringing Dev and Ops together with ChatOps
Bringing Dev and Ops together with ChatOpsJaap Brasser
 
How to build a Project Hub with Hubsites and Sitedesign and Sitescripts
How to build a Project Hub with Hubsites and Sitedesign and Sitescripts How to build a Project Hub with Hubsites and Sitedesign and Sitescripts
How to build a Project Hub with Hubsites and Sitedesign and Sitescripts Knut Relbe-Moe [MVP, MCT]
 

Similar to WP REST API - Adding Your Own Endpoint (20)

REST In Action: The Live Coverage Platform at the New York Times
REST In Action: The Live Coverage Platform at the New York TimesREST In Action: The Live Coverage Platform at the New York Times
REST In Action: The Live Coverage Platform at the New York Times
 
WordPress Rest API
WordPress Rest APIWordPress Rest API
WordPress Rest API
 
STC Summit 2015: API Documentation, an Example-Based Approach
STC Summit 2015: API Documentation, an Example-Based ApproachSTC Summit 2015: API Documentation, an Example-Based Approach
STC Summit 2015: API Documentation, an Example-Based Approach
 
A Day of REST
A Day of RESTA Day of REST
A Day of REST
 
2015 WordCamp Maine Keynote
2015 WordCamp Maine Keynote2015 WordCamp Maine Keynote
2015 WordCamp Maine Keynote
 
Live Coverage at The New York Times
Live Coverage at The New York TimesLive Coverage at The New York Times
Live Coverage at The New York Times
 
Why & How to Create a WordPress Plugin
Why & How to Create a WordPress PluginWhy & How to Create a WordPress Plugin
Why & How to Create a WordPress Plugin
 
WooCommerce & Apple TV
WooCommerce & Apple TVWooCommerce & Apple TV
WooCommerce & Apple TV
 
WordPress 4.4 and Beyond
WordPress 4.4 and BeyondWordPress 4.4 and Beyond
WordPress 4.4 and Beyond
 
The WordPress REST API as a Springboard for Website Greatness
The WordPress REST API as a Springboard for Website GreatnessThe WordPress REST API as a Springboard for Website Greatness
The WordPress REST API as a Springboard for Website Greatness
 
Getting Started with WordPress JSON REST API
Getting Started with WordPress JSON REST APIGetting Started with WordPress JSON REST API
Getting Started with WordPress JSON REST API
 
Maine WordPress Meetup JSON REST API, 3/16/2016
Maine WordPress Meetup JSON REST API, 3/16/2016Maine WordPress Meetup JSON REST API, 3/16/2016
Maine WordPress Meetup JSON REST API, 3/16/2016
 
Cross CMS plugin development using AWF
Cross CMS plugin development using AWFCross CMS plugin development using AWF
Cross CMS plugin development using AWF
 
Building a mobile app connected to WordPress with WP-AppKit
Building a mobile app connected to WordPress with WP-AppKitBuilding a mobile app connected to WordPress with WP-AppKit
Building a mobile app connected to WordPress with WP-AppKit
 
Decoupled Architecture and WordPress
Decoupled Architecture and WordPressDecoupled Architecture and WordPress
Decoupled Architecture and WordPress
 
Untangling spring week11
Untangling spring week11Untangling spring week11
Untangling spring week11
 
Experience Session - Hari
Experience Session - HariExperience Session - Hari
Experience Session - Hari
 
SV.CO’s iterative product development
SV.CO’s iterative product developmentSV.CO’s iterative product development
SV.CO’s iterative product development
 
Bringing Dev and Ops together with ChatOps
Bringing Dev and Ops together with ChatOpsBringing Dev and Ops together with ChatOps
Bringing Dev and Ops together with ChatOps
 
How to build a Project Hub with Hubsites and Sitedesign and Sitescripts
How to build a Project Hub with Hubsites and Sitedesign and Sitescripts How to build a Project Hub with Hubsites and Sitedesign and Sitescripts
How to build a Project Hub with Hubsites and Sitedesign and Sitescripts
 

More from Keanan Koppenhaver

The WP REST API as the Foundation of the Open Web 
The WP REST API as the Foundation of the Open Web The WP REST API as the Foundation of the Open Web 
The WP REST API as the Foundation of the Open Web Keanan Koppenhaver
 
Voice is the New Keyboard - Voice Interfaces in 2018 and Beyond
Voice is the New Keyboard - Voice Interfaces in 2018 and BeyondVoice is the New Keyboard - Voice Interfaces in 2018 and Beyond
Voice is the New Keyboard - Voice Interfaces in 2018 and BeyondKeanan Koppenhaver
 
Selling DevOps To Non-Technical Management
Selling DevOps To Non-Technical ManagementSelling DevOps To Non-Technical Management
Selling DevOps To Non-Technical ManagementKeanan Koppenhaver
 
Contributing to WordPress - #WCNYC
Contributing to WordPress  - #WCNYCContributing to WordPress  - #WCNYC
Contributing to WordPress - #WCNYCKeanan Koppenhaver
 
Contributing to open source as a non developer - #wclax
Contributing to open source as a non developer - #wclaxContributing to open source as a non developer - #wclax
Contributing to open source as a non developer - #wclaxKeanan Koppenhaver
 
WordPress Debugging Tips and Tricks
WordPress Debugging Tips and TricksWordPress Debugging Tips and Tricks
WordPress Debugging Tips and TricksKeanan Koppenhaver
 
WordPress Debugging Tips and Tricks
WordPress Debugging Tips and TricksWordPress Debugging Tips and Tricks
WordPress Debugging Tips and TricksKeanan Koppenhaver
 
Your WordPress Site Has Been Hacked: What Now?
Your WordPress Site Has Been Hacked: What Now?Your WordPress Site Has Been Hacked: What Now?
Your WordPress Site Has Been Hacked: What Now?Keanan Koppenhaver
 

More from Keanan Koppenhaver (13)

The WP REST API as the Foundation of the Open Web 
The WP REST API as the Foundation of the Open Web The WP REST API as the Foundation of the Open Web 
The WP REST API as the Foundation of the Open Web 
 
Advanced WordPress Tooling
Advanced WordPress ToolingAdvanced WordPress Tooling
Advanced WordPress Tooling
 
Voice is the New Keyboard - Voice Interfaces in 2018 and Beyond
Voice is the New Keyboard - Voice Interfaces in 2018 and BeyondVoice is the New Keyboard - Voice Interfaces in 2018 and Beyond
Voice is the New Keyboard - Voice Interfaces in 2018 and Beyond
 
Selling DevOps To Non-Technical Management
Selling DevOps To Non-Technical ManagementSelling DevOps To Non-Technical Management
Selling DevOps To Non-Technical Management
 
Debugging Tips and Tricks
Debugging Tips and TricksDebugging Tips and Tricks
Debugging Tips and Tricks
 
Contributing to WordPress - #WCNYC
Contributing to WordPress  - #WCNYCContributing to WordPress  - #WCNYC
Contributing to WordPress - #WCNYC
 
Contributing to open source as a non developer - #wclax
Contributing to open source as a non developer - #wclaxContributing to open source as a non developer - #wclax
Contributing to open source as a non developer - #wclax
 
Building a WordPress plugin
Building a WordPress pluginBuilding a WordPress plugin
Building a WordPress plugin
 
WordPress Debugging Tips and Tricks
WordPress Debugging Tips and TricksWordPress Debugging Tips and Tricks
WordPress Debugging Tips and Tricks
 
WordPress Debugging Tips and Tricks
WordPress Debugging Tips and TricksWordPress Debugging Tips and Tricks
WordPress Debugging Tips and Tricks
 
Your WordPress Site Has Been Hacked: What Now?
Your WordPress Site Has Been Hacked: What Now?Your WordPress Site Has Been Hacked: What Now?
Your WordPress Site Has Been Hacked: What Now?
 
Enterprise-Scale WordPress
Enterprise-Scale WordPressEnterprise-Scale WordPress
Enterprise-Scale WordPress
 
routrr
routrrroutrr
routrr
 

Recently uploaded

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
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
"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
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Visualising and forecasting stocks using Dash
Visualising and forecasting stocks using DashVisualising and forecasting stocks using Dash
Visualising and forecasting stocks using Dashnarutouzumaki53779
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
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
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 

Recently uploaded (20)

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
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
"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
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Visualising and forecasting stocks using Dash
Visualising and forecasting stocks using DashVisualising and forecasting stocks using Dash
Visualising and forecasting stocks using Dash
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 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
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 

WP REST API - Adding Your Own Endpoint

  • 1. WP REST API: Adding Your Own Endpoint Keanan Koppenhaver http://levelupwp.net https://www.facebook.com/levelupwp http://github.com/kkoppenhaver
  • 2. Who Am I? • WordPress Developer at doejo for 3 years • Worked on WP sites large (XX,XXX posts) and small (5 simple pages) • Have recently been using just pieces of the WP REST API in production
  • 3. Why are we here today? • Learn a little about the WP REST API • See some real world examples • Learn which pieces of the API are available in core • Learn how to create our own endpoint
  • 4. Questions? Ask them anytime in the chat box below.
  • 5. How did the REST API come about? • Proposed just after the WP Community Summit in 2012 • JSON over XML because of how it maps to programming language constructs • REST because the REST paradigm matches up well with the CMS structure • Merged* into Core on October 8, 2015 
 (https://core.trac.wordpress.org/changeset/34928) Source: https://youtu.be/tV4IuS_KnvU?t=19m24s
  • 6. WP REST API in the wild • ustwo.com • WP Live Search • A “Digital Newspaper” with the WP API • WP Powered Mobile Apps • Any many more…
  • 8. Demo: ustwo on Github
  • 9. Is the WP REST API part of WP Core? • Yes* • Infrastructure is in core • Prebuilt endpoints aren’t in core • We can create our own endpoints without an additional plugin • If we want all the endpoints we need a plugin
  • 10. What does the plugin give us? • Endpoints on posts, pages, revisions, media, post types, post statuses, comments, taxonomies, categories, tags and users • Can be enabled for CPT or custom taxonomy • For a full list, see the reference
  • 11. And without the plugin? • No endpoints available, but they can be created • Step 1: Create a function to return the necessary data • Step 2: Register with register_rest_route • Step 3: Flush Rewrite Rules • Step 4: Profit!
  • 12. Step 1 Create a function to return the necessary data
  • 13. Step 2 Register with register_rest_route