POST/trusted-policies-registry/v3/jsonrpc
The JSON-RPC API provides methods assisting the construction of blockchain transactions and interaction with the ledger.
Request
- application/json
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
Call to build an unsigned transaction to insert a policy in the registry. This method requires an access token with "tpr_write" scope and the OPERATOR role in the Trusted Policies Registry.
Parameters:
- from: Ethereum address of the signer
- policyName: name of the policy.
- description: description.
updatePolicy
Call to build an unsigned transaction to update a policy. This method requires an access token with "tpr_write" scope and the OPERATOR role in the Trusted Policies Registry.
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
Call to build an unsigned transaction to deactivate a policy in the registry. This method requires an access token with "tpr_write" scope and the OPERATOR role in the Trusted Policies 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
Call to build an unsigned transaction to activate a policy in the registry. This method requires an access token with "tpr_write" scope and the OPERATOR role in the Trusted Policies 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
Call to build an unsigned transaction to insert user attributes in the registry. This method requires an access token with "tpr_write" scope and the OPERATOR role in the Trusted Policies Registry.
Parameters:
- from: Ethereum address of the signer
- user: user address
- attributes: attribute names
deleteUserAttribute
Call to build an unsigned transaction to delete an user attribute in the registry. This method requires an access token with "tpr_write" scope and the OPERATOR role in the Trusted Policies Registry.
Parameters:
- from: Ethereum address of the signer
- user: user address
- attribute: attribute name
sendSignedTransaction
Call to send a signed transaction to the blockchain.
Must be exactly "2.0"
Method that needs to be invoked
Array of parameters
Identifier established by the client
Responses
- 200
- 400
Response
- application/json
- Schema
- Build tx
- Send Transaction
Schema
- MOD2
Must be exactly "2.0"
Same identifier established by the client in the call
result object
Result of the call
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"from": "0x416e6e6162656c2e4c65652e452d412d506f652e",
"to": "0xFde86148db58f57787C06BeAf63a9c3f789357b3",
"data": "0x0000...",
"nonce": "0x00",
"chainId": "0x1b3b",
"gasLimit": "0x10000",
"gasPrice": "0x00",
"value": "0x00"
}
}
{
"jsonrpc": "2.0",
"id": 1,
"result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331"
}
Bad request
- application/problem+json
- Schema
- Bad Request
Schema
Default value: about:blank
An absolute URI that identifies the problem type. When dereferenced, it SHOULD provide human-readable documentation for the problem type.
A short summary of the problem type.
Possible values: >= 400
and <= 600
The HTTP status code generated by the origin server for this occurrence of the problem.
A human readable explanation specific to this occurrence of the problem.
An absolute URI that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced.
{
"title": "Bad Request",
"status": 400,
"detail": "Bad request."
}