All Products
Search
Document Center

Query Transaction Information

Last Updated: Apr 03, 2020

Query the blockchain network for information of a transaction.

API

GET /api/v1/networks/{network}/transactions/{id}

Url Path Args Description
network Fabric channel name
id Transaction ID

Response

name type Description
Success Boolean Indicating if the request was successful.
Error Error -
Result Transaction -

Error

name type Description
code Integer Error code
message String Error description
request_id String The id of this request

Transaction

name type Description
id String TransactionID
state String Transaction status,”VALID” indicates a legal transaction, other values indicate an illegal transaction
from String The originator of the transaction,the format is <organizationMSP>.<username>
to String The name of the target chaincode of the Transaction invoke
input String Json-encoded chaincode call arguments
events List<Event> List of blockchain events generated by the transaction
data Object Details of the transaction, the data structure is common.Payload of the ransaction

Event

name type Description
id String Event ID, unique within the channel
name String Event name
type EventType Event type(“Tx”, “Config”, “Contract”, “Block”),The result returned by this interface contains only “Contract” type events (if any)
content String When EventType is “Contract”, it is Base64 encoded smart contract event content (if any)

Examples

Request Example

  1. curl -X GET "http://your.gateway.endpoint/api/v1/networks/channel3/transactions/e49d411a2ff32caa1688b5e0a07a957d2d8a4c8c124554772d07145214b3ba13" -H "accept: application/json" -H "Authorization: Bearer <Your Access Token>"

Example of Normal Return

  1. {
  2. "Success": true,
  3. "Result": {
  4. "id": "e49d411a2ff32caa1688b5e0a07a957d2d8a4c8c124554772d07145214b3ba13",
  5. "state": "VALID",
  6. "from": "e2ehmfqasthMSP.octopus_26842_12345678901234",
  7. "to": "sacc",
  8. "input": "[\"set\",\"provider\",\"aliyun3\"]",
  9. "events": null,
  10. "data": {
  11. "data": {
  12. "actions": [
  13. {
  14. "header": {
  15. "creator": {
  16. "id_bytes": "LS0tLS1CR...SUZJQ0FURS0tLS0tCg==",
  17. "mspid": "e2ehmfqasthMSP"
  18. },
  19. "nonce": "HdQ823siiR5yzRq/sGkrD0y6jTMOVkuG"
  20. },
  21. "payload": {
  22. "action": {
  23. "endorsements": [
  24. {
  25. "endorser": "Cg5lMmVobW...S0tLS0tCg==",
  26. "signature": "MEQCIHm9YG6PbIUpqa3DF6l6h5vRTQxbGVyWkiYqOAIX5pa2AiBFQNvTfzlf951oj/ki0eGbB0AV9fGwBA8TpXMhyoGdgg=="
  27. }
  28. ],
  29. "proposal_response_payload": {
  30. "extension": {
  31. "chaincode_id": {
  32. "name": "sacc",
  33. "path": "",
  34. "version": "3.0"
  35. },
  36. "events": null,
  37. "response": {
  38. "message": "",
  39. "payload": "YWxpeXVuMw==",
  40. "status": 200
  41. },
  42. "results": {
  43. "data_model": "KV",
  44. "ns_rwset": [
  45. {
  46. "collection_hashed_rwset": [],
  47. "namespace": "lscc",
  48. "rwset": {
  49. "metadata_writes": [],
  50. "range_queries_info": [],
  51. "reads": [
  52. {
  53. "key": "sacc",
  54. "version": {
  55. "block_num": "16",
  56. "tx_num": "0"
  57. }
  58. }
  59. ],
  60. "writes": []
  61. }
  62. },
  63. {
  64. "collection_hashed_rwset": [],
  65. "namespace": "sacc",
  66. "rwset": {
  67. "metadata_writes": [],
  68. "range_queries_info": [],
  69. "reads": [],
  70. "writes": [
  71. {
  72. "is_delete": false,
  73. "key": "provider",
  74. "value": "YWxpeXVuMw=="
  75. }
  76. ]
  77. }
  78. }
  79. ]
  80. }
  81. },
  82. "proposal_hash": "dEy87BXYByKTxVjk2A0XMViX402pbHQOjAq/Y6i0XG0="
  83. }
  84. },
  85. "chaincode_proposal_payload": {
  86. "TransientMap": {},
  87. "input": {
  88. "chaincode_spec": {
  89. "chaincode_id": {
  90. "name": "sacc",
  91. "path": "",
  92. "version": ""
  93. },
  94. "input": {
  95. "args": [
  96. "c2V0",
  97. "cHJvdmlkZXI=",
  98. "YWxpeXVuMw=="
  99. ],
  100. "decorations": {},
  101. "is_init": false
  102. },
  103. "timeout": 0,
  104. "type": "GOLANG"
  105. }
  106. }
  107. }
  108. }
  109. }
  110. ]
  111. },
  112. "header": {
  113. "channel_header": {
  114. "channel_id": "channel3",
  115. "epoch": "0",
  116. "extension": "EgYSBHNhY2M=",
  117. "timestamp": "2020-02-13T08:09:31.588293471Z",
  118. "tls_cert_hash": null,
  119. "tx_id": "e49d411a2ff32caa1688b5e0a07a957d2d8a4c8c124554772d07145214b3ba13",
  120. "type": 3,
  121. "version": 0
  122. },
  123. "signature_header": {
  124. "creator": {
  125. "id_bytes": "LS0tLS1CR...0FURS0tLS0tCg==",
  126. "mspid": "e2ehmfqasthMSP"
  127. },
  128. "nonce": "HdQ823siiR5yzRq/sGkrD0y6jTMOVkuG"
  129. }
  130. }
  131. }
  132. },
  133. "Error": {
  134. "code": 200,
  135. "message": "Success",
  136. "request_id": "759fb8ee-9763-4355-b742-becc81cb7bf5"
  137. }
  138. }

Error Code

Please refer to Error Code