Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Introducing API Templates With Reusable System and Process APIs

DZone's Guide to

Introducing API Templates With Reusable System and Process APIs

APIs are the building blocks of application integration. See how MuleSoft has chosen to implement templates to simplify use.

Free Resource

Modernize your application architectures with microservices and APIs with best practices from this free virtual summit series. Brought to you in partnership with CA Technologies.

In today’s world, APIs are used to abstract the complexity of systems of records, to provide secure connectivity to the end systems, and to accomplish business goals such as creating a unified view of a customer. But APIs alone cannot accomplish all integration use cases. For example, when you want to send data from won opportunities in Salesforce to SAP for invoice creation, on top of using APIs, you will also want to do data migration and/or data synchronization to accomplish this use case.

To help our customers drive consistency and reuse while addressing such use cases, we are introducing API templates. API templates comprise of reusable “system APIs”, “process APIs”, and templatized orchestration to quickly address common use cases.  

Taking an API-Led Approach

API-led connectivity is an approach that defines methods for connecting your assets using  reusable API building blocks. The approach includes three distinct layers which contain reusable APIs on the system, process, and experience-levels. In this article we’re not going to cover examples of experience APIs, but we will showcase how system and process APIs help with data migration and synchronization use cases.

Image title

System APIs

Underlying all IT architectures are core systems of records that are often not readily available due to its complexity and connectivity concerns. APIs provide a means of hiding that complexity from the user while exposing data and providing downstream insulation from any interface changes or rationalization of those systems.

API templates provide system APIs for creating building blocks that can be reused by anyone in the organization looking to access the same data. System APIs expose data via a set of RESTful services that are designed in RAML, making it easily consumable by any developer within the enterprise.

Below you can see an example of connecting to SAP via BAPIs versus using the system APIs provided in the SAP System API Template.

Connecting to SAP via BAPIs

Image title

Connecting to SAP via a System API

Image title

Process APIs

Process APIs encapsulate the underlying business processes that interact with source and target systems or channels via a set of system APIs. For example, in a purchase order process, there is some logic that is common across products, geographies and retail channels that can and should be distilled into a single service that can then be called.

To templatize common integration needs, base patterns must first be established to make integrations atomic, reusable, and extensible. Patterns will usually include:

  • a source – system API where data resides before execution
  • a destination –  system API where the data will be inserted
  • the criteria – which determines the scope of data to be copied, moved or replicated
  • results capture – to compare the final state with the desired state.

API templates encapsulate the five most common integration patterns into process APIs, such as migration, broadcast, aggregation, correlation, and bi-directional synchronization.

Image title

API Templates in Action

Take a look at our first set of API templates which feature system APIs for Salesforce, SAP, and databases, and process API for account migration. Let’s take a look at how we can use these templates to migrate account data from SAP to Salesforce:

1. Abstract the complexity of underlying systems: First, we are going to use RESTful APIs to hide the complexity of the underlying system of records, in our example Salesforce and SAP. Once the system APIs are selected, configure the applications and deploy them to CloudHub.

2. Access data: Once we deploy the system APIs, we can access the account data from Salesforce and/or SAP via RESTful APIs.

Image title


3. Implement a business logic: Now, once the SAP and Salesforce data is easily accessible through the system APIs we’re going to migrate account data. To do this, we will use Migration Process API and once configured; we will only need to make an API call to move accounts from Salesforce to SAP.

Conclusion

With an increasing number of systems in the enterprise, reuse becomes paramount to accelerate delivery and to scale.  Take an API-led approach to connectivity by giving the templates a try. If you have any questions or feedback, send them to info@mulesoft.com

The Integration Zone is proudly sponsored by CA Technologies. Learn from expert microservices and API presentations at the Modernizing Application Architectures Virtual Summit Series.

Topics:
mule ,api

Published at DZone with permission of Anton Kravchenko. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}