المفاهيم
نطاقات الصلاحية (Scopes)
تحدد نطاقات الصلاحية ما يمكن للمفتاح فعله. اخترها عند إنشاء المفتاح، وامنح كل مفتاح ما يحتاجه فقط.
يفشل أي طلب إلى نقطة نهاية لا يملك المفتاح نطاق الصلاحية الخاص بها، مع الخطأ 403 INSUFFICIENT_SCOPE. لا يمكن إضافة نطاقات صلاحية إلى مفتاح موجود: أنشئ مفتاحًا جديدًا وألغِ القديم.
غير متاح: المدفوعات، والمحفظة، والرموز (tokens)، والتحويلات، وإعدادات الحساب. لا يمنح أي نطاق صلاحية الوصول إليها.
كل نطاقات الصلاحية#
| نطاق الصلاحية | يسمح بـ |
|---|---|
profile:read | قراءة ملفك الشخصي والملفات الشخصية العامة للمستخدمين الآخرين. |
posts:read | قراءة المنشورات (منشوراتك وتلك التي يمكنك رؤيتها في التطبيق) وتعليقاتها. |
posts:write | رفع الوسائط، ونشر منشوراتك وتعديلها وحذفها. |
comments:write | كتابة التعليقات وحذف تعليقاتك (أو التعليقات على منشوراتك). |
likes:write | الإعجاب بالمنشورات وإلغاء الإعجاب. |
follows:write | متابعة المستخدمين وإلغاء متابعتهم. |
stories:write | نشر القصص. |
store:read | قراءة متجرك على Bloop ومنتجاته. |
store:write | تعديل متجرك، وإنشاء المنتجات وتحديثها وحذفها، وتحديث المخزون. |
orders:read | قراءة الطلبات التي يستلمها متجرك. |
orders:write | تحديد الطلبات كمشحونة. |
chat:read | قراءة محادثاتك ورسائلها. |
chat:write | إرسال الرسائل (مع قاعدة مكافحة الرسائل المزعجة). |
نقاط النهاية حسب نطاق الصلاحية#
كل المسارات نسبية إلى https://api.linework.app/open/v1.
| نقطة النهاية (endpoint) | نطاق الصلاحية |
|---|---|
GET /me | profile:read |
GET /users/{id} | profile:read |
GET /users/by-username/{username} | profile:read |
GET /me/posts | posts:read |
GET /users/{id}/posts | posts:read |
GET /posts/{id} | posts:read |
GET /posts/{id}/comments | posts:read |
POST /media | posts:write أو stories:write أو store:write |
POST /posts | posts:write |
PATCH /posts/{id} | posts:write |
DELETE /posts/{id} | posts:write |
POST /posts/{id}/comments | comments:write |
DELETE /comments/{id} | comments:write |
POST DELETE /posts/{id}/like | likes:write |
POST DELETE /users/{id}/follow | follows:write |
POST /stories | stories:write |
GET /store | store:read |
POST PATCH /store | store:write |
GET /store/products | store:read |
POST /store/products | store:write |
PATCH DELETE /store/products/{id} | store:write |
PATCH /store/products/{id}/stock | store:write |
GET /store/orders | orders:read |
GET /store/orders/{id} | orders:read |
POST /store/orders/{id}/ship | orders:write |
GET /conversations | chat:read |
GET /conversations/{id}/messages | chat:read |
POST /conversations/{id}/messages | chat:write |
POST /messages | chat:write |
مرجع API هو المصدر المعتمد: تذكر كل عملية نطاق الصلاحية المطلوب لها.
مجموعات مقترحة#
| التكامل | نطاقات الصلاحية |
|---|---|
| روبوت نشر | profile:read posts:read posts:write stories:write |
| مدير المجتمع | posts:read comments:write likes:write |
| مزامنة المتجر | store:read store:write orders:read orders:write |
| روبوت دردشة للدعم | chat:read chat:write (+ orders:read للبحث عن الطلبات) |