Get all certificates.
curl --request GET \
--url https://lab.trustos.telefonicatech.com/cert/v2/certificates \
--header 'Authorization: Bearer <token>'import requests
url = "https://lab.trustos.telefonicatech.com/cert/v2/certificates"
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/cert/v2/certificates', 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/cert/v2/certificates",
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/cert/v2/certificates"
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/cert/v2/certificates")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://lab.trustos.telefonicatech.com/cert/v2/certificates")
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": "Certificates retrieved successfully",
"data": {
"certificates": [
{
"certID": "did:local:certid:123124",
"data": {
"name": "Certificate",
"description": "Certificate description",
"content": {},
"issuer": "did:user:{issuer}",
"issuedOn": 1696840286580,
"hash": "a2ac9343a3d94e41bbc5c152fb8382c5233a47cee23cf765c7e6d67d9e61a142",
"expires": 1696840286580
},
"metadata": [
{
"networkId": 10004,
"smartContract": "0xabcdbcbff5fa05e060e7dfe3e608cba010d11abc",
"transactionHash": "0xabcdbcbff5fa05e060e7dfe3e608cba010d11abc",
"trustPointHash": "a2ac9343a3d94e41bbc5c152fb8382c5233a47cee23cf765c7e6d67d9e61a142",
"timestamp": 1696840286580
}
],
"access": {
"certificatePin": "1234",
"externalId": "extcertid"
}
}
],
"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"
}{
"statusCode": 500,
"type": "Internal Server Error",
"message": "Oops! Something went wrong, please try again later"
}Certificate Management
Get All Certificates
Retrieves all certificates of the user.
GET
/
certificates
Get all certificates.
curl --request GET \
--url https://lab.trustos.telefonicatech.com/cert/v2/certificates \
--header 'Authorization: Bearer <token>'import requests
url = "https://lab.trustos.telefonicatech.com/cert/v2/certificates"
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/cert/v2/certificates', 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/cert/v2/certificates",
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/cert/v2/certificates"
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/cert/v2/certificates")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://lab.trustos.telefonicatech.com/cert/v2/certificates")
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": "Certificates retrieved successfully",
"data": {
"certificates": [
{
"certID": "did:local:certid:123124",
"data": {
"name": "Certificate",
"description": "Certificate description",
"content": {},
"issuer": "did:user:{issuer}",
"issuedOn": 1696840286580,
"hash": "a2ac9343a3d94e41bbc5c152fb8382c5233a47cee23cf765c7e6d67d9e61a142",
"expires": 1696840286580
},
"metadata": [
{
"networkId": 10004,
"smartContract": "0xabcdbcbff5fa05e060e7dfe3e608cba010d11abc",
"transactionHash": "0xabcdbcbff5fa05e060e7dfe3e608cba010d11abc",
"trustPointHash": "a2ac9343a3d94e41bbc5c152fb8382c5233a47cee23cf765c7e6d67d9e61a142",
"timestamp": 1696840286580
}
],
"access": {
"certificatePin": "1234",
"externalId": "extcertid"
}
}
],
"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"
}{
"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
Filter certificates by access type.
Available options:
public, private Filter certificates by type.
Available options:
content, file, asset, url Timestamp from which to start retrieving certificates.
Timestamp from which to stop retrieving certificates.
Number of certificates to skip.
Maximum number of certificates to return.
Sort certificates 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