Skip to main content
European CommissionEBSI European Blockchain
Select the Environment you want to work withEnvironment:

JSON-RPC API

POST 

/trusted-policies-registry/v3/jsonrpc

The JSON-RPC API provides methods assisting the construction of blockchain transactions and interaction with the ledger.

Request

Bodyrequired

The body follows the JSON-RPC 2.0 specification.

It requires the following fields:

  • jsonrpc: must be exactly "2.0"
  • method: method to be invoked
  • params: method parameters
  • id: identifier established by the client

API Methods

insertPolicy

Requires an access token with tpr_write scope and the OPERATOR role in the Trusted Policies Registry.

Call to build an unsigned transaction to insert a policy in the registry.

Parameters:

  • from: Ethereum address of the signer
  • policyName: name of the policy.
  • description: description.

updatePolicy

Requires an access token with tpr_write scope and the OPERATOR role in the Trusted Policies Registry.

Call to build an unsigned transaction to update a policy.

Parameters:

  • from: Ethereum address of the signer
  • policyId: Policy ID
  • policyName: Policy Name
  • description: description.

Use either policyId OR policyName to identify the policy, but not both.

deactivatePolicy

Requires an access token with tpr_write scope and the OPERATOR role in the Trusted Policies Registry.

Call to build an unsigned transaction to deactivate a policy in the registry.

Parameters:

  • from: Ethereum address of the signer
  • policyId: ID of the policy to deactivate
  • policyName: Policy Name

Use either policyId OR policyName to identify the policy, but not both.

activatePolicy

Requires an access token with tpr_write scope and the OPERATOR role in the Trusted Policies Registry.

Call to build an unsigned transaction to activate a policy in the registry.

Parameters:

  • from: Ethereum address of the signer
  • policyId: ID of the policy to activate
  • policyName: Policy Name

Use either policyId OR policyName to identify the policy, but not both.

insertUserAttributes

Requires an access token with tpr_write scope and the OPERATOR role in the Trusted Policies Registry.

Call to build an unsigned transaction to insert user attributes in the registry.

Parameters:

  • from: Ethereum address of the signer
  • user: user address
  • attributes: attribute names

deleteUserAttribute

Requires an access token with tpr_write scope and the OPERATOR role in the Trusted Policies Registry.

Call to build an unsigned transaction to delete an user attribute in the registry.

Parameters:

  • from: Ethereum address of the signer
  • user: user address
  • attribute: attribute name

sendSignedTransaction

Requires an access token with tpr_write scope and the OPERATOR role in the Trusted Policies Registry.

Sends a signed transaction to the blockchain and returns the hash of the transaction.

Warning: the transaction is not immediately processed. Make sure to check that the transaction has been successfully included in a block before moving on.

You can get the receipt of the transaction by calling the eth_getTransactionReceipt method of Ledger API's Besu endpoint.

Receipts for pending transactions are not available, therefore you will have to wait until the transaction has been processed — usually a few seconds. We recommend you to poll the eth_getTransactionReceipt method until the receipt is available.

Once the receipt is available, you can check the status field to know if the transaction succeeded (0x1) or failed (0x0). If the transaction failed, the revertReason field will give you insights about the reason for the failure. You can learn more about the format of the revert reason in Besu's documentation.

    jsonrpc stringrequired

    Must be exactly "2.0"

    method stringrequired

    Method that needs to be invoked

    params object[]required

    Array of parameters

    id integerrequired

    Identifier established by the client

Responses

Response

Schema
    jsonrpc string

    Must be exactly "2.0"

    id integer

    Same identifier established by the client in the call

    result object

    Result of the call

    oneOf
    string
Loading...