انتقل إلى المحتوى
تجربة مجانية 14 يومًا، بلا بطاقة9 لغات176 نوع عمل · 50 تطبيقًا
AR· USD
جرّب عرضًا حيًاابدأ التجربة المجانية

مرجع API v1

كل نقطة نهاية في واجهة REST مع طريقتها ومسارها والنطاق المطلوب، مولّدة من مستند OpenAPI نفسه الذي تقدمه الواجهة.

GET https://<workspace>.zmle.com/api/v1/me

البدء السريع

  1. افتح عرضًا تجريبيًا فوريًا: مساحة عمل ببيانات نموذجية
  2. في العرض التجريبي افتح الإدارة ← التكاملات والواجهة البرمجية وأنشئ مفتاحًا
  3. استدعِ GET /api/v1/me بالمفتاح (أدناه) لترى مساحة العمل والشخص المرتبطين به
  4. أضف نقطة نهاية لخطاف ويب واختر الأحداث؛ في العرض التجريبي تُسجَّل التسليمات ولا تُرسل

مستند OpenAPI

المواصفة الكاملة عامة، ولا تحتاج إلى مفتاح لقراءتها: https://zmle.com/api/v1/openapi.json

curl https://<your-demo>.zmle.com/api/v1/me \
  -H "Authorization: Bearer $ZMLE_API_KEY"

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

تجيب كل مساحة عمل على عنوانها الخاص: ‎https://<workspace>.zmle.com/api/v1 (أو نطاقها الخاص). مضيف الواجهة ‎https://api.zmle.com/v1 يجد مساحة العمل من المفتاح.

المصادقة

أرسل المفتاح في Authorization: Bearer <key> (أو X-Api-Key). تستخدم التطبيقات الأصلية والمتصلة OAuth 2.1 مع PKCE ورموز تطبيق قصيرة العمر.

القوائم والتصفح

تقبل القوائم page وper (من 1 إلى 100، الافتراضي 25)، وq للبحث، وsince للتغييرات بعد تاريخ. يحمل الرد total وpages، مع ترويستي Link وX-Total-Count.

الأخطاء

الأخطاء بصيغة JSON: ‏{ error: { code, message } } مع حالة HTTP. لكل رد X-Request-Id. تقبل طلبات POST ترويسة Idempotency-Key. لكل مفتاح رصيد من 300 طلب يُعاد ملؤه بمعدل 5 في الثانية؛ تُظهر X-RateLimit-Remaining المتبقي، ويأتي الرمز 429 مع Retry-After.

الإصدارات والإيقاف التدريجي

الإصدار v1 يتوسع فقط: تُضاف مسارات وحقول جديدة، ولا يُحذف أو يُعاد تسمية شيء داخل v1. المسار الذي سيُزال يُعلَّم كمهمل قبل 12 شهرًا على الأقل من توقفه؛ وحتى ذلك الحين يعمل دون تغيير ويرد مع الترويستين Deprecation وSunset.

عميل TypeScript

يجري إعداد عميل TypeScript رسمي مولّد من مستند OpenAPI (دوال مُنمَّطة، إعادة المحاولة مع Retry-After، مفاتيح عدم التكرار، التصفح). وحتى نشره، يعمل أي مولّد OpenAPI مع openapi.json.

رموز الأخطاء

الحالةالرمزالمعنى
400invalid_jsonالمحتوى ليس JSON صالحًا
401unauthenticatedلم يُرسل مفتاح أو رمز
401invalid_keyالمفتاح غير معروف أو ملغى أو منتهٍ، أو استُخدم رمز MCP مع REST API
401token_expiredانتهت صلاحية رمز التطبيق: جدّده
403insufficient_scopeينقص المفتاح النطاق الذي يحتاجه هذا المسار
403forbiddenلا يحق لصاحب المفتاح فتح هذا القسم أو السجل
403origin_not_allowedاستدعاء من متصفح لموقع ليس ضمن الأصول المسموح بها لمساحة العمل
403ip_not_allowedقائمة عناوين IP المسموح بها للمفتاح لا تتضمن هذا العنوان
403test_mode_read_onlyمفتاح اختبار حاول تغيير البيانات: مفاتيح الاختبار للقراءة فقط
404not_foundلا يوجد سجل أو مسار كهذا في مساحة العمل
409conflictيتعارض الطلب مع الحالة الحالية، مثل التكرار
422validation_failedفشل التحقق من الحقول؛ تذكر الإجابة المشكلات لكل حقل
429rate_limitedطلبات كثيرة جدًا: انتظر الثواني المذكورة في Retry-After
500internal_errorحدث خطأ من جهتنا: أعد المحاولة لاحقًا واذكر X-Request-Id إذا تواصلت معنا

