How APIs & Headless Are Transforming The Digital Economy

As the API economy continues it's explosive growth, learn how becoming an API-driven company can help you reap huge rewards

Delivering a great digital experience is not as easy as it once was.

Today, a single web or mobile transaction, such as purchasing a product or registering with an application, crosses an average of 35 different technology systems or components, compared to 22 only five years ago.

To compound the problem, businesses need to be conscious of the importance of a multichannel strategy. With the recent proliferation of IoT and wearables, the client is not guaranteed to always be a laptop or mobile device. In fact, the end user may not be a real person at all, but rather a machine or system.

With such complexity, APIs have transitioned over the past decade from relative obscurity to become the digital glue that empowers developers to create new software applications, partnerships and even new businesses.

For many companies contemplating digital transformation, however, this increased complexity creates a real headache. How do we use technology to drive growth and brand recognition while at the same time creating a cohesive, compelling experience? How do we capture data from all of these digital touchpoints and leverage it to make better data-driven decisions? And, ultimately, how do we measure ROI? It can be quite a daunting prospect and change is often scary. Do nothing and get left behind or move forward and face a myriad of complex technical challenges?

Whatever decision is made, organisations need to incorporate APIs into their corporate decision making and ensure that they become the backbone of their digital landscape.

So why are APIs so important and how exactly can they bring value to an organisation?

 

Producing APIs

Firstly, APIs can be a huge opportunity driver for growth and revenue. For businesses that have truly embraced an API-first strategy, they have created a new go-to-market channel that generates substantial revenues from referrals and usage fees.

Take Stripe and Twilio for example. Here you have two companies that really define what it means to be API-driven. With Stripe, their vision was to simplify ecommerce payment processing - a task that nearly every company needs to perform - and they started building out their APIs to fulfil that goal. Last year, more than 80% of Americans made a purchase using Stripe in some way and the firm is valued at $22.5B today. In case of Twilio, they started in 2008 with just a simple API for making phone calls. Now they provide a comprehensive cloud communications platform-as-a-service (CPaaS) where developers can easily integrate voice, video and instant messaging functionality into their web and mobile apps. Last year, Twillio boasted $1B total revenue for the year, up 63% from 2017.  

Salesforce is another great example of the importance of an API-first strategy. Last year they made $13B in revenue and it is widely estimated that 50-60% of their revenue comes from API calls. So important is their API strategy that they doubled down on it by acquiring Mulesoft a year ago for a whopping $6.5B. Salesforce expects its acquisition to accelerate its growth and produce far greater financial returns by embedding Mulesoft’s API/data integration capabilities into Salesforce’s platform, thereby helping to solve their customers’ escalating data integration needs. So far the signs are very good.

 

Consuming APIs

On the other side of the coin, consuming APIs can also be hugely beneficial. There are many technical and operational advantages to be gained, chief among them being:

  • Decoupling of systems
  • Removal of data silos
  • Avoidance of vendor lock-in
  • Adherence to best practices (modularity, hiding complexity through abstraction, separation of concerns etc)
  • Lower TCO

But for many companies the main driver for an API-driven strategy is reducing development effort and time-to-market. Developers today realise that much of the functionality they need to build into an app is redundant and already exists elsewhere. They have learned not to expend precious time and resources on reinventing the wheel but instead to rely on cost-effective APIs from third party platforms.

Some popular examples include:

  • Inbound/outbound email: SendGrid, Mailgun, etc
  • Payment processing: Stripe, Paypal
  • Mapping: Google Maps API
  • Voice/Video/IM: Twilio
  • Storage: Amazon S3
  • Monitoring & Analytics: Splunk, Datadog, Dynatrace

Leveraging APIs frees up developers to focus on delivering the unique functionality of their app and more quickly and less expensively deliver that ever-important initial product. There are many examples of companies who have adopted this approach and reaped the rewards. One such example is Instacart - they were founded in 2012 and thanks to their rapid innovation are now valued at $2B. Had they been founded 5 years earlier, however, it could have been an entirely different story - due to the time and expense of writing 100% of the functionality they eventually went to market with.

At Liferay, we recognise the vital role APIs play in the digital transformation journey and, accordingly, all Liferay DXP functionality is exposed through SOAP and RESTful API layers. Furthermore, we provide tools - e.g. Service Builder and REST Builder - that allow our customers to easily and rapidly create their own custom services and APIs.  

 

Choosing An API Standard

Once a company has decided to adopt an API-driven strategy, they will need to treat their APIs like crown jewels in order to succeed. To that end, their APIs should be:

  • Easy to use
  • Reliable
  • Fully documented
  • Well defined in terms of contracts

