This was my talk at Detroit Startup Week 2017 about the WordPress REST API. The goal was to build a foundation for REST APIs then how to use WordPress' core REST API to build upon.
2. Anthony Montalbano
Stuff I did and do
● Cofounded AMBR Detroit
● WordPress dev for 10+
years
● Hosted 3 WordCamps in
Detroit
Stuff to contact me
● @italianst4
● anthony@ambrdetroit.com
12. 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
15. Pet (resource)
/pet - get a collection of pets
/pet - create a new pet
/pet/1 - get a pet by ID 1
/pet/1 - update the pet with ID 1’s properties
/pet/1 - delete the pet with ID 1
HTTP Methods
GET
POST
GET
PUT
DELETE
16. Every HTTP request has headers which
authenticate the request and how the request
should respond.
Stateless
17. A request and response contains a representation
of a resource, often in JSON format.
Representation
33. 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!
41. 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