Wp JSON API and You!

18
WP JSON API and You! The Next Journey in Your Career

Transcript of Wp JSON API and You!

WP JSON API and You!The Next Journey in Your Career

What You’ll Be Learning

●What Is JSON

●REST and Its Best Practices

●The WP REST API

●How to Engage Clients With This

API Primer

What is JSON

●JavaScript Object Notation

●Supports Strings, Numbers, Booleans, Arrays, and Objects

●Client side communication between different domain servers through callback(JSONP)

JSON Example

REST

●Representational State Transfer

●Architectural style for scalable web services

●HTTP requests for CRUD operations

●Auth methods like Basic and Oauth

REST Best Practices

●API located at base URL, i.e. http://example.com/api

●Separate actions for GET, POST, PUT, and DELETE

●Maintain a Version History

●Get a SSL certificate

●Keep it simple

Using the WP API!

The Setup

●Download source from WP Plugin Repo, or GitHub for beta version

●Activate the Plugin

●Go to http://yourdomain.com/wp-json/posts and view your recent posts in JSON

●Easy right!

Now Lets Extend It A Bit!

●Change JSON Response Output

●Create custom endpoints

Extending The Response

Extending The Endpoints

Extending The Endpoints

How You Can Sell It

People Already Doing Similar

Resources

●https://github.com/WP-API/WP-API

●https://wordpress.org/plugins/json-rest-api/

●https://poststatus.com/wordpress-json-rest-api/

●http://wp-api.org/resources.html

Questions?

Reaching Out!

http://5alarmint.com | @5alarmint.com | [email protected]