اللغة: العربية

توثيق الواجهة

أنشئ مفتاحا في صفحة المطورين. أرسله كرمز Bearer. الأمثلة تستخدم المسارات نفسها في ملف OpenAPI.

أرسل PDF واجمع توقيعات متحققة ونزل الملف المختوم. الختم المرئي يبقى مجانيا في المتصفح.

أرسل المفتاح في Authorization: Bearer gk_live_... إنشاء مفتاح. JSON لـ OpenAPI

cURL

curl -X POST https://gustkit.com/api/v1/envelopes \
  -H "Authorization: Bearer gk_live_..." \
  -H "Idempotency-Key: envelope-42" \
  -H "Content-Type: application/json" \
  -d '{"pdfBase64":"<base64>","ownerName":"Rui","signers":[{"email":"[email protected]","name":"Ana","role":"client"}],"copies":["[email protected]"],"order":"sequential","fields":[{"signer":0,"page":1,"x":0.55,"y":0.8,"w":0.32,"h":0.08,"kind":"signature"}],"lang":"ar"}'

JavaScript

const res = await fetch("https://gustkit.com/api/v1/envelopes", {
  method: "POST",
  headers: {
    Authorization: "Bearer gk_live_...",
    "Content-Type": "application/json",
    "Idempotency-Key": "envelope-42",
  },
  body: JSON.stringify({
    pdfBase64,
    signers: [{ email: "[email protected]", name: "Ana", role: "client" }],
    copies: ["[email protected]"],
    order: "parallel",
    fields: [{ signer: 0, page: 1, x: 0.55, y: 0.8, w: 0.32, h: 0.08, kind: "signature" }],
    lang: "ar",
  }),
});
const envelope = await res.json();

Python

import requests
res = requests.post(
    "https://gustkit.com/api/v1/envelopes",
    headers={"Authorization": "Bearer gk_live_...", "Idempotency-Key": "envelope-42"},
    json={"pdfBase64": pdf_b64, "signers": [{"email": "[email protected]", "name": "Ana"}], "copies": ["[email protected]"], "order": "parallel", "lang": "ar"},
)
print(res.status_code, res.json())

الأخطاء

الأخطاء JSON: error.code وerror.message. 401 يعني أن المفتاح مفقود أو أُلغي. 402 يعني أن الحصة المجانية نفدت والتحصيل يعمل. 409 تعارض، بما فيه مفتاح تكرار مستعمل مع جسم مختلف. 429 حد الدقيقة للمفتاح.