Calling Any API Through Daml
Editor’s note: This post is the fifth in our series “How to Make the Most of the Daml Application Framework.” Part 1 introduced the fundamentals of Daml/Daml Hub architecture, and Part 2 explained how that architecture simplifies the challenges of user authentication. Part 3 discussed how it speeds front-end development, and Part 4 discussed how Daml Hub's own APIs make quick work of validating and deploying Daml applications.
In last week’s edition, we discussed how DABL’s API syncs up complementary endpoints in Daml and DABL to enforce user/Daml Party authentication without additional configuration or layers.
This week, we’ll consider how DABL talks to other APIs to speed integration of third-party functionality into Daml applications.
Digital Asset is building a layer that lets Daml developers plug APIs into Daml workflows
Because Daml/DABL architecture bakes in support for privacy and business processes, applications built in Daml can initiate secure workflows with a single API call via DABL.
Now, Digital Asset is extending that capability across multiple external APIs, starting with those specified within the Swagger framework.
Because each third-party API represents a distinct implementation, you currently have to do all the work to normalize, abstract, and coordinate across those APIs. The task becomes harder and messier with each new implementation you need to code for.
Daml/DABL architecture untangles the mess. By mirroring the external API in Daml, your app is already normalized into a single layer of functionality — the Daml layer — and coordinating is as straightforward as writing your Daml workflow. DABL is working to make the UX of running and managing your connectivity to those APIs “just work” without any additional effort to maintain their connectivity.
You can add support for third-party APIs simply by creating bots that listen to external activity and make judgments about what data to send or receive.
Consider a Daml application that checks on Bitcoin prices. For it to have true value, this application has to reach the outside world via integration with a third party like CoinDesk. Other examples would be an application that uses Slack to notify users when a contract is created or harnesses Stripe to send payments.
To connect, DABL will use a package that contains a Daml implementation of the required third-party API, as well as any bots or network connections required for the integration. Working with a deployed ledger, engineers won’t have to implement the API code themselves — just to create a proper Daml contract.
Extending the concept, Digital Asset is building a layer that lets Daml developers plug APIs into Daml workflows with Daml’s permissioning and security model and the error handling and scalability required for production use.
Do you want to extend your applications’ capabilities via external APIs? Reach out to us today to let us know which API you would like to see supported by DABL.
And if you want to get started building your own application, go to Daml.com, download the SDK, and use Daml Hub today. Daml is open source and always free to use, and DABL is free to start.