A great solution for all of the above - and one that we use in Liferay DXP - is the OpenAPI Specification (formerly known as Swagger). OpenAPI was founded by Google, Microsoft, IBM and SmartBear - among others - and has quickly become the largest framework today for designing, building, documenting and consuming RESTful APIs. OpenAPI-based APIs are language and platform agnostic and, as a result, the specification has been widely adopted by API-driven companies such as Netflix, PayPal, Atlassian and Mulesoft.

Crucially, OpenAPI makes creating APIs a walk in the park for developers. The framework provides great tools to not only generate client or server code but to also create self-generated documentation for these web services. Some of these tools include:

  • Swagger Editor: An open source editor that helps developers quickly get started with their OpenAPI-based APIs
  • Swagger UI: An intuitive tool that allows visualisation of an API without having any of the implementation logic in place.
  • Swagger Codegen: Helps developers simplify their build process by auto-generating server stubs, freeing them to focus solely on business logic implementation. Generates client SDKs for your APIs also.

When creating any API, there are two roads by which developers can travel: Design First or Code First.  In Liferay DXP, we follow the Design First (aka Contract First) approach for new APIs created on our platform. Our API generator consumes OpenAPI contacts and generates the necessary API scaffolding: JAX-RS endpoints, parsing, XML generation, and advanced features like filtering or multipart (binary files) support. Developers can then focus on filling in the implementation, calling Liferay services or indeed other functionality.

 

Looking To The Future

So as the API-economy continues to grow in size, what does the future hold?

One growing trend in the movie, television, and entertainment space is Hypermedia APIs. These APIs provide rich data - graphics, audio, video and plain text - in a non-linear fashion. The API consumer is presented with hyperlinks with which they can navigate the data, in much the same way that a human surfs the web. This establishes a much more meaningful and interactive experience for API consumers. As a live example, take TVMaze: the root URL is http://api.tvmaze.com and from there you can browse the entire schedule by show, episode or person.

Another increasingly popular API related development, and arguably the most interesting technology trend in DXP circles right now, is Headless. This is the use of a CMS or eCommerce solution as a backend API or “headless” platform. As the term would suggest, it is analogous to separating a head from its body, and is manifested by the front-end of a site being completely decoupled from the platform behind it.

For many companies, the obvious benefit is being able to retrieve content from a backend platform and render it in a custom front-end that has been built using a preferred technology. For others, the goal is to meet the challenge of delivering data to an ever widening array of devices and systems. Regardless, a parallel and equally important benefit is retaining all of the administration and workflow functionality associated with that content.

Naturally, in a lot of cases there can be a vast quantity of content and data to deal with and so a headless platform needs to offer a robust, flexible and well documented API layer - and OpenAPI works very well for this requirement. 

Take Liferay’s Headless CMS as an example. Starting with an OpenAPI contract, a consumer can browse content by scope (site, organisation, user), content type (web article, blogs, forms, etc), template and so on. Furthermore, the consumer can choose to use the raw content, a localised version of the content or a rendered version of the content (content with HTML and CSS applied).

 

Conclusion

APIs represent an attractive source of potential for companies. As the API economy’s precipitous growth suggests, companies that get it right will benefit handsomely by either developing new revenue streams or by greatly reducing development costs and time-to-market for their products and services.

From an end user perspective, the emergence of new interconnected device categories - e.g., wearables, smart cars - underlines the growing importance of APIs in our daily lives.

Still unsure about the best approach to become an API-driven company? Need help with your digital transformation efforts? Get in touch with us at Liferay and we’ll be delighted to help.

 

 

More Blog Entries

Blogs

Hi John, thank for this great post.

When you mention "Our API generator consumes OpenAPI contacts (typo) and generates the necessary API scaffolding" are you referring something new and related to 7.2? can you share some detail? Thanks Denis.

Hi Denis!

 

Yes, it's something new for 7.2. We are currently writing the documentation. Basically it's a tool, like service builder, that consumes OpenAPI profiles and generates the JAX-RS scaffolding + utilities (json/xml writers, pagination, sparse fieldsets...).

 

I want to write a blog post soon explaining it :)

Hi John,

Could you please guide me about how to use the Liferay Commerce APIs to build the frontend,  You mentioned about the swaggerhub, but how to use the APIs in a real project could be more beneficial. Please guide me if you know any doc which explains how to consume the Liferay Commerce API in a project.

I am exited about it. 

Thanks Rahul.