صك إثبات
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
}الإشهادات
صك من خلال مسار التجميع
صك إثبات
POST
/
v1
/
attestations
صك إثبات
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
}هذا هو نوع مسار التجميع لسك الشهادات. استخدم خيار السجل المنظم أو الحمولة المشفرة الموضح في Try It واحتفظ بنفس مفتاح Idempotency-Key عند إعادة محاولة نفس الطلب. تظل حزم التحقق وأنواع السجلات قابلة للتحديد في مخطط الطلب.
الجسم
application/json
- Structured record
- Encoded payload
اختر سجل منظم لتحديد نوع السجل وإدخال المطالبات، أو حمولة مشفرة لتوقيع البايتات الموجودة. لا تجمع أبدًا بين تنسيقي الإدخال.
نوع السجل للإدخال المنظم. قدم المطالبات واحذف payload_b64url. هذا التصنيف لا يتحقق بشكل مستقل من صحة المطالبات.
الخيارات المتاحة:
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"
طابع زمني Unix مستقبلي اختياري بالثواني لإدخال المخطط/المطالبات المهيكلة. يتم تضمينه في حمولة JSON الموقعة. بالنسبة لإدخال payload_b64url، احذف حقل الطلب هذا وقم بتضمين expires_at_unix في جذر حمولة JSON الدقيقة بدلاً من ذلك. لا يمكن تغيير تاريخ انتهاء الصلاحية في مكانه.
النطاق المطلوب:
1 <= x <= 253402300799
