Forum Discussion
ABW - Obtaining the Contract Id (or LedgerIdentifier) on a newly created contract via Rest API?
Calling POST /api/v1/contracts should return back the ID of the contract, which you can use to query with GET.
You're right, thanks, it's the GatewayApi sample code which is discarding the contractid:
Replacing string.Empty with await msg.Content.ReadAsStringAsync() returns the newly allocated contract id as a raw string
- Stuart CorransDec 04, 2018Copper Contributor
For anyone interested, ABW 1.5 and hopefully onward now DO allow for asynchronous tie-ups of the Request and Response on the Messaging API : https://docs.microsoft.com/en-us/azure/blockchain/workbench/messages-overview
The user-supplied `requestId` that Contract and Contract Action requests accept is then echoed back on the ABW EventGrid (and I think also on the egress Service Bus topic), along with the assigned ContractId ContractAddress (Contract Creates) and ContractActionId / TransactionId (Contract Actions)