Approve/Revoke Approval for Token Transfers

Grant or revoke approval to to to send a specified token. To revoke approval, enter 0x0000000000000000000000000000000000000000 for to.

You will see in Submitted in the response even when you enter the wrong token ID, the from and owner are differet. But that does not mean that it is successfully Committed. To confirm transaction status, use Get Transaction Receipt from the Wallet API.

From

from is the address that sends the transaction. If from is an account in the default account-pool of KIP-17 or Wallet Service, you can omit the KRN header.
Otherwise you need to include the KRN header (x-krn: krn:{chain-id}:wallet:{account-id}:account-pool:{pool name}).

Request
Security:
path Parameters
contract-address-or-alias
required
string

Contract address (in hex.) or alias.

token-id
required
string

The ID of the token that the to will be authorized to send.

header Parameters
x-chain-id
required
string

Kaia Network Chain ID (1001 or 8217)

x-krn
string

KRN (KAS Resource Name) unique to an Account Pool

Request Body schema: application/json
from
required
string

The Kaia account address of the owner.

to
required
string

The Kaia account address to be granted authority to transfer the token.

Responses
200

Your request was successful.

400

Your request is not valid.

401

The credential you entered is invalid.

post/v2/contract/{contract-address-or-alias}/approve/{token-id}
Request samples
application/json
{
  • "from": "0x9EaF20b40E0f1ced5dbba6f5Cfb0D3E12B0534f4",
  • "to": "0xDc277E2D89b92336A4ee80be3c7142443FDaDE47"
}
Response samples
application/json

Your request was successful.

{
  • "status": "Submitted",
  • "transactionHash": "0x0a56e8dba1afc0cc1b96c1dec0eccc611863c5c3a181101b73f7471f2a4e550b"
}