Page 72/95
21January2021/Version 0
LEM International SA
Chemin des Aulx 8
1228 PLAN-LES-OUATES Switzerland
www.lem.com
The transaction must be terminated using a stop request. The necessary input to stop the active
transaction is its
transactionId
. Response to the stop request contains the final data structure,
in
/legal
format.
7.2.3. Transaction readouts
The last transaction and previous ones can be retrieved from the DCBM memory.
On the HTTP/REST interface, the DCBM supports two data formats for readouts:
•
LEM proprietary format, in
/legal
API (see §7.1)
•
Certified, billable, OCMF-compliant format in
/ocmf
API (see 7.1) (see
!
For backend storage, OCMF format shall be preferred over LEM format. See
Four modes of access are available. All the readings of transactions are digitally signed.
Retrieval mode
HTTP target
Detail
Retrieve the last transaction (or current)
/v1/legal
/v1/ocmf
If a transaction is on-going, this request
retrieves the current transaction.
Otherwise, the last one is retrieved.
Retrieve by
transactionId
(search limited to
last 840
transactions)
/v1/legal?transactionId=<xyz>
/v1/ocmf?transactionId=<xyz>
With <
xyz>
the
transactionId
of the
transaction to retrieve
(search limited to
last 840
transactions)
Retrieve by internal storage index
/v1/legal/<index>
/v1/ocmf/<index>
With <
index>
a positive number. See
below note.
1)
Internal
index number is provided
i
n the
response to a start transaction request.
Retrieve by chronological storage index
/v1/legal/-<index>
/v1/ocmf/-<index>
With
<index> = -1
the past transaction
before the latest
With
<index> = -20398
the oldest
transaction stored (once storage reached
full capacity).
Table 8: Solutions for retrieving past transactions
Note:
1)
Chronological storage index is advised for retrieving all stored transactions.
Indeed, behavior of internal storage index is as follows:
•
Transaction storage is a circular buffer, allowing wrap-around (see
"7.2.4. Memory depth"). Internal storage indexes
can span from 0 to 20425, with a buffer gap of 27 transactions.
•
Hence, retrieving all transactions through internal storage index might throw back HTTP error “404 - Not found” for
some internal storage indexes.