Query Atomic Transaction

get

/restproxy/api/v2/atomicTransactions/{globalTransactionId}

Query an atomic transaction.

Request

Supported Media Types
Path Parameters
Query Parameters
Back to Top

Response

Supported Media Types

200 Response

Successful operation
Body ()
Root Schema : schema
Type: object
Show Source
Nested Schema : atomicTransactionResults
Type: object
Show Source
Nested Schema : atomicTransactionLRCResults
Type: object
Show Source
Nested Schema : transactions
Type: array
Details of individual transactions processed
Show Source
Nested Schema : atomicTransactionEthResponse
Type: object
Show Source
Nested Schema : atomicTransactionIndividualResults
Type: object
Show Source
Nested Schema : commit
Type: object
Details on the commit phase of the transaction
Show Source
Nested Schema : prepare
Type: object
Details on the prepare phase of the transaction
Show Source
Nested Schema : rollback
Type: object
Details on the rollback phase of the transaction
Show Source

400 Response

Bad Request

401 Response

Not authorized

403 Response

Forbidden

404 Response

Invalid parameters

500 Response

Service unavailable
Back to Top

Examples

This endpoint is used to query the status of an atomic transaction by providing the global (atomic) transaction ID.

The following example shows how to query an atomic transaction by submitting a GET request on the REST resource using cURL.

curl -v -u <username>:<password> -X GET \
  "https://<rest proxy of your blockchain instance>/api/v2/atomicTransactions/<global_transaction_id>" \
  -H "accept: application/json"

For example,

curl -v -u <username>:<password> -X GET \
  "https://myvm.oracle.com:10001/restproxy/api/v2/atomicTransactions/21438a99-9fd7-4f96-b0bf-259910a26006" \
  -H "accept: application/json"

Example of the Response Body

The following example shows the contents of the response body in JSON format for a successful atomic transaction:

{
  "returnCode": "Success",
  "error": "",
  "result": {
    "transactions": [
      {
        "channel": "goods",
        "chaincode": "obcs-marbles",
        "txstatus": "Committed",
        "prepare": {
          "txid": "bb248ef3f948cb107417c3f66ea144910644dee8086a370d44687fd9fe262233"
        },
        "commit": {
          "txid": "21068846ef85942f9df1ccfd27dcb95d509146c5a0d10c6366642215badcb3b4"
        },
        "rollback": {}
      },
      {
        "channel": "wallet",
        "chaincode": "obcs-example02",
        "txstatus": "Committed",
        "prepare": {
          "txid": "08d03d7170e7f696c79da0aa60142bbfdc08b3d92cee0d9423983dd19caf809c"
        },
        "commit": {
          "txid": "ef9d8a824631f9e671162b81c7d1617080746ef3897b029cfbef1cfd1594d0ab"
        },
        "rollback": {}
      }
    ],
    "globalStatus": "Success",
    "globalTxid": "21438a99-9fd7-4f96-b0bf-259910a26006",
    "txStartTime": "2022-08-15T16:16:19.2180799642"
  }
}

In this case, the value returned for globalStatus is Success, which indicates that all of the transactions that the atomic transaction comprises were committed successfully.

Back to Top