Inquiries on Query Parameters for Token History API
Hello. This is Klaytn API Service team.
Please refer to the following information regarding query parameters of Token History API.
When using a Token History API to check the token transfer history, you need to submit the query parameters as below. Among them, preset is a required parameter, so please create it in advance through KAS Console. To do so, access the Console page and click on Service > Token History > Preset on the menu bar on the left-hand side. For clarification, preset is a collection of EOA, FT, NFT, and MT contract addresses that can be used to easily and quickly check the transaction details of specific accounts.
As a side note, KAS manages Preset for each network, so please make sure to check the network before entering the preset value.
If an error occurs even when the query parameters including preset are entered correctly, we recommend that you double-check the header. The example below demonstrates a situation when a 400 error occurred even though the query parameters had no particular error.
For all types of KAS APIs, you have to enter the x-chain-id (Mainnet: 8217 / Baobab: 1001), but not the x-krn. However, you can see that the header is missing a credential. If you need an explanation of what Credentials are, please refer to How Do I Set Up Authorization. Though Axios call in the above example is indeed in the correct form, the header needs to be corrected as below and make the API call once again.
const headers = {
Authorization: // your credential,
'x-chain-id': `${chainId}`
}
If you have any further questions about the Token History API, please check the KAS document.
For additional inquiries, click on Inquiry Registration at the top of the KAS Help Center page if you are using a paid plan, or leave a post on the KAS community if you are using a free plan.