curl -X POST "https://api.scanova.io/qr-assets/design-template/" \
-H "Authorization: 401f7ac837da42b97f613d789819ff93537bee6a" \
-H "Content-Type: application/json" \
-d '{
"name": "Blue Gradient",
"resource_type": "qr_category",
"category": 3,
"design_info": { "bg": "#0033ff" },
"gradient_type": "linear",
"is_template": true
}'
{
"id": 9,
"name": "Blue Gradient",
"resource_type": "qr_category",
"category": 3,
"design_info": { "bg": "#0033ff" },
"gradient_type": "linear",
"color_palette": null,
"font_styles": null,
"is_template": true,
"info": null,
"template_id": null
}
أصول QR
إنشاء قالب تصميم خاص بالمستخدم
POST /qr-assets/design-template/
POST
/
qr-assets
/
design-template
/
curl -X POST "https://api.scanova.io/qr-assets/design-template/" \
-H "Authorization: 401f7ac837da42b97f613d789819ff93537bee6a" \
-H "Content-Type: application/json" \
-d '{
"name": "Blue Gradient",
"resource_type": "qr_category",
"category": 3,
"design_info": { "bg": "#0033ff" },
"gradient_type": "linear",
"is_template": true
}'
{
"id": 9,
"name": "Blue Gradient",
"resource_type": "qr_category",
"category": 3,
"design_info": { "bg": "#0033ff" },
"gradient_type": "linear",
"color_palette": null,
"font_styles": null,
"is_template": true,
"info": null,
"template_id": null
}
يحفظ قالب تصميم جديدًا لفئة QR أو نموذج، على مضيف Management API (
قاعدة الاقتران بين
يكون
api.scanova.io)، مع المصادقة باستخدام مفتاح Management API الخام الخاص بك.
POST https://api.scanova.io/qr-assets/design-template/
Authorization: 401f7ac837da42b97f613d789819ff93537bee6a
string
مطلوب
اسم القالب، بحد أقصى 150 حرفًا.
string
افتراضي:"qr_category"
qr_category أو form.integer
معرّف
QRCategory الذي ينتمي إليه هذا القالب. مطلوب عندما تكون resource_type بقيمة qr_category؛ يجب حذفه عندما تكون resource_type بقيمة form.object
بيانات تصميم JSON عشوائية.
string
نمط التدرج، مثل
linear.string
لوحة الألوان، عادةً مُرمَّزة كسلسلة JSON.
string
بيانات نمط الخط.
boolean
افتراضي:"false"
يضع علامة على هذا السجل كقالب قابل لإعادة الاستخدام بدلًا من حفظ لمرة واحدة.
curl -X POST "https://api.scanova.io/qr-assets/design-template/" \
-H "Authorization: 401f7ac837da42b97f613d789819ff93537bee6a" \
-H "Content-Type: application/json" \
-d '{
"name": "Blue Gradient",
"resource_type": "qr_category",
"category": 3,
"design_info": { "bg": "#0033ff" },
"gradient_type": "linear",
"is_template": true
}'
{
"id": 9,
"name": "Blue Gradient",
"resource_type": "qr_category",
"category": 3,
"design_info": { "bg": "#0033ff" },
"gradient_type": "linear",
"color_palette": null,
"font_styles": null,
"is_template": true,
"info": null,
"template_id": null
}
قاعدة الاقتران بين resource_type وcategory
يكون category مطلوبًا مع resource_type=qr_category ومحظورًا مع resource_type=form — يفرض كل من المُسلسِل وقيد فحص في قاعدة البيانات هذه القاعدة، لذا لا يمكن أن يحدث انحراف. يُعاد 400 مع {"category": "This field is required for qr_category templates."} أو الرسالة العكسية إذا عكستهما.
ذات صلة
- سرد قوالب التصميم الخاصة بالمستخدم — الاطلاع على القوالب المحفوظة.
- تحديث قالب تصميم خاص بالمستخدم — تعديل قالب موجود.
- نظرة عامة على Management API — مخطط المصادقة وقواعد الحصة المطبّقة على نقطة النهاية هذه.
التفويضات
Send your Management API key as the raw value of the Authorization header — no "Bearer " or "Token " prefix, and no other characters. Example: Authorization: 401f7ac837da42b97f613d789819ff93537bee6a. A header containing more than one space-separated part is rejected outright. Requests also require the request's Host header to be the management API host (e.g. api.scanova.io) — the same key sent to the regular API host will not authenticate.
الاستجابة
Template created.
هل كانت هذه الصفحة مفيدة؟