Transaction Web Service

From Fusion Registry Wiki
Revision as of 04:35, 4 February 2021 by Plazarou (talk | contribs) (Querying for a specific Transaction)
Jump to navigation Jump to search

Overview

The Transaction Web Service provides access to all the structural metadata content of the Fusion Registry (including any content that has been subsequently deleted). A Transaction is the submission of a structure, group of structures or data registration.

Querying and Searching All Transactions

Returns a JSON Array of all of the structures in the Registry, filterable by parameter.

Entry Point /ws/registry/tx/searchTransactions
Access Public
Http Method GET
Response Format application/json
Response Statuses

200 - Submission Accepted

Response

The output shows the Date (as a millisecond epoch time), the Transaction Id, the action and the Transaction Type. A typical example:

 [
   {
     "Date": 1612434466642,
     "Id": 785,
     "Action": "Replace",
     "Type": "Structure Submission"
   },
   {
     "Date": 1612434448408,
     "Id": 784,
     "Action": "Replace",
     "Type": "Structure Submission"
   },
   ...
 ]


HTTP Query Parameters

If no parameters are supplied all transactions known to the Registry will be returned. If any of the filters applied below result in no results, an empty JSON response (HTTP 200) is returned.

Request Parameter Required Purpose
action No Filters the response to only include Transaction for the specified action. Legal values are Append, Replace, FullReplace and Delete.
dateFrom No Filters the response to only include Transactions from the specified time. The value must be specified as the epoch time in milliseconds (e.g. 1609459200000 is the start of the year 2021).
dateTo No Filters the response to only include Transactions up to the specified time. The value must be specified as the epoch time in milliseconds (e.g. 1609459200000 is the start of the year 2021).
max No Limits the returned response to only containing at most the specified value.
orderDesc No The default output is that Transactions are returned in a descending order (most recent first). Supplying false to this parameter reverses the order.
user No Filters the response to only include Transactions for the specified user.

Querying for all URNs

Returns a JSON Array of all the maintainable URNs (both current and deleted) in the Registry.

Entry Point /ws/registry/tx/getAllUrns
Access Public
Http Method GET
Response Format application/json
Response Statuses

200 - Submission Accepted

Response

An alphabetically ordered list of all of the URNs in the system. A typical example:

 [
   "urn:sdmx:org.sdmx.infomodel.datastructure.Dataflow=WB:WDI_POVERTY(1.0)",
   "urn:sdmx:org.sdmx.infomodel.registry.ProvisionAgreement=BIS.LBS:TLBR_WS8_BIS_PH2(1.0)",
   "urn:sdmx:org.sdmx.infomodel.codelist.Codelist=SDMX:CL_BAR(1.0)",
   "urn:sdmx:org.sdmx.infomodel.datastructure.Dataflow=AAA.SUB1:DF1(1.0)",
   ...
 ]

Querying for a specific URN

Provides information regarding who made changes to a particular structure. It returns the user id (and date, transaction id and action) of who last modified the maintainable with the given URN.

Entry Point /ws/registry/tx/history
Access Public
Http Method GET
Response Format application/json
Response Statuses

200 - Submission Accepted

500 - Illegal URN

Response

An ordered list of transactions (lowest transaction number first) of the transactions for the specified URN, showing the date, transaction ID and Action. A typical example:

 [
   {
     "Date": 1612358238673,
     "Id": 449,
     "Action": "Replace",
     "Type": "Structure Submission"
   },
   {
     "Date": 1612358239170,
     "Id": 450,
     "Action": "Delete",
     "Type": "Structure Submission"
   },
   {
     "Date": 1612358239657,
     "Id": 451,
     "Action": "Replace",
     "Type": "Structure Submission"
   },
   ...
 ]

HTTP Query Parameters

Request Parameter Required Purpose
urn Yes The URN of the requested structure.

Querying for a specific Transaction

With a specific Transaction ID, the structure can be requested at that particular point in time

Entry Point /ws/registry/tx/transactions
Access Public
Http Method GET
Response Format application/json SDMX
Response Statuses

200 - Submission Accepted

500 - Illegal URN

Response

HTTP Query Parameters

Request Parameter Required Purpose
urn Yes The URN of the requested structure.
format No A structure format. Default output is SDMX-ML 2.1. Other options include sdmx-json, fusion-json, sdmx-edi.

Last User to Edit a Structure

Returns the user id of the last user to edit a specific structure.

Entry Point /ws/registry/tx/userIdFromReg
Access Public
Http Method GET
Response Format application/json SDMX
Response Statuses

200 - Submission Accepted

400 - Illegal URN

HTTP Query Parameters

Request Parameter Required Purpose
urn Yes The URN of the requested structure.