User communicates with the node thats running in the background via REST APIs. Below listed are the REST API Endpoints with which user can able to view information, transfer tokens and so on.
Field
Endpoint
Description
Sample Request
DID Creation
/createDID
Creates a unique Decentralized IDentity
curl --location --request POST 'http://localhost:1898/create' --form 'data="Rubik"' --form 'image=@"imagepath"'
Initial Setup
/start
Does the initial setup of IPFS and syncing the network nodes.
curl --header "Content-Type: application/json" --request GET 'http://localhost:1898/start'
Transfers token(s) from one wallet address to another
curl --header "Content-Type: application/json" --request POST http://localhost:1898/initiateTransaction --data '{ "receiver": "<receiver DID here>", "tokenCount":1, "comment":"transaction comments", "type":1, "pvtKeyPass" : "<password>"}'
Unpledge Tokens
/unpledgeToken
Unpledge the pledged tokens
curl --location --request POST 'http://localhost:1898/unpledgeToken' --header 'Content-Type: application/json' --data-raw '{"tokenList": "<hash of token to be unpledged. >"}'
Field
Endpoint
Description
Sample Request
Account Information
/getAccountInfo
Retrieves the user account details
curl --header "Content-Type: application/json" --request GET http://localhost:1898/getAccountInfo
Get Transaction Details with Transaction ID
/getTxnDetails
Details of a particular transaction like Quorum involved, token transferred, receiver details, time and more
curl --header "Content-Type: application/json" --request POST http://localhost:1898/getTxnDetails --data '{"transactionID": "<transaction ID here>"}'
Get Transaction Details with Date
/getTxnByDate
Retrieves the details of all the transactions committed during the specified period
curl --header "Content-Type: application/json" --request POST <http://localhost:1898/getTxnByDate> --data-raw '{"sDate":"Wed Jun 09 12:56:04 AST 2021","eDate":"Wed Jun 09 12:57:58 AST 2021"}'
Get Transaction Details with Comment
/getTxnByComment
Retrieves the details of all the transactions committed with the specified comment.
curl --header "Content-Type: application/json" --request POST http://localhost:1898/getTxnByComment --data '{"comment":"First"}'
Get Transaction Details with Count
/getTxnByCount
Retrieves the last specified count of transactions committed