Get all transactions from an asset.
curl --request GET \
--url https://lab.trustos.telefonicatech.com/track/v2/assets/{id}/transactions \
--header 'Authorization: Bearer <token>'import requests
url = "https://lab.trustos.telefonicatech.com/track/v2/assets/{id}/transactions"
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/{id}/transactions', 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/{id}/transactions",
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/{id}/transactions"
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/{id}/transactions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://lab.trustos.telefonicatech.com/track/v2/assets/{id}/transactions")
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": "1 transaction(s) found",
"data": {
"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"
}
]
}
}{
"statusCode": 401,
"type": "Authentication Error",
"message": "Token is not provided"
}{
"statusCode": 404,
"type": "Not Found Error",
"message": "Asset not found"
}{
"statusCode": 500,
"type": "Internal Server Error",
"message": "Oops! Something went wrong, please try again later"
}Asset Management
Get Transactions
Retrieves all transactions within a specified range throughout the entire lifecycle of an asset.
GET
/
assets
/
{id}
/
transactions
Get all transactions from an asset.
curl --request GET \
--url https://lab.trustos.telefonicatech.com/track/v2/assets/{id}/transactions \
--header 'Authorization: Bearer <token>'import requests
url = "https://lab.trustos.telefonicatech.com/track/v2/assets/{id}/transactions"
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/{id}/transactions', 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/{id}/transactions",
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/{id}/transactions"
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/{id}/transactions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://lab.trustos.telefonicatech.com/track/v2/assets/{id}/transactions")
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": "1 transaction(s) found",
"data": {
"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"
}
]
}
}{
"statusCode": 401,
"type": "Authentication Error",
"message": "Token is not provided"
}{
"statusCode": 404,
"type": "Not Found Error",
"message": "Asset not found"
}{
"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.
Path Parameters
Identifier of the asset.
Example:
"did:trustos:trackid:<id>"
Query Parameters
Timestamp from which to start retrieving transactions.
Example:
1695900959848
Timestamp from which to stop retrieving transactions.
Example:
1695901189267
Was this page helpful?
⌘I