Skip to main content

Get Access Token interface

Before accessing the API, you need to obtain the AccessToken first, and all other interface calls need to add the token in the Header for permission verification.

Request URL:

http://wallet.unn.com:8080/v2/access_token/create

Request method: POST

Request parameters:

parametertyperequireddescription
addressstringtrueETH address
typestringtruelogin method, signature
signaturestringtruesignature information
timestampinttruetimestamp of signature message

Signature instructions

  1. Get the current timestamp (precision seconds)

  2. Splicing together with "employee-login-" into a string

  3. Use the sha256 algorithm to convert the string to a 32-byte hexadecimal string

  4. Use the private key to sign the string

request example

curl --location 'http://wallet.unn.com:8080/v2/access_token/create' \
--header 'Content-Type: application/json' \
--data '{
"body": {
"address": "0xA56aA8b7F3Fb0413dA417527C9b0C939C80244E9",
"type": "signature",
"signature": "0x81b32c670e1468472e256579d989f691d2f80a7987cff3134fcf5ace8d12325a17b078fbd65890026c20e822cea4061d29b46b9f833ff3325d4d3e32792de6051b",
"timestamp": 1695263348
}
}'

Return parameters:

parameter nametypedescription
idstringemployee ID, if it is the business owner, this field is empty
tokenstringtoken
employee_infoArrayInformation about the company the employee belongs to
--chainstringnetwork ERC20/TRC20
--contract_addrstringenterprise wallet contract address
--enterprisestringenterprise ID
--is_ownerboolIs the owner
--permissionArrayPermissions owned by this employee 2-Audit
--idstringemployee ID

return example

{
"code": 200,
"message": "success",
"data": {
"entity": {
"id": "64214d77cc557604809a238c",
"token": "service.eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMHg4N2YyNTA4MUU3RGNEZUZDYzA1NUZGMjhkNzVjOTYxNURjNDUwMEJDIiwiY29tcGFueV9uYW1lI jpbeyJjaGFpbiI6IkVSQzIwIiwiY29udHJhY3RfYWRkciI6IjB4YkFjNzJiN0NjRDMzYmNDNzNlNTk2YkRBQTMxOGY2ODJFOTNFQkFiMCIsImVudGVycHJpc2UiOiIweDM2NGQ5NWQyRWQ3ZT gyZDg4NGUwMjhlYTZkODYxMDBEMjVDZDVBMjciLCJpc19vd25lciI6ZmFsc2UsInBlcm1pc3Npb24iOlsxXSwiaWQiOiI2NDIxNGQ3N2NjNTU3NjA0ODA5YTIzOGMifV0sImNyZWF0ZVRpb WUiOjE2ODAyMjk1MTcsImV4cCI6MTY4MjgyMTUxNywiYWNjb3VudF9uYW1lIjoiIn0.vaKR_PBCfZx7sXahgHhAFV-OzeQKCqSwsfkffuG2dq8",
"employee_info": [
{
"chain": "ERC20",
"contract_addr": "0xbAc72b7CcD33bcC73e596bDAA318f682E93EBAb0",
"enterprise": "0x364d95d2Ed7e82d884e028ea6d86100D25Cd5A27",
"is_owner": false,
"permission": [1],
"id": "64214d77cc557604809a238c"
}
]
}
}
}