This document discusses integrating external APIs into WordPress sites. It covers what APIs are, how they can be used to get and send data, and how to authenticate with APIs. It provides examples of using the WordPress HTTP API to make requests and examples of handling responses. It also discusses best practices like caching responses to avoid hitting rate limits and using WordPress APIs to help with caching.
7. HTTP API
Database API
Options API
Transients API
Metadata API
Plugin API
https://codex.wordpress.org/WordPress_APIs
Internal WordPress APIs
Dashboard Widgets API
File Header API
Filesystem API
Quicktags API
Rewrite API
Shortcode API
Theme Modification API
Theme Customization API
Widgets API
XML-RPC WordPress API
Settings API
8. How To Use APIs
Endpoint
Authentication
Methods
Arguments
Response
URL where API ‘lives’
May be public or require authentication
Possible ways of using the API
Specify what you want it to do
What it sends back
15. What Format is Response?
string
xml
json
$array = json_decode( $body );
$json = json_encode( $array );
16. Caching Response
Play nice with the API / Save your rate limits
Don’t wait on external services when possible
Use WordPress API’s to help
Options
Transients
WP_Object_Cache
Meta
Save to db
Save to db with time limit
Cache in memory
User / Post Meta