وثائق API

آخر تحديث: 2026-07-05

تتيح واجهة hdply البرمجية للسكربتات ووكلاء الذكاء الاصطناعي إدارة مواقعك برمجيًا: عرض المشاريع، قراءة HTML، نشر التحديثات، وإنشاء مواقع جديدة. إنها REST API صغيرة ومتوقعة — إن كنت تستطيع استخدام curl فستستطيع استخدام hdply.

المصادقة

أنشئ مفتاح API الشخصي من لوحة التحكم (بطاقة «مفتاح API»). أرسله كرمز bearer مع كل طلب:

Authorization: Bearer hdply_sk_…

يظهر المفتاح مرة واحدة فقط عند إنشائه؛ إعادة الإنشاء تستبدله، والحذف يلغيه فورًا. احتفظ به سرًا — فهو يتيح الوصول إلى جميع مشاريعك.

عنوان URL الأساسي

https://api.app.hdply.com

نقاط النهاية

لا يوجد DELETE. حذف الموقع متعمَّد عبر الويب فقط، فلا يمكن لأي وكيل آلي تدمير عملك أبدًا. كل نشر عبر API له نسخة محفوظة — يمكنك استعادة أي نسخة سابقة من لوحة التحكم.

البدء السريع

export HDPLY_KEY=hdply_sk_…

# create a site and go live in one call
curl -X POST https://api.app.hdply.com/v1/projects \
  -H "Authorization: Bearer $HDPLY_KEY" \
  -H "Content-Type: application/json" \
  -d '{"html": "<!doctype html><title>Hello</title><h1>Hi!</h1>"}'
# → {"project": {"subroute": "k3v9x2m7q1", "url": "https://k3v9x2m7q1.hdply.com", …}}

# read the live HTML
curl https://api.app.hdply.com/v1/projects/k3v9x2m7q1/html \
  -H "Authorization: Bearer $HDPLY_KEY"

# publish an update
curl -X PUT https://api.app.hdply.com/v1/projects/k3v9x2m7q1/html \
  -H "Authorization: Bearer $HDPLY_KEY" \
  -H "Content-Type: text/html" \
  --data-binary @index.html

الحدود والأخطاء

Claude وMCP

يأتي hdply بخادم MCP مدمج، ليتمكن Claude Code وClaude Desktop من استخدام مواقعك كأدوات أصلية (list_sites وcreate_site وget_site_html وdeploy_site وget_deploy_history). صِل Claude Code بأمر واحد:

claude mcp add --transport http hdply https://api.app.hdply.com/mcp \
  --header "Authorization: Bearer hdply_sk_…"

لـ Claude Desktop، أضف هذا إلى إعدادات MCP لديك (claude_desktop_config.json):

{
  "mcpServers": {
    "hdply": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://api.app.hdply.com/mcp",
               "--header", "Authorization: Bearer hdply_sk_…"]
    }
  }
}

الاستخدام مع وكلاء الذكاء الاصطناعي

الصق الكتلة أدناه مع مفتاحك في ChatGPT أو Claude أو أي وكيل لديه وصول إلى الطرفية. بعد ذلك يكفي أن تقول «حدّث موقعي» وسيعرف الطريقة.

You can manage my hdply websites via its REST API.
Base URL: https://api.app.hdply.com
Auth header on every request: "Authorization: Bearer <MY_KEY>"

Endpoints:
- GET  /v1/projects                     -> list my sites
- POST /v1/projects                     -> create; JSON {"name"?, "html"?}; html goes live instantly
- GET  /v1/projects/{id}/html           -> current HTML ({id} = numeric id or subdomain)
- PUT  /v1/projects/{id}/html           -> publish new HTML (raw text/html body)
- GET  /v1/projects/{id}/deployments    -> version history

Rules: HTML max 1MB, single self-contained file preferred (inline CSS/JS).
There is no delete endpoint. Every deploy is versioned and restorable.
After publishing, the site is live at https://{subroute}.hdply.com immediately.

ملخص قابل للقراءة آليًا للزواحف والوكلاء: hdply.com/llms.txt