سرد مفاتيح API للمستهلك
curl --request GET \
--url https://api.truthlocks.com/v1/consumer/api-keys \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.truthlocks.com/v1/consumer/api-keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/consumer/api-keys"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.truthlocks.com/v1/consumer/api-keys"
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))
}[
{
"key_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "My integration key",
"prefix": "tlk_abcd1234",
"status": "active",
"scopes": [
"consumer:read",
"consumer:write",
"attestations:mint",
"attestations:read",
"verify:read"
],
"created_at": "2026-03-01T12:00:00.000Z",
"expires_at": "2026-05-30T12:00:00.000Z",
"last_used_at": "2026-03-20T09:15:00.000Z"
}
]{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}المستهلك (B2C)
سرد مفاتيح API للمستهلك
يُرجع جميع مفاتيح API للمستهلك المصادق عليه. لا تُرجع الأسرار أبدًا في استجابات القائمة. يتطلب جلسة مستهلك فردية مصادق عليها؛ لا يمكن لجلسة عمل أو مفتاح API لمساحة العمل أن يحل محل هوية المستخدم.
GET
/
v1
/
consumer
/
api-keys
سرد مفاتيح API للمستهلك
curl --request GET \
--url https://api.truthlocks.com/v1/consumer/api-keys \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.truthlocks.com/v1/consumer/api-keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.truthlocks.com/v1/consumer/api-keys"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.truthlocks.com/v1/consumer/api-keys"
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))
}[
{
"key_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "My integration key",
"prefix": "tlk_abcd1234",
"status": "active",
"scopes": [
"consumer:read",
"consumer:write",
"attestations:mint",
"attestations:read",
"verify:read"
],
"created_at": "2026-03-01T12:00:00.000Z",
"expires_at": "2026-05-30T12:00:00.000Z",
"last_used_at": "2026-03-20T09:15:00.000Z"
}
]{
"code": "AUTH_REQUIRED",
"message": "Authentication required",
"http_status": 401
}
