Get a New Transaction ID and Nonce

get

/restproxy/api/v2/channels/{channelId}/transaction-id

Request an asynchronous-mode transaction ID and nonce by channel ID and enrollment. The transaction will be invoked later in asynchronous mode.

Request

Supported Media Types
Path Parameters
Query Parameters
Back to Top

Response

Supported Media Types

200 Response

Operation successful
Body ()
Root Schema : schema
Type: object
Show Source
Nested Schema : result
Type: object
Show Source

400 Response

Bad Request
Body ()
Root Schema : Error
Type: object
Error Information.
Show Source
Nested Schema : errors
Type: array
list of errors
Show Source
Nested Schema : warnings
Type: array
list of warnings
Show Source

401 Response

Unauthorized
Body ()
Root Schema : Error
Type: object
Error Information.
Show Source
Nested Schema : errors
Type: array
list of errors
Show Source
Nested Schema : warnings
Type: array
list of warnings
Show Source

403 Response

Forbidden

404 Response

Not Found
Body ()
Root Schema : Error
Type: object
Error Information.
Show Source
Nested Schema : errors
Type: array
list of errors
Show Source
Nested Schema : warnings
Type: array
list of warnings
Show Source

500 Response

Internal Server Error
Body ()
Root Schema : Error
Type: object
Error Information.
Show Source
Nested Schema : errors
Type: array
list of errors
Show Source
Nested Schema : warnings
Type: array
list of warnings
Show Source
Back to Top

Examples

This endpoint is used to generate asynchronous-mode transaction ID and nonce by channel ID and enrollment. The transaction will be invoked later in asynchronous mode. A nonce is a randomly generated number that can be used only once in an asynchronous transaction. It derives its name from number used only once.

The following example shows how to get a new asynchronous transaction ID and nonce 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/channels/default/transaction-id" \
  -H "accept: application/json"

For example,

curl -v -u <username>:<password> -X GET \
  "https://myvm.oracle.com:10001/restproxy/api/v2/channels/default/transaction-id" \
  -H "accept: application/json"

Note:

You can find the rest proxy value of your blockchain 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. The transaction ID and nonce generated in the response can be used to execute an asynchronous transaction later.

{
    "returnCode": "Success",
    "error": "",
    "result": {
        "txid": "afb7ebae607927a7d80caafd203e380443212045cb1f60ad26ce2bddd48fb7d9",
        "nonce": "bb8367a8ebf34eef53aa0e2eaca9039c1cb0b6f3a6c840ac"
    }
}
Back to Top