Get all assets from user.
curl --request GET \
--url https://lab.trustos.telefonicatech.com/track/v2/assets \
--header 'Authorization: Bearer <token>'import requests
url = "https://lab.trustos.telefonicatech.com/track/v2/assets"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://lab.trustos.telefonicatech.com/track/v2/assets', 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://lab.trustos.telefonicatech.com/track/v2/assets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://lab.trustos.telefonicatech.com/track/v2/assets"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://lab.trustos.telefonicatech.com/track/v2/assets")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://lab.trustos.telefonicatech.com/track/v2/assets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"statusCode": 200,
"message": "Assets retrieved successfully",
"data": {
"assets": [
{
"trackID": "did:trustos:trackid:<id>",
"assetId": "asset-test-01",
"data": {
"id": "A2839RP",
"version": "1"
},
"networkId": 10004,
"assetHash": "6c253e352981fabaf6ba78a301cd116320010a13abe8abf8428eaedcee7ddabd",
"transactions": [
{
"metadata": {
"color": "red",
"position": {
"x": "23.34",
"y": "-24.22"
}
},
"timestamp": 1711538908,
"userOwner": "did:user:{issuer}",
"hash": "456fc02752e48108af8548b4544c3ab6deb30d091567cff0b5d69a3beda5678d",
"smartContract": "0xabcdbcbff5fa05e060e7dfe3e608cba010d11abc",
"transactionHash": "0x456dbcbff5fa05e060e7dfe3e608cba010d112c75ffbc6531a09b2a1351b3452"
}
]
}
],
"pagination": {
"offset": 0,
"limit": 30,
"total": 3,
"order": "desc"
}
}
}{
"statusCode": 400,
"type": "Validation Error",
"message": "Request parameters are wrong, check requirements",
"errors": [
{
"field": "",
"error": ""
}
]
}{
"statusCode": 401,
"type": "Authentication Error",
"message": "Token is not provided"
}{
"statusCode": 500,
"type": "Internal Server Error",
"message": "Oops! Something went wrong, please try again later"
}Asset Management
Get Assets
Retrieves all assets of the user.
GET
/
assets
Get all assets from user.
curl --request GET \
--url https://lab.trustos.telefonicatech.com/track/v2/assets \
--header 'Authorization: Bearer <token>'import requests
url = "https://lab.trustos.telefonicatech.com/track/v2/assets"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://lab.trustos.telefonicatech.com/track/v2/assets', 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://lab.trustos.telefonicatech.com/track/v2/assets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://lab.trustos.telefonicatech.com/track/v2/assets"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://lab.trustos.telefonicatech.com/track/v2/assets")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://lab.trustos.telefonicatech.com/track/v2/assets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"statusCode": 200,
"message": "Assets retrieved successfully",
"data": {
"assets": [
{
"trackID": "did:trustos:trackid:<id>",
"assetId": "asset-test-01",
"data": {
"id": "A2839RP",
"version": "1"
},
"networkId": 10004,
"assetHash": "6c253e352981fabaf6ba78a301cd116320010a13abe8abf8428eaedcee7ddabd",
"transactions": [
{
"metadata": {
"color": "red",
"position": {
"x": "23.34",
"y": "-24.22"
}
},
"timestamp": 1711538908,
"userOwner": "did:user:{issuer}",
"hash": "456fc02752e48108af8548b4544c3ab6deb30d091567cff0b5d69a3beda5678d",
"smartContract": "0xabcdbcbff5fa05e060e7dfe3e608cba010d11abc",
"transactionHash": "0x456dbcbff5fa05e060e7dfe3e608cba010d112c75ffbc6531a09b2a1351b3452"
}
]
}
],
"pagination": {
"offset": 0,
"limit": 30,
"total": 3,
"order": "desc"
}
}
}{
"statusCode": 400,
"type": "Validation Error",
"message": "Request parameters are wrong, check requirements",
"errors": [
{
"field": "",
"error": ""
}
]
}{
"statusCode": 401,
"type": "Authentication Error",
"message": "Token is not provided"
}{
"statusCode": 500,
"type": "Internal Server Error",
"message": "Oops! Something went wrong, please try again later"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Number of assets to skip.
Maximum number of assets to return.
Sort assets ascending or descending by date of creation.
Available options:
asc, desc Fields to return in the response separated by commas.
Was this page helpful?
⌘I