curl --request GET \
--url https://api.example.com/api/v1/accounts/{idOrAliasOrEvmAddress}/allowances/tokensimport requests
url = "https://api.example.com/api/v1/accounts/{idOrAliasOrEvmAddress}/allowances/tokens"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v1/accounts/{idOrAliasOrEvmAddress}/allowances/tokens', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/accounts/{idOrAliasOrEvmAddress}/allowances/tokens",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/accounts/{idOrAliasOrEvmAddress}/allowances/tokens"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/accounts/{idOrAliasOrEvmAddress}/allowances/tokens")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/accounts/{idOrAliasOrEvmAddress}/allowances/tokens")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"allowances": [
{
"amount": 75,
"amount_granted": 100,
"owner": "0.0.2",
"spender": "0.0.2",
"timestamp": {
"from": "1586567700.453054000",
"to": "1586567700.453054000"
},
"token_id": "0.0.2"
}
],
"links": {
"next": null
}
}{
"_status": {
"messages": [
{
"message": "Invalid parameter: account.id"
},
{
"message": "Invalid Transaction id. Please use \\shard.realm.num-sss-nnn\\ format where sss are seconds and nnn are nanoseconds"
}
]
}
}{
"_status": {
"messages": [
{
"message": "Not found"
}
]
}
}Get fungible token allowances for an account
Returns information for fungible token allowances for an account.
Ordering
The order is governed by a combination of the spender id and the token id values, with spender id being the parent column. The token id value governs its order within the given spender id.
Note: The default order for this API is currently ASC
Filtering
When filtering there are some restrictions enforced to ensure correctness and scalability.
The table below defines the restrictions and support for the endpoint
| Query Param | Comparison Operator | Support | Description | Example |
|---|---|---|---|---|
| spender.id | eq | Y | Single occurrence only. | ?spender.id=X |
| ne | N | |||
| lt(e) | Y | Single occurrence only. | ?spender.id=lte:X | |
| gt(e) | Y | Single occurrence only. | ?spender.id=gte:X | |
| token.id | eq | Y | Single occurrence only. Requires the presence of a spender.id query | ?token.id=lt:Y |
| ne | N | |||
| lt(e) | Y | Single occurrence only. Requires the presence of an lte or eq spender.id query | ?spender.id=lte:X&token.id=lt:Y | |
| gt(e) | Y | Single occurrence only. Requires the presence of an gte or eq spender.id query | ?spender.id=gte:X&token.id=gt:Y |
Both filters must be a single occurrence of gt(e) or lt(e) which provide a lower and or upper boundary for search.
curl --request GET \
--url https://api.example.com/api/v1/accounts/{idOrAliasOrEvmAddress}/allowances/tokensimport requests
url = "https://api.example.com/api/v1/accounts/{idOrAliasOrEvmAddress}/allowances/tokens"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/v1/accounts/{idOrAliasOrEvmAddress}/allowances/tokens', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/v1/accounts/{idOrAliasOrEvmAddress}/allowances/tokens",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/v1/accounts/{idOrAliasOrEvmAddress}/allowances/tokens"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/v1/accounts/{idOrAliasOrEvmAddress}/allowances/tokens")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/accounts/{idOrAliasOrEvmAddress}/allowances/tokens")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"allowances": [
{
"amount": 75,
"amount_granted": 100,
"owner": "0.0.2",
"spender": "0.0.2",
"timestamp": {
"from": "1586567700.453054000",
"to": "1586567700.453054000"
},
"token_id": "0.0.2"
}
],
"links": {
"next": null
}
}{
"_status": {
"messages": [
{
"message": "Invalid parameter: account.id"
},
{
"message": "Invalid Transaction id. Please use \\shard.realm.num-sss-nnn\\ format where sss are seconds and nnn are nanoseconds"
}
]
}
}{
"_status": {
"messages": [
{
"message": "Not found"
}
]
}
}Path Parameters
Account alias or account id or evm address
^(\d{1,10}\.){0,2}(\d{1,10}|(0x)?[A-Fa-f0-9]{40}|(?:[A-Z2-7]{8})*(?:[A-Z2-7]{2}|[A-Z2-7]{4,5}|[A-Z2-7]{7,8}))$Query Parameters
The maximum number of items to return
1 <= x <= 100The order in which items are listed
asc, desc The ID of the spender to return information for
^((gte?|lte?|eq|ne)\:)?(\d{1,10}\.\d{1,10}\.)?\d{1,10}$The ID of the token to return information for
^((gte?|lte?|eq|ne)\:)?(\d{1,10}\.\d{1,10}\.)?\d{1,10}$Was this page helpful?