المرجع أدناه باللغة الإنجليزية، مثل مستند OpenAPI.

Customers

الطريقةالمسارالنطاقما الذي يفعله
GET/api/v1/customerscustomers:readList customers
GET/api/v1/customers/{id}customers:readRead a customer
POST/api/v1/customerscustomers:writeCreate a customer (an existing e-mail / phone returns that customer)
PATCH/api/v1/customers/{id}customers:writeUpdate a customer's contact details

Leads

الطريقةالمسارالنطاقما الذي يفعله
GET/api/v1/inquiriesinquiries:readList leads
GET/api/v1/inquiries/{id}inquiries:readRead a lead
POST/api/v1/inquiriesinquiries:writeCreate a lead (contact, quote request, booking request, call-back) — notifies the team like the website form

Quotations

الطريقةالمسارالنطاقما الذي يفعله
GET/api/v1/quotationsquotations:readList quotations
GET/api/v1/quotations/{id}quotations:readRead a quotation with its lines
POST/api/v1/quotationsquotations:writeCreate a DRAFT quotation (tax computed by the workspace's rules)

Invoices

الطريقةالمسارالنطاقما الذي يفعله
GET/api/v1/invoicesinvoices:readList invoices
GET/api/v1/invoices/{id}invoices:readRead an invoice with lines and payments
POST/api/v1/invoicesinvoices:writeCreate a DRAFT invoice (numbered when issued in the back office)
GET/api/v1/paymentspayments:readList invoice payments (invoice=<id> to filter)
GET/api/v1/payments/{id}payments:readRead a payment

Orders

الطريقةالمسارالنطاقما الذي يفعله
GET/api/v1/ordersorders:readList shop orders
GET/api/v1/orders/{id}orders:readRead a shop order

Catalog

الطريقةالمسارالنطاقما الذي يفعله
GET/api/v1/productsproducts:readList products with price and stock (catalog:read also allows it)
GET/api/v1/products/{id}products:readRead a product
GET/api/v1/categoriescatalog:readList categories (type=product|service|post|project, locale=…) (مساحات العمل المستضافة)
GET/api/v1/servicescatalog:readList published services (مساحات العمل المستضافة)
GET/api/v1/services/{id}catalog:readRead a service (مساحات العمل المستضافة)
GET/api/v1/products/lookupproducts:readExact barcode / SKU match (GTIN, SKU or an extra product barcode) — for scanners

Bookings

الطريقةالمسارالنطاقما الذي يفعله
GET/api/v1/booking-servicescatalog:readList bookable services (online booking on) (مساحات العمل المستضافة)
GET/api/v1/booking-services/{id}catalog:readRead a bookable service (مساحات العمل المستضافة)
GET/api/v1/bookings/slotsbookings:readFree start times of a bookable service on a date (مساحات العمل المستضافة)
GET/api/v1/bookingsbookings:readList appointments (مساحات العمل المستضافة)
GET/api/v1/bookings/{id}bookings:readRead an appointment (مساحات العمل المستضافة)
POST/api/v1/bookingsbookings:writeBook an appointment at a free time (409 when it was taken) (مساحات العمل المستضافة)

Webhooks

الطريقةالمسارالنطاقما الذي يفعله
GET/api/v1/eventswebhooks:readThe webhook event catalog
GET/api/v1/deliverieswebhooks:readWebhook delivery log
GET/api/v1/deliveries/{id}webhooks:readOne delivery with its payload
GET/api/v1/webhookswebhooks:readList webhook endpoints (no secrets) (مساحات العمل المستضافة)
POST/api/v1/webhookswebhooks:writeCreate a webhook endpoint — the signing secret is returned once (مساحات العمل المستضافة)
DELETE/api/v1/webhooks/{id}webhooks:writeDelete a webhook endpoint (مساحات العمل المستضافة)

Account

الطريقةالمسارالنطاقما الذي يفعله
GET/api/v1/me(any)Who is calling: the API key, or the person signed in to the app, with the workspace and the scopes

Stock

الطريقةالمسارالنطاقما الذي يفعله
GET/api/v1/warehousesstock:readActive stock locations
GET/api/v1/stockstock:readStock levels per location (product=<id> for one product, all its rows)
POST/api/v1/stock/adjustmentsstock:writeAdd or remove stock (same rules as the admin: write-off reasons only remove)

Appointments

الطريقةالمسارالنطاقما الذي يفعله
GET/api/v1/appointmentsappointments:readList appointments (from / to filter the start time)
GET/api/v1/appointments/{id}appointments:readRead an appointment

Point of sale

الطريقةالمسارالنطاقما الذي يفعله
GET/api/v1/pos-salespos:readList till sales and refunds (since = created since)
GET/api/v1/pos-sales/{id}pos:readRead a till sale with its lines and payments

Tasks

الطريقةالمسارالنطاقما الذي يفعله
GET/api/v1/taskstasks:readList tasks (app sign-in without tasks.manage: only my tasks)
GET/api/v1/tasks/{id}tasks:readRead a task
POST/api/v1/taskstasks:writeCreate a task (assigned to the signed-in person by default)
PATCH/api/v1/tasks/{id}tasks:writeUpdate a task or change its status (DONE closes it; recurring tasks schedule the next one)

Files

الطريقةالمسارالنطاقما الذي يفعله
POST/api/v1/attachmentsattachments:writeUpload a photo or PDF (multipart: file, taskId?, folder?) — images are re-encoded, metadata such as GPS removed
GET/api/v1/attachments/{id}attachments:writeRead an uploaded file's record

Apps

الطريقةالمسارالنطاقما الذي يفعله
POST/api/v1/session/handoff(app)One-time URL (60 s) that signs the app's web view in to the workspace and opens `next` (برمز التطبيق فقط)
GET/api/v1/devices(app)My app installations (برمز التطبيق فقط)
POST/api/v1/devices(app)Register an app installation for push (FCM / APNs / Huawei Push Kit token; the same token again returns the same id) (برمز التطبيق فقط)
DELETE/api/v1/devices/{id}(app)Remove an app installation (برمز التطبيق فقط)
GET/api/v1/devices/{id}(app)One app installation with the alert categories it does not get pushes for (برمز التطبيق فقط)
PATCH/api/v1/devices/{id}(app)Alert categories this installation does not get pushes for (tasks, sales, bookings, messages, stock, system) — they still appear in /notifications (برمز التطبيق فقط)
GET/api/v1/account/deletion(app)Delete account (apps): which path applies — workspace owner closes the workspace, staff ask the administrators, customers use the website — with links and a pending request (برمز التطبيق فقط)
POST/api/v1/account/deletion(app)Delete account (apps): mode request = ask the administrators to delete the staff account and remove the app data; mode app-data = only end every app sign-in and web session and remove devices / push tokens (برمز التطبيق فقط)
POST/api/v1/session/sign-out-all(app)Sign out of all devices: ends every app sign-in and web session of the person and removes their app installations (برمز التطبيق فقط)
GET/api/v1/rider/today(app)Rider mode: which duties I may start (rider = parcels.ride, tech = field.work, driver = fleet.drive), my duty, today's runs, delivery stops and pickups (برمز التطبيق فقط)
POST/api/v1/rider/duty(app)Start duty (returns a duty token that can only post positions / end the duty) or end it; the workspace's live-location setting must be on (برمز التطبيق فقط)
POST/api/v1/rider/positions(app)Post a batch of positions while on duty (app token or the duty token fx_dt_…); only the newest valid point is kept (latest position, no trail) and feeds the recipient ETA and the runs map; a driver's batch also moves their vehicle and, when the workspace keeps one, its short trail (برمز التطبيق فقط)
GET/api/v1/apps(app)Home screen of the apps: the app grid I may open (name, area, icon as SVG nodes, waiting count), the workspace brand and unread alerts (برمز التطبيق فقط)
GET/api/v1/search(app)Search records I may open (customers, invoices, orders, products …), grouped like the admin header search; also suggestion (did you mean), quick (prefilled create links such as a new invoice for a customer) and intent (برمز التطبيق فقط)
GET/api/v1/notifications(app)Alerts for me since a time (the desktop app polls this) (برمز التطبيق فقط)

Sensors

الطريقةالمسارالنطاقما الذي يفعله
POST/api/v1/sensors/readingssensors:writeUpload sensor readings (temperature, humidity, fuel_level, value) — up to 500 per request; the device is the key's own device or the serial in `device`; re-sent readings are skipped; send an Idempotency-Key

التالي: خطافات الويب

أحداث العمل تُرسل إلى نقطة HTTPS الخاصة بك، موقّعة ومعادة المحاولة ومسجّلة.

خطافات الويب