Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

WP REST API: Actionable.co

1,223 views

Published on

WordCamp Miami 2017 Presentation - How we use the REST API at Actionable.co.

Published in: Internet
  • Be the first to comment

  • Be the first to like this

WP REST API: Actionable.co

  1. 1. Blog - shawnhooper.ca
 Twitter - @shawnhooper REST API Case Study: 
 Actionable.co WordCamp Miami 2017
 
 Shawn Hooper Director of IT, actionable.co
  2. 2. Blog - shawnhooper.ca
 Twitter - @shawnhooper 
 Good Afternoon! I’m Shawn Hooper, the Director of IT at Actionable.co
 Being a distributed company, everything we do is in the cloud…. Actionable
  3. 3. Blog - shawnhooper.ca
 Twitter - @shawnhooper 
 Our core offering is the Actionable Conversations platform. (NodeJS) Actionable
  4. 4. Blog - shawnhooper.ca
 Twitter - @shawnhooper 
 Our core offering is the Actionable Conversations platform. (NodeJS) We also have 3 public-facing websites marketing to different audiences (all WordPress). Actionable
  5. 5. Blog - shawnhooper.ca
 Twitter - @shawnhooper 
 Our core offering is the Actionable Conversations platform. (NodeJS) We also have 3 public-facing websites marketing to different audiences (all WordPress). 
 
 Our Intranet is also a WordPress site. Actionable
  6. 6. Blog - shawnhooper.ca
 Twitter - @shawnhooper 
 We also use many 3rd party services w/ APIs: Teachable (Online Courses)
 Infusionsoft (CRM)
 Zoom (Webinars & Conference Calls)
 G Suite (Google Apps)
 Xero (Accounting)
 BambooHR (HR Management)
 …. and many more Actionable
  7. 7. Blog - shawnhooper.ca
 Twitter - @shawnhooper How we use the REST API…
  8. 8. Blog - shawnhooper.ca
 Twitter - @shawnhooper To Manage Content…
  9. 9. Blog - shawnhooper.ca
 Twitter - @shawnhooper 
 Actionable Conversations 
 Learning & Development Platform
 
 Developed in NodeJS
 
 Our learning modules are content.
 Used the WP REST API to retrieve modules & avoid making a custom CMS.
 Why re-invent the wheel…
  10. 10. Blog - shawnhooper.ca
 Twitter - @shawnhooper 
 Modified ‘module’ Custom Post Type endpoint
 to return required meta fields with the register_rest_field() function. Why re-invent the wheel…
  11. 11. Blog - shawnhooper.ca
 Twitter - @shawnhooper 
 Modified ‘module’ Custom Post Type endpoint
 to return required meta fields with the register_rest_field() function.
 
 Wrote a plugin that added WPML information to this post type, showing current locale, and the locale, post ID and permalink to other available languages. Why re-invent the wheel…
  12. 12. Blog - shawnhooper.ca
 Twitter - @shawnhooper Linking Between Blogs
  13. 13. Blog - shawnhooper.ca
 Twitter - @shawnhooper 
 We have three public facing websites with blogs. Using the REST API, we retrieve the most recent post from each blog and display them in a widget on all the sites.
 
 /wp-json/wp/v2/posts/?per_page=1
 
 (Cached for 24 hours) Linking Between Blogs
  14. 14. Blog - shawnhooper.ca
 Twitter - @shawnhooper 
 We no longer use admin-ajax.php to handle AJAX requests, but REST endpoints instead.
 
 - Better Documented ( wp-json/ )
 - Code re-use from other sites and apps
 
 (Example: Looking up valid email address) Goodbye admin-ajax.php
  15. 15. Blog - shawnhooper.ca
 Twitter - @shawnhooper To Optimize…
  16. 16. Blog - shawnhooper.ca
 Twitter - @shawnhooper Clearing the Cache
  17. 17. Blog - shawnhooper.ca
 Twitter - @shawnhooper Clearing the Cache 
 The data about our consultant network is maintained in one of our internal databases. The page is populated using a shortcode. This is slow. So I cached it. Forever.
  18. 18. Blog - shawnhooper.ca
 Twitter - @shawnhooper Clearing the Cache Clear the cache only on data change
  19. 19. Blog - shawnhooper.ca
 Twitter - @shawnhooper To Automate…
  20. 20. Blog - shawnhooper.ca
 Twitter - @shawnhooper 
 Problem: An employee’s manager & HR need to know when a new team member completes their on boarding courses in Teachable. Solution:
 
 Use REST API to accept web hooks from Teachable and then interface with Slack and our HRMS. Teachable Webhooks
  21. 21. Blog - shawnhooper.ca
 Twitter - @shawnhooper 
 When an opportunity is marked as Closed-Won in Infusionsoft, we automatically create a record in our accounting software using the WP REST API. Infusionsoft -> Xero
  22. 22. Blog - shawnhooper.ca
 Twitter - @shawnhooper 
 Problem: User Management of Several Websites 
 without Multisite Solution:
 
 Use REST API to remotely create user accounts from an admin page on our Intranet. Bulk User Creation
  23. 23. Blog - shawnhooper.ca
 Twitter - @shawnhooper 
 POST /wp/v2/users/ combined with Google Apps Login plugin. Bulk User Creation
  24. 24. Blog - shawnhooper.ca
 Twitter - @shawnhooper You can find these slides, notes and more at
 shawnhooper.ca
 
 Tweet Me @shawnhooper
 
 WordPress Slack: shooper Thank You!

×