WWebToolSolutions
إنشاء حساب

توثيق API

واجهة REST لـ WebToolSolutions — متاحة لباقتي Pro و غير محدود.

المصادقة

أرفق مفتاح API كرأس طلب في كل طلب:

X-API-Key: wts_live_xxxxxxxxxxxxxxxxxxxx

يمكن إنشاء المفاتيح من: /dashboard/api-keys

الرابط الأساسي

https://api.webtoolsolutions.org/v1

قائمة الوحدات

GET /v1/modules

curl -H "X-API-Key: wts_live_..." \
  https://api.webtoolsolutions.org/v1/modules

بدء مهمة (رفع ملف)

POST /v1/modules/{moduleId}/process

curl -H "X-API-Key: wts_live_..." \
  -F "file=@document.pdf" \
  -F "preserve_formatting=true" \
  https://api.webtoolsolutions.org/v1/modules/pdf-to-word/process

# Response:
{
  "success": true,
  "data": {
    "jobId": "job_01HXYZ...",
    "status": "PENDING",
    "pollUrl": "/v1/jobs/job_01HXYZ..."
  }
}

متابعة حالة المهمة

GET /v1/jobs/{jobId}

curl -H "X-API-Key: wts_live_..." \
  https://api.webtoolsolutions.org/v1/jobs/job_01HXYZ...

# When completed:
{
  "success": true,
  "data": {
    "jobId": "...",
    "status": "COMPLETED",
    "progress": 100,
    "result": {
      "downloadUrl": "https://cdn.webtoolsolutions.org/...",
      "filename": "document.docx",
      "fileSizeBytes": 245760,
      "expiresAt": "..."
    }
  }
}

التقدم اللحظي عبر WebSocket

ws://api.webtoolsolutions.org/v1/ws?jobId=job_01HXYZ...

// Message types:
{ "type": "progress", "percent": 65, "message": "Converting pages..." }
{ "type": "completed", "result": {...} }
{ "type": "failed", "error": {...} }

الويب هوكس

عند اكتمال أو فشل أي مهمة نرسل POST إلى الرابط المسجل.

POST {your_webhook_url}
X-WTS-Signature: sha256=...
X-WTS-Event: job.completed

{
  "event": "job.completed",
  "jobId": "...",
  "result": {...},
  "timestamp": "..."
}

يمكن إدارتها في الحساب → الويب هوكس.

رموز الأخطاء

  • 401 AUTH_REQUIRED
  • 402 PLAN_REQUIRED
  • 413 FILE_TOO_LARGE
  • 415 FILE_TYPE_INVALID
  • 422 VALIDATION_ERROR
  • 429 QUOTA_EXCEEDED / RATE_LIMIT_EXCEEDED

حد الطلبات

  • Pro: 600 req/min · 200 jobs/day
  • Unlimited: 1200 req/min · unlimited jobs