...
Code Block |
---|
|
id:5644f2d497cc11144081d111\n
data:{"_id" : 5644f2d497cc11144081d111, "scope" : "connector", "recordId" : "LOCAL_ZONE:E0F57D337D5021236E353C7AB305F147", "timestamp" : 2015-11-12T20:13:08.243Z, "type" : "ADD", "__v" : 0}\n
data:{"key": "LOCAL_ZONE:E0F57D337D5021236E353C7AB305F147", "content": {"connector": {"doc": {"test": "data"}}}}\n\n |
Fetch Transactions
Fetch transactions in batches ordered chronologically using a startId to get the next batch of transactions.
Request
The fetch transactions GET/POST request receives the storage unit name and optionally the scope in the URL. It can also received a startId parameter to start getting transactions starting on that particular one, a doContentProcessing (default true) boolean parameter to trigger or not the Fetch events from content processing modules, a transactionsOnly (default false) boolean parameter to indicate whether or not the record data should be sent along a add/update transaction, an includeFirst parameter to indicate whether or not to include the transaction of startId or start from the next one and a zone parameter to indicate from which zone to get transactions from (all if omitted).
Code Block |
---|
|
GET subscription/fetchTransactions/<storage-unit>/<optional-scope>?startId=5644f2d497cc11144081d111&doContentProcessing=true&transactionsOnly=false&zone=LOCAL_ZONE |
Response
Responds with a 200 response code. The response body contains an array of transactions and a next transaction number for the next batch call. If there are no more transactions, the next transaction number is not part of the response.
Code Block |
---|
|
{"transactions":
[
{
"transaction": {
"_id": "578fbc689eabceb422d3b4b7",
"__v": 0,"fileUpdate": false,
"scope": "connector",
"recordId": "APP_ZONE:995BB4838C40E9900FD098F6205824D1",
"timestamp": "2016-07-20T18:01:12.234Z",
"type": "ADD"
},
"record": {
"content": {
"connector": {...}
},
"key": "APP_ZONE:995BB4838C40E9900FD098F6205824D1"
}
},
{
"transaction": {
"_id": "578fbc689eabceb422d3b4b8",
"__v": 0,"fileUpdate": false,
"scope": "connector",
"recordId": "APP_ZONE:995BB4838C40E9900FD098F6205824D2",
"timestamp": "2016-07-20T18:01:15.234Z",
"type": "ADD"
},
"record": {
"content": {
"connector": {...}
},
"key": "APP_ZONE:995BB4838C40E9900FD098F6205824D2"
}
}
],
"nextTransactionNum": "578fbc689eabceb422d3b4cb"
} |