2. Anthony Montalbano
Stuff I did and do
● Cofounded AMBR Detroit
● WordPress dev for 10+
years
● Lead first 3 WordCamp
Detroit
Stuff to contact me
● @italianst4
● anthony@ambrdetroit.com
3. Overview
REST API 101
Intro to WordPress REST API
Creating a mini-theme with the API
A Headless WordPress
Extending the API
5. Post Title
● The Greatest WordCamp Ever
Date Published
● April 28th, 2018
Excerpt
● Today is a monumental day in WordCamp history...
We have some data
14. Resource Based
● The URI endpoints are
resources (nouns)
Stateless
● A request is independent
and self-contained
REpresentational State Transfer
HTTP Methods
● Standardize methods are
used for data manipulation
Representation
● Often JSON or XML based
objects
17. Posts (resource)
/posts - get a collection of posts
/posts - create a new post
/posts/1 - get a post by ID 1
/posts/1 - update the post with ID 1
/posts/1 - delete the post with ID 1
HTTP Methods
GET
POST
GET
PUT
DELETE
18. Every HTTP request has headers which
authenticate the request and how the request
should respond.
Stateless
19. A request and response contains a representation
of a resource, often in JSON format.
Representation
29. Models
Use models to interact and update resources
Collections
Use collections to get a collection of models
Backbone.js Client Library
This client library automatically handles authentication for you! FTW!
53. Perform action taking into
account HTTP method,
headers, and data
Route request based
on HTTP method
Authenticate user based
on HTTP headers
Return a JSON success
or error response
Validate request data
(if applicable)
How to develop an API endpoint