getTokensByAccountAddress

Get a list of NFTs owned by the account.

Request

curl -X GET http://eth-mainnet.api.henesis.io/nft/v1/accounts/<accountAddress>/tokens?clientId=<clientId>&page=<page>&size=<size>&order_by=<order_by>&order_direction=<order_direction>&contractAddresses=<contractAddress1>,<contractAddress2>

Response

{
"data": [
{
"id": "40020079",
"owner": "0x138a35ee20e40f019e7e7c00386ab2ef42d66d1e",
"uri": "https://www.mycryptoheroes.net/metadata/hero/40020079",
"contract": {
"address": "0x273f7f8e6489682df756151f5525576e322d51a3",
"name": "MyCryptoHeroes:Hero",
"symbol": "MCHH",
"totalSupply": "15712"
}
},
...
{
"id": "40060029",
"owner": "0x138a35ee20e40f019e7e7c00386ab2ef42d66d1e",
"uri": "https://www.mycryptoheroes.net/metadata/hero/40060029",
"contract": {
"address": "0x273f7f8e6489682df756151f5525576e322d51a3",
"name": "MyCryptoHeroes:Hero",
"symbol": "MCHH",
"totalSupply": "15712"
}
}
],
"pagination": {
"totalCount": 10515,
"prevUrl": "http://api.henesis.io/nft/v1/accounts/0x138a35ee20e40f019e7e7c00386ab2ef42d66d1e/tokens?page=0&size=15&order_by=transfer_block_number&order_direction=desc&contractAddresses=0x273f7f8e6489682df756151f5525576e322d51a3",
"nextUrl": "http://api.henesis.io/nft/v1/accounts/0x138a35ee20e40f019e7e7c00386ab2ef42d66d1e/tokens?page=2&size=15&order_by=transfer_block_number&order_direction=desc&contractAddresses=0x273f7f8e6489682df756151f5525576e322d51a3"
}
}

Path Parameters

Name

Type

Description

accountAddress

string

The address of account for which you want to retrieve ERC721 tokens

Query Parameters

Name

Type

Description

clientId

string

The id required for authentication

page

integer

The page of results to return

size

integer

The number of ERC721 tokens to return in one request, specified as an integer from 1 to 200

order_by

string

The field by which the results is sorted Available Values:

transfer_block_number : Based on the block number where the transfer occurred (default)

order_direction

string

The order direction Available Values:

asc: Ascending Order

desc: Descending Order (default)

contractAddresses

List<string>

The contract addresses to filter. This field returns only the ERC721 tokens of the specified contract among the tokens owned by the account

If you request a contract not supported by Henesis in the contractAddress parameter, the API return an Not Supported Cotract. If you request a supported smart contract and unsupported smart contract in the contractAddress parameter at the same time, only data about the supported smart contract is provided.

Response Fields

data : The array of ERC721 tokens

Each token has the following fields:

Name

Type

Description

id

string

The id of ERC721 token

owner

string

The owner of ERC721 token

uri

string

The uri of ERC721 token

contract

object

The information of ERC721 contract

Each contract has the following fields:

Name

Type

Description

address

string

The address of ERC721 contract

name

string

The name of ERC721 contract

symbol

string

The symbol of ERC721 token

totalSupply

string

The totalSupply of ERC721 token

pagination: The pagination information of ERC721 token list

Name

Type

Description

totalCount

long

The number of all elements in this API request

prevUrl

string

The previous url of this API request

nextUrl

string

The next url of this API request

If prevUrl or nextUrl does not exist, it would be displayed as "".

Errors

If an error occurs, the following message is returned.

{
"error": {
"message": "Not Supported Contract",
"code": 404
}
}

The types of error handled are as follows.

code

message

description

404

Not Supported Contract

Occurs when requesting a not supported contract

401

Unauthorized user

Occurs when requesting with an unregistered clientId

400

Invalid parameter in [parameter]

Occurs when the value of the requested parameter is invalid

​