BatchGetTokenBalance
Note
End of support notice: Amazon Managed Blockchain will stop accepting new customers on October 29, 2026. Existing customers can continue using Amazon Managed Blockchain until September 29, 2027. After September 29, 2027 you will no longer be able to access Amazon Managed Blockchain. For more information, see Amazon Managed Blockchain availability change.
Gets the token balance for a batch of tokens by using the BatchGetTokenBalance
action for every token in the request.
Note
Only the native tokens BTC and ETH, and the ERC-20, ERC-721, and ERC 1155 token standards are supported.
Request Syntax
POST /batch-get-token-balance HTTP/1.1
Content-type: application/json
{
"getTokenBalanceInputs": [
{
"atBlockchainInstant": {
"time": number
},
"ownerIdentifier": {
"address": "string"
},
"tokenIdentifier": {
"contractAddress": "string",
"network": "string",
"tokenId": "string"
}
}
]
}
URI Request Parameters
The request does not use any URI parameters.
Request Body
The request accepts the following data in JSON format.
- getTokenBalanceInputs
-
An array of
BatchGetTokenBalanceInputItemobjects whose balance is being requested.Type: Array of BatchGetTokenBalanceInputItem objects
Array Members: Minimum number of 1 item. Maximum number of 10 items.
Required: No
Response Syntax
HTTP/1.1 200
Content-type: application/json
{
"errors": [
{
"atBlockchainInstant": {
"time": number
},
"errorCode": "string",
"errorMessage": "string",
"errorType": "string",
"ownerIdentifier": {
"address": "string"
},
"tokenIdentifier": {
"contractAddress": "string",
"network": "string",
"tokenId": "string"
}
}
],
"tokenBalances": [
{
"atBlockchainInstant": {
"time": number
},
"balance": "string",
"lastUpdatedTime": {
"time": number
},
"ownerIdentifier": {
"address": "string"
},
"tokenIdentifier": {
"contractAddress": "string",
"network": "string",
"tokenId": "string"
}
}
]
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- errors
-
An array of
BatchGetTokenBalanceErrorItemobjects returned from the request.Type: Array of BatchGetTokenBalanceErrorItem objects
Array Members: Minimum number of 0 items. Maximum number of 10 items.
- tokenBalances
-
An array of
BatchGetTokenBalanceOutputItemobjects returned by the response.Type: Array of BatchGetTokenBalanceOutputItem objects
Array Members: Minimum number of 0 items. Maximum number of 10 items.
Errors
For information about the errors that are common to all actions, see Common Error Types.
- AccessDeniedException
-
The AWS account doesn’t have access to this resource.
- message
-
The container for the exception message.
HTTP Status Code: 403
- InternalServerException
-
The request processing has failed because of an internal error in the service.
- message
-
The container for the exception message.
- retryAfterSeconds
-
Specifies the
retryAfterSecondsvalue.
HTTP Status Code: 500
- ResourceNotFoundException
-
The resource was not found.
- message
-
The container for the exception message.
- resourceId
-
The
resourceIdof the resource that caused the exception. - resourceType
-
The
resourceTypeof the resource that caused the exception.
HTTP Status Code: 404
- ServiceQuotaExceededException
-
The service quota has been exceeded for this resource.
- message
-
The container for the exception message.
- quotaCode
-
The container for the
quotaCode. - resourceId
-
The
resourceIdof the resource that caused the exception. - resourceType
-
The
resourceTypeof the resource that caused the exception. - serviceCode
-
The container for the
serviceCode.
HTTP Status Code: 402
- ThrottlingException
-
The request or operation couldn't be performed because a service is throttling requests. The most common source of throttling errors is when you create resources that exceed your service limit for this resource type. Request a limit increase or delete unused resources, if possible.
- message
-
The container for the exception message.
- quotaCode
-
The container for the
quotaCode. - retryAfterSeconds
-
The container of the
retryAfterSecondsvalue. - serviceCode
-
The container for the
serviceCode.
HTTP Status Code: 429
- ValidationException
-
The resource passed is invalid.
- fieldList
-
The container for the
fieldListof the exception. - message
-
The container for the exception message.
- reason
-
The container for the reason for the exception
HTTP Status Code: 400
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: