curl -H "Authorization: Bearer $API_KEY" \
"https://api.truthlocks.com/v1/attestations/550e8400-e29b-41d4-a716-446655440000/barcode?width=400&height=100" \
--output attestation-barcode.png
const barcodeImage = await client.attestations.getBarcode(attestationId, {
width: 400,
height: 100
});
fs.writeFileSync('attestation-barcode.png', Buffer.from(barcodeImage));
"<string>"الإشهادات
الحصول على الرمز الشريطي
GET
/
v1
/
attestations
/
{id}
/
barcode
curl -H "Authorization: Bearer $API_KEY" \
"https://api.truthlocks.com/v1/attestations/550e8400-e29b-41d4-a716-446655440000/barcode?width=400&height=100" \
--output attestation-barcode.png
const barcodeImage = await client.attestations.getBarcode(attestationId, {
width: 400,
height: 100
});
fs.writeFileSync('attestation-barcode.png', Buffer.from(barcodeImage));
"<string>"إنشاء صورة رمز شريطي Code 128 لشهادة. يقوم الرمز الشريطي بترميز معرف الشهادة فقط، مما يجعله مدمجًا بما يكفي للملصقات المادية والإيصالات والتعبئة.
حالات الاستخدام
- ملصقات سلسلة التوريد وعلامات المخزون
- الإيصالات المادية وبطاقات الوصول
- المستندات المطبوعة حيث تكون المساحة محدودة
- بيئات صديقة لماسحات الباركود (المستودعات، التجزئة)
الاستجابة
يُرجع صورة PNG معContent-Type: image/png.
يتضمن الرد رؤوس ذاكرة تخزين مؤقت قوية (Cache-Control: public, max-age=31536000, immutable) نظرًا لأن الرموز الشريطية لشهادة معينة لا تتغير أبدًا.
البيانات المشفرة
يحتوي الرمز الشريطي على سلسلة UUID للتصديق الخام. للتحقق، امسح الرمز الشريطي بأي قارئ Code 128، ثم ابحث عن التصديق باستخدام المعرف.رمز الاستجابة السريعة مقابل الرمز الشريطي: متى تستخدم أيهما
| السيناريو | استخدام QR | استخدام الباركود |
|---|---|---|
| الشهادات الرقمية | نعم | لا |
| الملصقات المادية | ربما | نعم |
| سلسلة التوريد | لا | نعم |
| شارات البريد الإلكتروني | نعم | لا |
| بطاقات الوصول | إما | إما |
| المشاركة عبر الهاتف المحمول | نعم | لا |
curl -H "Authorization: Bearer $API_KEY" \
"https://api.truthlocks.com/v1/attestations/550e8400-e29b-41d4-a716-446655440000/barcode?width=400&height=100" \
--output attestation-barcode.png
const barcodeImage = await client.attestations.getBarcode(attestationId, {
width: 400,
height: 100
});
fs.writeFileSync('attestation-barcode.png', Buffer.from(barcodeImage));
معلمات الاستعلام
الاستجابة
صورة PNG. لا يؤكد إنشاء رمز وجود سجل أو اجتيازه للتحقق.
The response is of type file.

