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:

Sample response

{
	"access_token": "7ct9AUUCOnjdj577Iy2Ziu6pjWwLfl",
	"expires_in": 36000,
	"token_type": "Bearer",
	"scope": "read write",
	"refresh_token": "vUzXEA1WTvL7eAf9MAGfzFgXqyX6Gc"
}

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:

Sample response

{
	"access_token": "Eo4GmFh45V3Yk6AcChVrJtOU08AfpQ",
	"expires_in": 36000,
	"token_type": "Bearer",
	"scope": "read write",
	"refresh_token": "tcJLrF0alvLejLdoh9cCLSVAvlDg3a"
}

Get user data

Retrieving user’s information

Method: GET

Endpoint: /user/me/

Headers:

Body: None

Sample response

{
	"username": "your_username",
	"email": "your_email@gmail.com",
	"first_name": "",
	"last_name": "",
	"date_joined": "2020-09-28T06:00:23.745789Z",
	"last_login": "2020-09-28T06:00:37.622188Z",
	"wallet": {
		"balance": 0.0,
		"wallet_address": "0xc7849145419ee7d0f600Ae95A1C630FFB5287AFB"
	}
}

Register

User enters information during the registration process

Method: POST

Endpoint: /user/register/

Headers: None

Body:

Sample response

{
	"success":  [
		"Registration successful"
	]
}

Introspec token

Checks the validity of the access token, gets back user information and expiration date.

Method: GET

Endpoint: /oauth2/introspec/

Headers: None

Param:

Sample response

{
	"active":  true,
	"scope":  "read write",
	"exp":  1601476131,
	"client_id":  "lJmS5wt6L0m9cU9Fd2zo37VOWg7dTf0YAiDWbCSS",
	"username":  "admin"
}

My wallet

Return mainnet wallet address.

Method: GET

Endpoint: /user/my-wallet

Headers:

Body: None

Response:

Sample response

{
  "success": 
  [{
    “wallet_address”: "0xA158A517C587fF706B0c639388B1722b78538FDE", 
    “balance”: "720308601624999676960",
    “balance_display”: 720.3086016249997,
    “Nonce”: 11
  }]
}

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:

Sample request:

raw_tx = {
 "to": "0x772b965f2466A23370dB463d4E4fb25d84f1d72F",
 "value": 100000000000,
 "gas": 29000,
 "gasPrice": 1000000,
 "nonce": 12
}

Response:

Response contains the transaction hash if success or error message.

Sample response:

{
  "success": ["0xd5cf583b8d0fa47d8b320b14f63caf759f0cd1b6c3a297e0db837b9435f8a550"]
}

Password Reset

KardiaID Service sends an email password reset to user which contains password reset token.

Method: POST

Endpoint: /user/resetpassword/

Body

Password Reset Confirm

Reset user password to new provided password and emailed token.

Method: POST

Endpoint: /user/resetpassword/confirm/

Body:

Last updated