Get user badges
curl --request GET \
--url https://api.identityhub.app/users/{username}/badgesimport requests
url = "https://api.identityhub.app/users/{username}/badges"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.identityhub.app/users/{username}/badges', 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.identityhub.app/users/{username}/badges",
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.identityhub.app/users/{username}/badges"
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.identityhub.app/users/{username}/badges")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.identityhub.app/users/{username}/badges")
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{
"success": true,
"data": {
"items": [
{
"collectionAddress": "EQBx...abc",
"name": "TON Footstep SBT",
"description": "Awarded for completing a TON Footstep task",
"image": "https://cache.tonapi.io/imgproxy/footstep.webp",
"type": "SBT",
"importance": "HIGH",
"isSbt": true,
"count": 1,
"receivedAt": "2024-06-15T12:00:00.000Z"
}
],
"total": 123,
"offset": 123,
"count": 123,
"hasMore": true
}
}{
"success": false,
"error": "User not found",
"code": "NOT_FOUND"
}Users
Get user badges
Returns badges grouped by collection. Owner sees hidden badges with hidden flag.
GET
/
users
/
{username}
/
badges
Get user badges
curl --request GET \
--url https://api.identityhub.app/users/{username}/badgesimport requests
url = "https://api.identityhub.app/users/{username}/badges"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.identityhub.app/users/{username}/badges', 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.identityhub.app/users/{username}/badges",
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.identityhub.app/users/{username}/badges"
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.identityhub.app/users/{username}/badges")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.identityhub.app/users/{username}/badges")
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{
"success": true,
"data": {
"items": [
{
"collectionAddress": "EQBx...abc",
"name": "TON Footstep SBT",
"description": "Awarded for completing a TON Footstep task",
"image": "https://cache.tonapi.io/imgproxy/footstep.webp",
"type": "SBT",
"importance": "HIGH",
"isSbt": true,
"count": 1,
"receivedAt": "2024-06-15T12:00:00.000Z"
}
],
"total": 123,
"offset": 123,
"count": 123,
"hasMore": true
}
}{
"success": false,
"error": "User not found",
"code": "NOT_FOUND"
}Path Parameters
Unique username of the user
Query Parameters
Number of items to skip
Required range:
0 <= x <= 9007199254740991Number of items to return (max 100)
Required range:
1 <= x <= 100