Forum Discussion

Stuart Corrans's avatar
Stuart Corrans
Copper Contributor
Jul 04, 2018

ABW - Obtaining the Contract Id (or LedgerIdentifier) on a newly created contract via Rest API?

Although I understand that a new contract will be written asynchronously (although a contract record is immediately written to Sql Server with a pending ledger identifier once it is pulled off the queue by the Worker node Docker endpoint), it seems there isn't currently a reliable way to tie up the contract back to the caller who created it.

 

The closest I've gotten thus far is to use the Rest API ContractsGet endpoint to query all contracts written for the given workflow by the given userId, and find the latest one by timestamp - this is obviously prone to latency and concurrency issues under load.

 

It seems to me that it would be a good idea to allow the caller to also specify a reference correlation identifier to be stored on the Contract record

 

Have I perhaps missed something else obvious?

Resources