API لإدارة النشاط
أدر عمليات العملاء والمواعيد والخدمات والفريق والتقويم والتقارير المدعومة في CRAD من واجهتك الحالية.
قبل الاستخدام الفعلي — افحص القدرات المنشورة والصلاحيات وجاهزية ربطك.
تحقّق من القدرات المنشورة وصلاحيات المفتاح وجاهزية النشاط في بيئتك. أمثلة HTTP مسجّلة من اختبارات معزولة؛ وصفها local-unreleased لا يعني أن API غير عامل ولا يُثبت جاهزية ربطك. في مسار العميل يُتحقق من الهاتف بقالب واتساب أعدّه النشاط؛ SMS غير مدعوم. التسجيل بواسطة مسؤول مخوّل عملية منفصلة دون رمز.
قبل الطلب الأول
احصل على بيئة اختبار
مفتاح API واحد بصلاحيات صريحة للحجوزات وإدارة النشاط. عنوان API مضمّن في SDK ومعرّفات الربط تُستخرج من المفتاح.
اختر عملية
يعرض API Reference المسار والصلاحيات والمعلمات ومحتوى الطلب والردود.
اربط واجهتك الحالية
استخدم عميل HTTP في موقعك. إجراءات العميل تتطلب التحقق عبر واتساب؛ تسجيله بواسطة مسؤول مخوّل لا يتطلب رمزاً. يبقى مفتاح API في الخادم فقط ويُستخدم للإدارة وربط العملاء حسب صلاحياته.
طلبك الأول
احفظ مفتاح API واحداً في الخادم باسم CRAD_API_KEY. عنوان API ثابت؛ يعيد الطلب معرّفات الموقع والربط وصلاحيات المفتاح.
تفاصيل العملية والردcurl --request GET \
"https://api.crad.ai/v1/management" \
--header "Authorization: Bearer ${CRAD_API_KEY}" \
--header "Accept: application/json" تربط لوحة إدارة قائمة؟ افحص مفتاح API
نفّذ الطلب من خادمك باستخدام نفس مفتاح API. يعرض صلاحيات الربط ولا ينشئ عميلاً أو موعداً. لا يتطلب هذا الفحص التحقق من هاتف أو اتصال واتساب.
curl --request GET \
"https://api.crad.ai/v1/management" \
--header "Authorization: Bearer ${CRAD_API_KEY}" \
--header "Accept: application/json" ربط سريع وصحيح، خطوة بخطوة
ما الذي تُحمّله مرة واحدة، وما الذي تفحصه مباشرة، وكيف تزامن قاعدة بيانات موقعك دون إنشاء مصدر حجز آخر.
دليل التنفيذ الفعّالطلب الموعد، موافقة العيادة وتحديث الزبونة
عندما يشترط النشاط الموافقة، تُسجّل العملية طلباً قيد المراجعة ولا تُعرض كتأكيد فوري. تقبل لوحة الموقع وCRAD الطلب نفسه أو ترفضانه؛ لا يُحسم الوقت البديل إلا بعد موافقة الزبونة وإعادة فحص التوفر. الإلغاء والتغيير والتذكير تتبع سياسة هذا النشاط وحده.
دليل طلبات المواعيد والموافقة عليهاترتيب عمليات حجز موعد
خريطة تنقّل في العقد الحالي؛ ليست بعد مثال تكامل تم اختباره من البداية للنهاية.
View the 8-step HTTP workflow
Discover the business
Read published services, providers, timezone and capabilities. Let the customer choose a treatment, including an unpriced consultation option when the business publishes one. Display its fixed price, range or price-decided-at-visit explanation; never infer a service from catalogue order or its name. A bounded authorized display snapshot can make the treatment list fast; it is not a booking authority. Respect bookingEnabled: false before offering a booking.
Retrieve catalogCreate a visitor session
Send the approved integrationId and keep the returned customer bearer in memory. Prepare this once the integration is known, without blocking treatment rendering on unrelated reads. Never expose a machine credential in browser code.
Create a visitor sessionQuote and choose a time
Use the selected service and provider to get a current quote, then request availability for the selected day in the business timezone. Display the returned times: a business can use treatment-duration spacing that restarts after scheduled breaks. Do not build a fixed 15-minute list or derive starts from duration alone. Treatment and time can be selected before phone verification. Do not preload slots for every date in a month or let an obsolete response restore an old selection. A displayed time is not reserved.
Create a quoteFind available timesVerify the phone
Request a code only after an explicit customer action. Persist the challenge request UUID; retry uncertainty using that UUID and the original session. Use sessionToken and the expiry timestamps from the successful verify response for subsequent calls. Current phone proof is required for Customer API intents and commits; website login or a local projection does not replace it. Do not send another code automatically after reload. The business must configure a supported WhatsApp authentication template for the chosen language. Confirm verification readiness in the approved environment; documentation publication does not enable sending.
Request a WhatsApp verification codeVerify a phone numberPrepare and review the booking
Save a request UUID before sending the booking intent, and use it as Idempotency-Key. Submit the quote, slot, customer details and explicit communication preference. Show the returned authoritative fixed price, optional priceRangeMinor estimate or price-decided-at-visit explanation. Exact price stays null for a range or unknown price; a range minimum is not a fixed charge. Do not replace a null quote with zero or a catalogue fallback. Changed terms require fresh confirmation.
Prepare a bookingSubmit the saved intent
After the customer reviews the request, send intentId to create the booking. Idempotency-Key must be the operationId returned with that exact intent, not the earlier request UUID. Render the receipt status: pending means the request was received and awaits clinic approval; confirmed means the appointment was confirmed. An accepted request is separate from WhatsApp delivery.
Submit a booking requestRecover an uncertain result
After reload, obtain fresh same-phone proof and recover the saved request, intent or operation. Recovery must not auto-confirm. A not_found result does not prove an in-flight request cannot commit; keep the original locator until reconciliation or authoritative abandonment.
Recover an intent requestRetrieve operation resultManage the accepted request or booking
Refresh the booking and allowedActions. A contact_business policy directs customer cancellation/rescheduling to the saved business contact. Where self-service is allowed, prepare a change intent, review its terms and commit using its returned operation identity. An offered alternative requires the customer’s separate acceptance.
Retrieve a bookingPrepare a booking change
الأدلة
- تأكيدات المواعيد وروابط المستندات من لوحة العيادة
اربط اعتماد الطلبات وحجز المواعيد بواسطة الموظفين وإشعارات المستندات بلوحة العيادة الحالية، مع سجل إرسال واحد لكل حدث.
- Manage WhatsApp templates, profile and images
A controlled-pilot workflow for your backend, with explicit grants, separate image identities and recovery before retry.
- Set up your integration
Obtain the environment details, choose browser or backend calls, and connect your existing booking interface.
- Build a fast, correct website integration
Load treatments quickly, check times live and keep an authorized local projection without creating a second booking authority.
- Customer requests, clinic approval and proposed times
Keep a new request pending, let the clinic decide from either admin, and confirm an alternative only after the customer agrees.
- Connect your business calendar
Use your own staff interface to read, create and manage approved appointments, then keep a scoped local calendar in sync.
- Services & website content
Use your own admin to edit treatments, choose the services shown online and maintain public contact details and images.
- Providers
Edit existing providers and service assignments from your own admin, with explicit resource authority and recoverable changes.
- Campaigns from your business admin
Choose a permitted audience, review the exact message, confirm once and recover uncertain results. Your interface uses the existing CRAD sender.
- Appointment reminders in your admin
Let the business edit reminder timing and customer preferences, and show delivery status with the existing CRAD reminder engine.
- Sync customers and bookings
Maintain permitted CRAD data in your backend with separate customer and booking streams, durable checkpoints and explicit sharing.
- Change hours and availability blocks
Build a staff workflow that reviews appointment impact, detects concurrent changes and preserves accepted bookings.
- Handle notifications and consent
Keep booking success independent of WhatsApp delivery, show truthful message states and let customers manage permission.
- Recover errors and uncertain results
Keep the right identifier, restore current authority, and establish the original outcome before creating a replacement operation.
ما الذي يدعمه العقد الحالي؟
| القدرة | الحالة |
|---|---|
| حجز العميل | الخدمات والتوفر والتحقق وإنشاء الموعد وتغييره وإلغاؤه |
| بيانات الربط | عملاء ومواعيد الربط والتغييرات والسجل حسب الصلاحيات |
| إدارة الأيام والساعات | الساعات والحظر للنشاط أو مقدّم الخدمة بقراءات منفصلة ومراجعة الأثر قبل التغيير |
| تسجيل عميل من إدارتك | إنشاء أو ربط بالاسم والهاتف بصلاحية منفصلة، دون رمز تحقق أو منح موافقة على الرسائل |
| إدارة ومزامنة عملاء النشاط | البحث والاسم واللغة والحظر ومزامنة جميع العملاء؛ الملاحظات والحقول الإضافية تحتاج إلى موافقة منفصلة |
| تقويم النشاط | قراءة المواعيد وإنشاؤها وتغييرها وإلغاؤها بصلاحيات تقويم منفصلة ومراجعة الأثر |
| قواعد الحجز | المنطقة الزمنية والمدة الافتراضية ومهلة الحجز والإلغاء. نافذة مشتركة للموقع وواتساب: 14 أو 30 أو 60 أو 90 يومًا حسب توقيت النشاط، والافتراضي 14. تُراجع التغييرات مسبقًا مع الحفاظ على المواعيد الحالية. |
| مدة الموعد ووراثة الإعدادات | مدة افتراضية للنشاط وإعداد مستقل لمقدم الخدمة؛ يتطلب تحديث المواعيد المستقبلية مراجعة الأثر وصلاحية إضافية |
| تصحيح الهاتف بواسطة المسؤول | تصحيح لنفس العميل بصلاحية منفصلة؛ قد تتطلب روابط الهوية أو عمليات الإرسال المعلقة معالجة مسبقة |
| الخدمات ومحتوى الموقع | إدارة الخدمات واختيار المعروض منها وبيانات التواصل والصور العامة؛ صلاحيات منفصلة دون تفعيل تلقائي للحجز |
| مقدمو الخدمة | قراءة مقدمي الخدمة الحاليين المصرّح بهم للربط وتعديلهم ومزامنتهم وربط الخدمات؛ إنشاء حساب دخول لمقدم حالي يتطلب صلاحية منفصلة ولا يرسل دعوة |
| المحادثات والرسائل | قراءة المحادثات والتحويل إلى موظف وإرسال نص أو وسائط أو قالب؛ حسب الصلاحيات المنفصلة وحالة الاتصال وقواعد الإرسال في واتساب |
| ملخصات النشاط | عدد المواعيد اليوم وهذا الأسبوع وغداً حسب المنطقة الزمنية للعمل، بإذن منفصل للعمل كله؛ دون بيانات العملاء أو مبالغ مالية |
| تقرير تشغيلي شهري | شهر كامل مع الحالات والتوزيع حسب الأيام والخدمات ومقدميها وقيمة العلاجات المكتملة لكل عملة؛ يتطلب reports:read لكامل النشاط. ليس تقرير مدفوعات أو تحصيل |
| متابعة إعدادات المالك | روابط لإعدادات الموقع والربط والجهاز وواتساب؛ تتطلب دخول المالك والتحقق الحالي. فتح الرابط لا يغيّر الإعدادات أو يوافق على الصلاحيات |
| خارج العقد الحالي | إنشاء سجلات مقدمي الخدمة وحذفها وإرسال دعوات الفريق وتغيير كلمات المرور الحالية وتقارير المدفوعات أو المحاسبة |
أين تُحفظ البيانات؟
تدير CRAD جهات الاتصال والمواعيد. يمكن للموقع حفظ نسخة من البيانات المصرّح بها؛ تبقى حساباته وملاحظاته الخاصة لديه. مزامنة جميع عملاء النشاط تتطلب مفتاح إدارة وصلاحية صريحة، منفصلة عن بيانات عملاء الربط.
تنسيق بيئة API عبر واتسابستفتح مسودة لفريق CRAD يمكنك تعديلها قبل الإرسال. لا ترسل مفاتيح الوصول.