Get Transaction Information
get
/restproxy/api/v2/channels/{channelName}/transactions/{transactionId}
This endpoint is used to get the status and other details of a transaction based on its transaction ID.
Request
Supported Media Types
- application/json
Path Parameters
-
channelName(required): string
ID of the channel
-
transactionId(required): string
ID of the transaction
Query Parameters
-
role: string
Name of the Hyperledger Fabric enrollment to be used
Response
Supported Media Types
- application/json
200 Response
Operation successful
Root Schema : schema
Type:
Show Source
object-
error:
string
-
result:
object result
-
returnCode(required):
string
Allowed Values:
[ "Success", "Failure" ]
Nested Schema : result
Type:
Show Source
object-
encode:
string
Allowed Values:
[ "UTF-8", "JSON", "base64" ] -
message:
string
-
payload:
-
status(required):
string
Allowed Values:
[ "valid", "invalid", "not found" ]Transaction Status -
txid(required):
string
Transaction ID
400 Response
Bad Request
Headers
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
Root Schema : Error
Type:
objectError Information.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing.
-
message(required):
string
A human-readable error string.
401 Response
Unauthorized
Headers
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
Root Schema : Error
Type:
objectError Information.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing.
-
message(required):
string
A human-readable error string.
403 Response
Forbidden
404 Response
Not Found
Headers
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
Root Schema : Error
Type:
objectError Information.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing.
-
message(required):
string
A human-readable error string.
500 Response
Internal Server Error
Headers
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
Root Schema : Error
Type:
objectError Information.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing.
-
message(required):
string
A human-readable error string.
Examples
This endpoint is used to get the status and other details of a transaction based on its transaction ID.
The following example shows how to get the transaction details of your blockchain transaction by submitting a GET request on the REST resource using cURL.
curl -v -X GET \
"https://<restproxy of your Blockchain instance>/api/v2/channels/<channel_name>/transactions/{transactionId}" \
-H "Authorization: Bearer <OAuth_access_ token>" \
-H "accept: application/json"
For example,
curl -v -X GET \ "https://myvm.oracle.com:10001/restproxy/api/v2/channels/default/transactions/bc5221c648533646877505288fc50b6c6100394213694bf111f7a3183074a329" \ -H "Authorization: Bearer mF_9.B5f-4.1JqM" \ -H "accept: application/json"
Note:
You can find the REST proxy value of your instance from the Nodes tab of your instance console.Example of the Response Body
The following example shows the contents of the response body in JSON format:
{
"returnCode": "Success",
"error": "",
"result": {
"txid": "bc5221c648533646877505288fc50b6c6100394213694bf111f7a3183074a329",
"status": "valid",
"payload": 800,
"encode": "JSON"
}
}
As this transaction was invoked to query the balance of a, the value returned for payload can be interpreted as a's balance amount.