As the REST API begins opening WordPress up to a wider programmatic world, now is a great time to start getting familiar with best-in-breed examples of third-party APIs across the web. Kicking the tires of these APIs will kill two birds with one stone – you’ll get familiar with standard best practices and also widen your horizons in terms of what you can integrate WordPress with on your next project.
Though there’s considerable debate about exactly what constitutes a truly great API, the examples we’ve highlighted in this piece are widely agreed to be among the best in the business. You can expect crystal clear documentation, ease of implementation, and compelling use cases across the board. Start exploring their power and you’ll find no shortage of creative ways they can be usefully married to WordPress.
Before we dive into our examples, let’s briefly address the question of what makes an excellent API, and introduce some useful resources to follow up on if you’re relatively new to the field.
What Makes A Great REST API
As with anything related to development, there’s no shortage of strongly held opinions about precisely what makes a world-class API. Sift through a recent Hacker News thread on the subject, for example, and you’ll find plenty of competing points of view on display.
If you’re looking to step through the basics for yourself, Apigee’s Web API Design e-book is a great introductory read. When you’re ready to dive deeper, Vinay Sahni’s epic Best Practices for a Pragmatic RESTful API article is hard to beat. We should also give a special shout-out to Phil Sturgeon’s Build APIs You Won’t Hate, which is particularly strong on the subject in the specific context of PHP development.
With that out of the way, let’s crack on to our candidates!
1. Twitter API
A huge part of Twitter’s incredible uptake among the technorati was their early provision of an easy to interact with public-facing REST API. Though the hammer eventually came down in terms of unrestricted access and rate limitation, the API remains an excellent, straightforward service for developers to cut their teeth on.
In addition to clearly written documentation and guidelines for best practices, you’ll also find a comprehensive set of case studies, and a burgeoning playbook section to inspire you further. There are also a number of stable PHP libraries to lean on as you get to grips with your options, along with several solid tutorials elsewhere for putting together exploratory demo projects.
2. Twilio API
Twilio’s API played a key role in wooing early-stage investment in the increasingly omnipresent telephony startup – founder Jeff Lawson famously reeled in venture capitalist Fred Wilson with the claim that “we have taken the entire messy and complex world of telephony and reduced it to five API calls“.
In addition to those five famous calls, you’ll find a host of quickstarts, tutorials, and rock-solid helper libraries over at the beautifully presented API & Docs section of the Twilio site. You’ll also find consistently engaging API-related content on the excellent Twilio blog, which highlights why noted developers such as Patrick McKenzie are so keen to sing the product’s praises.
Twilio is a classic example of the power that APIs open up to developers generally – with just a little bit of poking around, straightforward integration with notoriously messy offline services that would have been unthinkable just a few years ago is at your fingertips.
3. Stripe API
Though PayPal has significantly raised its game over recent years, near-monopoly positions tend not to lead to delighted customers over time. Both developers and site owners had long been casting around for solid online payment alternatives for a considerable time before Stripe burst onto the scene back in 2009.
The young Irish entrepreneurs behind the payments platform have been consistently at pains to stress the ease of use of their payments API, and actively courted developers from the get-go. With the company now valued at somewhere north of $5 billion, it’s a strategy that’s paid off handsomely.
Step into the Stripe documentation and you’ll be able to interact with the API within seconds, thanks to their innovative in-browser Try Now option. Explore a little further and you’ll come across a full range of libraries and examples, along with crystal-clear getting started guides for subjects such as subscriptions and orders.
Browse the API docs themselves and you’ll find considerable care and attention has gone into providing an excellently organized RESTful experience. Clearly described sample requests are provided for relevant languages throughout, and you won’t have to waste any time trying to track down obscure options.
4. Stormpath API
One of the many interesting scenarios the WordPress REST API opens up is the possibility of previously core parts of the platform’s functionality being outsourced to third-party services. Stormpath provides a potential case in point here for developers with their user authentication, authorization, and management services. They’ve also garnered consistent praise for the implementation of their API from the wider development community to date.
https://www.youtube.com/watch?v=hdSrT4yjS1g&feature=youtu.be
As the deep-dive presentation from CTO Les Hazlewood above makes clear, Stormpath are passionately committed to providing an excellent developer experience. Browse the Stormpath docs and you’ll find solid library options for PHP and handy quickstart guides to get you up and running with a minimum of fuss. The API reference itself is also clearly broken out and easy to parse generally.
5. Slack API
No list of tip-top APIs would be complete without a mention of the latest messaging hotness that is Slack. In addition to helping countless teams around the world revolutionize their day-to-day communication, the platform also provides an excellently implemented API that developers have been quick to turn into something of an online playground since the service launched.
Pop into the official Slack API documentation and you’ll find plenty of the design quality and attention to detail that have made the platform famous. Beautifully presented getting started guides to building apps and custom integrations get you off to the races quickly, along with exemplary developer and engineering blogs. The API even has its own Twitter feed!
Slack exposes a number of individual APIs, and the documentation for specific options such as the Web API is consistently on point. PHP libraries are present and correct, along with a superb list of sample apps to delve into. The Developer Stories section of the documentation is also well worth a close read in terms of general inspiration, as is the existing Zapier WordPress/Slack integration.
Conclusion
Each of the APIs we’ve introduced above comes with bulletproof documentation and an excellent set of wider resources to get you up and running quickly. They also all offer plenty of scope for direct useful integration with WordPress once you’re familiar their basics. Let’s step through them one more time:
- Twitter API: Makes a great starting point for exploring third-party APIs.
- Twilio API: Use this to start thinking about how WordPress can tie in with offline services.
- Stripe API: This one could be where the rubber meets the road in terms of cold, hard cash.
- Stormpath API: Offers a glimpse into how traditionally core parts of WordPress can potentially be siphoned off to other services.
- Slack API: Provides an excellent opportunity for elegantly broadcasting WordPress events to your team and beyond.
Are there any top-tier APIs we’ve missed out on? Get in touch via the comments below and share the love!
Featured image: tpsdave
No Comments