Skip to content
CCPEDIAby Unity Nodes
Discussions/App Development/When would you use a Command Id with the JSON API?Forum ↗

When would you use a Command Id with the JSON API?

App Development2 posts363 views2 likesLast activity Aug 2020
AN
anthonyOP
Aug 2020

In the docs we have a section that describes creating a contract and specifying a meta field that contains a commandId. If you specify a commandId where would you use it in the future with the JSON API or does it not get used with the JSON API?

https://docs.daml.com/json-api/index.html#create-a-new-contract-with-an-optional-meta-field

ST
Stephen
Aug 2020

It’s passed through unaltered as the command_id to the underlying ledger.

You can’t use it anywhere else in the JSON API, but you can use it for observing the results of its commands outside the JSON API. For example, it might appear in a log message, so you could correlate those logs with a specific JSON API request. Or you might have an external, more low-level gRPC client that listens for completion of specific JSON API requests’ commands.

← Back to Discussions