Register a certificate on a public network.
curl --request PATCH \
--url https://lab.trustos.telefonicatech.com/cert/v2/certificates/{type}/{id}/register \
--header 'Authorization: Bearer <token>'import requests
url = "https://lab.trustos.telefonicatech.com/cert/v2/certificates/{type}/{id}/register"
headers = {"Authorization": "Bearer <token>"}
response = requests.patch(url, headers=headers)
print(response.text)const options = {method: 'PATCH', headers: {Authorization: 'Bearer <token>'}};
fetch('https://lab.trustos.telefonicatech.com/cert/v2/certificates/{type}/{id}/register', 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/{type}/{id}/register",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
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/{type}/{id}/register"
req, _ := http.NewRequest("PATCH", 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.patch("https://lab.trustos.telefonicatech.com/cert/v2/certificates/{type}/{id}/register")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://lab.trustos.telefonicatech.com/cert/v2/certificates/{type}/{id}/register")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"statusCode": 200,
"message": "Certificate registered",
"data": {
"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"
}
}
}{
"statusCode": 400,
"type": "Validation Error",
"message": "Request parameters are wrong, check requirements",
"errors": [
{
"field": "",
"error": ""
}
]
}{
"statusCode": 401,
"type": "Authentication Error"
}{
"statusCode": 403,
"type": "Forbidden Error"
}{
"statusCode": 404,
"type": "Not Found Error"
}{
"statusCode": 429,
"type": "Out of Credits Error",
"message": "User has run out of credits. Please, contact BTeam to increase the limit"
}{
"statusCode": 500,
"type": "Internal Server Error",
"message": "Oops! Something went wrong, please try again later"
}Certificate Management
Register Certificate
Registers an existing certificate on a Blockchain network.
PATCH
/
certificates
/
{type}
/
{id}
/
register
Register a certificate on a public network.
curl --request PATCH \
--url https://lab.trustos.telefonicatech.com/cert/v2/certificates/{type}/{id}/register \
--header 'Authorization: Bearer <token>'import requests
url = "https://lab.trustos.telefonicatech.com/cert/v2/certificates/{type}/{id}/register"
headers = {"Authorization": "Bearer <token>"}
response = requests.patch(url, headers=headers)
print(response.text)const options = {method: 'PATCH', headers: {Authorization: 'Bearer <token>'}};
fetch('https://lab.trustos.telefonicatech.com/cert/v2/certificates/{type}/{id}/register', 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/{type}/{id}/register",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
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/{type}/{id}/register"
req, _ := http.NewRequest("PATCH", 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.patch("https://lab.trustos.telefonicatech.com/cert/v2/certificates/{type}/{id}/register")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://lab.trustos.telefonicatech.com/cert/v2/certificates/{type}/{id}/register")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"statusCode": 200,
"message": "Certificate registered",
"data": {
"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"
}
}
}{
"statusCode": 400,
"type": "Validation Error",
"message": "Request parameters are wrong, check requirements",
"errors": [
{
"field": "",
"error": ""
}
]
}{
"statusCode": 401,
"type": "Authentication Error"
}{
"statusCode": 403,
"type": "Forbidden Error"
}{
"statusCode": 404,
"type": "Not Found Error"
}{
"statusCode": 429,
"type": "Out of Credits Error",
"message": "User has run out of credits. Please, contact BTeam to increase the limit"
}{
"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
Type of the certificate identifier.
Available options:
certID, externalId, fileHash, hash Identifier of the certificate.
Example:
1
Query Parameters
Network identifier where the trustpoint will be registered.
Example:
10004
Was this page helpful?
⌘I