المصادقة والصلاحيات
كل عميل API مرتبط بشركة واحدة وبمجموعة Scopes. الشركة تُعرف من بيانات الاعتماد، ولا تُقبل من جسم الطلب.
API Key
X-Api-Key: sgk_live_xxxxxxxx
# أو
Authorization: Bearer sgk_live_xxxxxxxx
OAuth2 Client Credentials
curl -X POST https://api.crmgateway.brainstorming-solutions.com//oauth/token \
-u "cli_xxxx:sgs_live_xxxx" \
-d grant_type=client_credentials \
-d scope="posts:write comments:read"
{ "access_token": "eyJ...", "token_type": "Bearer", "expires_in": 3600, "scope": "posts:write comments:read" }
Scopes
accounts:read | قراءة الحسابات |
posts:read | قراءة المنشورات |
posts:write | النشر والإلغاء |
comments:read | قراءة التعليقات |
comments:write | الرد والإخفاء والحذف |
operations:read | قراءة العمليات |
uploads:write | رفع الملفات |
sandbox:write | أدوات التجربة |
تدوير المفاتيح
عند التدوير يعمل المفتاح القديم لفترة قابلة للتهيئة (api.key_rotation_grace_hours) حتى تنقل نظامك بدون توقف.
حدود الطلبات
كل رد يحمل X-RateLimit-Limit و X-RateLimit-Remaining و X-RateLimit-Reset. عند التجاوز: 429 مع Retry-After.