KardiaID Service API
These are APIs that are used for the KardiaID Service (KAIBase).
Get request token
User requests access-token using username and password to KardiaID Service, and KardiaID Service return access-token information
Method: POST
Endpoint: /oauth2/token/
Headers: None
Body:
Field | Type | Description |
client_id | string | Client ID received from KardiaID Service |
client_secret | string | Client secret received from KardiaID Service |
grant_type | string | Credential grant type. For this phase, should be set to password |
username | string | username |
password | string | password |
Sample response
Refresh token
User needs to refresh access-token and KardiaID Service return with new fresh access-token
Method: POST
Endpoint: /oauth2/token/
Headers: None
Body:
Field | Type | Description |
client_id | string | Client ID received from KardiaID Service |
client_secret | string | Client secret received from KardiaID Service |
grant_type | string | Credential grant type. To refresh token, set this field to refresh_token |
refresh_token | string | User’s refresh token received from API Get request token |
Sample response
Get user data
Retrieving user’s information
Method: GET
Endpoint: /user/me/
Headers:
Field | Type | Description |
Authorization | String (basic authentication) | Value should be Bearer <TOKEN> |
Body: None
Sample response
Register
User enters information during the registration process
Method: POST
Endpoint: /user/register/
Headers: None
Body:
Field | Type | Description |
username | string | username |
string | User’s email | |
password | string | User’s password |
first_name | string | User’s first name |
last_name | string | User’s last name |
Sample response
Introspec token
Checks the validity of the access token, gets back user information and expiration date.
Method: GET
Endpoint: /oauth2/introspec/
Headers: None
Param:
Field | Type | Description |
token | string | Access token to intro-spec |
Sample response
My wallet
Return mainnet wallet address.
Method: GET
Endpoint: /user/my-wallet
Headers:
Field | Type | Description |
Authorization | String (basic authentication) | Value should be Bearer <TOKEN> |
Body: None
Response:
Field | Type | Description |
Wallet_address | Address string | Wallet address on mainnet |
Balance | Balance in string | Wallet balance in small unit HYDRO (KAI * 10^18) |
Balance_display | KAI balance in float point | KAI balance for easier display |
Nonce | Account nonce in integer | Account nonce to send transactions |
Sample response
Send transaction
Send transaction to Kardia Mainnet, the endpoint requests Trusted Client Authentication. Transaction is signed with a user private key on KardiaID Service and pushed to Kardia mainnet.
Raw_tx contains fields of Kardia mainnet transactions, in JSON format.
Method: POST
Endpoint: /user/send-transaction
Headers:
Field | Type | Description |
Authorization | String (basic authentication) | Value should be Bearer <TOKEN> |
Sample request:
Response:
Response contains the transaction hash if success or error message.
Sample response:
Password Reset
KardiaID Service sends an email password reset to user which contains password reset token.
Method: POST
Endpoint: /user/resetpassword/
Body
Field | Type | Description |
string | User email |
Password Reset Confirm
Reset user password to new provided password and emailed token.
Method: POST
Endpoint: /user/resetpassword/confirm/
Body:
Field | String | Description |
password | string | new password |
token | string | provided token from email |
Last updated