curl --request POST \
--url https://api.truthlocks.com/v1/attestations \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'X-API-Key: <api-key>' \
--data '
{
"issuer_id": "550e8400-e29b-41d4-a716-446655440000",
"kid": "es256-key-1",
"schema": "verifiable-id",
"claims": {
"full_name": "Example recipient",
"employee_id": "QA-001"
}
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
'X-API-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
issuer_id: '550e8400-e29b-41d4-a716-446655440000',
kid: 'es256-key-1',
schema: 'verifiable-id',
claims: {full_name: 'Example recipient', employee_id: 'QA-001'}
})
};
fetch('https://api.truthlocks.com/v1/attestations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/attestations"
payload = {
"issuer_id": "550e8400-e29b-41d4-a716-446655440000",
"kid": "es256-key-1",
"schema": "verifiable-id",
"claims": {
"full_name": "Example recipient",
"employee_id": "QA-001"
}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.truthlocks.com/v1/attestations"
payload := strings.NewReader("{\n \"issuer_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"kid\": \"es256-key-1\",\n \"schema\": \"verifiable-id\",\n \"claims\": {\n \"full_name\": \"Example recipient\",\n \"employee_id\": \"QA-001\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"issuer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kid": "<string>",
"status": "VALID",
"payload": {},
"signature": "<string>",
"log_index": 123,
"created_at": "2023-11-07T05:31:56Z"
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}Prägen über die Sammlungsroute
Attestierung prägen
curl --request POST \
--url https://api.truthlocks.com/v1/attestations \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--header 'X-API-Key: <api-key>' \
--data '
{
"issuer_id": "550e8400-e29b-41d4-a716-446655440000",
"kid": "es256-key-1",
"schema": "verifiable-id",
"claims": {
"full_name": "Example recipient",
"employee_id": "QA-001"
}
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
'X-API-Key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
issuer_id: '550e8400-e29b-41d4-a716-446655440000',
kid: 'es256-key-1',
schema: 'verifiable-id',
claims: {full_name: 'Example recipient', employee_id: 'QA-001'}
})
};
fetch('https://api.truthlocks.com/v1/attestations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/attestations"
payload = {
"issuer_id": "550e8400-e29b-41d4-a716-446655440000",
"kid": "es256-key-1",
"schema": "verifiable-id",
"claims": {
"full_name": "Example recipient",
"employee_id": "QA-001"
}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.truthlocks.com/v1/attestations"
payload := strings.NewReader("{\n \"issuer_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n \"kid\": \"es256-key-1\",\n \"schema\": \"verifiable-id\",\n \"claims\": {\n \"full_name\": \"Example recipient\",\n \"employee_id\": \"QA-001\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"issuer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"kid": "<string>",
"status": "VALID",
"payload": {},
"signature": "<string>",
"log_index": 123,
"created_at": "2023-11-07T05:31:56Z"
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}Autorisierungen
Body
- Structured record
- Encoded payload
Wählen Sie „Strukturierter Datensatz“, um einen Datensatztyp auszuwählen und Ansprüche einzugeben, oder „Kodierte Nutzlast“, um vorhandene Bytes zu signieren. Kombinieren Sie niemals beide Eingabeformate.
Datensatztyp für strukturierte Eingaben. Geben Sie Ansprüche an und lassen Sie payload_b64url weg. Dieses Label validiert die Wahrheit der Ansprüche nicht unabhängig.
verifiable-id, passport, drivers-license, government-id, self-sovereign-id, employment-verification, professional-role, membership-card, professional-certification, license, accreditation, degree, completion-cert, course-credit, transcript, micro-credential, training-completion, medical-license, dea-registration, board-certification, health-credential, vaccination-record, aml-kyc, security-clearance, sam-gov, jurisdiction-approval, attestation-of-will, bank-verification, credit-attestation, income-verification, skill-badge, competency, industry-cert, product-authenticity, chain-of-custody, origin-verification, custom, attestation "verifiable-id"
Optionaler zukünftiger Unix-Zeitstempel in Sekunden für strukturierte Schema-/Anspruchseingaben. Er ist in der signierten JSON-Nutzlast enthalten. Für die Eingabe payload_b64url lassen Sie dieses Anforderungsfeld weg und betten expires_at_unix stattdessen an der Wurzel der genauen JSON-Nutzlast ein. Das Ablaufdatum kann nicht nachträglich geändert werden.
1 <= x <= 253402300799
