REST principles – Authentication – Content negotiation – Versioning – Presence of RPC actions – Use of hypermedia or templated URIs – Rate limiting – And more… • Each a snowflake – “RESTful” client frameworks available for most languages and platforms – Most services provide pre-built client libraries
CRUD for posts, comments, tags, categories – oAuth for private data • Available since April 2012 – October 2012 – Added to WP.org via Jetpack – April 2013 - Added CPT & custom fields • WP.com-specific features – Likes, follows, notifications, reblogs – Freshly Pressed http://developer.wordpress.com/docs/api/
Code • Standard RESTful API design – /: Index – /posts: Post Collection – /posts/<id>: Post – /posts/<id>/revisions: Post Collection – /posts/<id>/comments: Comment Collection – /posts/<id>/comments/<comment>: Comment – /taxonomies: Taxonomy Collection – /taxonomies/<tax>: Taxonomy – /taxonomies/<tax>/terms: Term Collection – /taxonomies/<tax>/terms/<term>: Term – /users: User Collection – /users/me: User – /users/<user>: User • 3.7 or 3.8? http://wordpress.org/plugins/json-rest-api/ https://github.com/rmccue/WP-API/ http://make.wordpress.org/core/tag/json-api/
WP.com & WP.org, including old versions – Pluggable – Existing client libraries • WP.com integration: WP.com REST API – Also an option if you use Jetpack – Limited existing client libraries, but not too difficult to roll your own • Future: WP.org RESTful API – Help alpha test Ryan’s GSoC project – If/when it reaches core, likely community effort to build client libraries