Background
This page documents how to setup Postman to explore the Ledger API. You may already be familiar with using Postman to query JSON API endpoints. In 2022, Postman added support for gRPC endpoints. The Ledger API is a collection of gRPC endpoints.
You might consider additionally Using gRPC UI to Explore the Ledger API. Both Postman and gRPC UI have their advantages.
These notes are based on:
- macOS
- Daml SDK 2.4
- Postman Version 10.6.7 (updated Dec 14, 2022)
API Setup
-
Start the Sandbox ledger.
daml sandbox
-
In Postman, use File → New… to create a new “gRPC Request”.
-
For “Enter Server URL” use
localhost:6865
. Postman’s service reflection will automatically list the available methods.
-
For “Select a Method” select “GetLedgerApiVersion” and press “Invoke.”
-
View the response from the service, in JSON format.
-
Repeat these steps for the other service endpoints that you would like to use. See the Ledger API documentation for the expected message bodies for the various service endpoints.