الانتقال إلى الوثائق
فتح لوحة التحكم
في هذه الصفحة

POST /oauth/register

يستخدم OAuth بروتوكول S256 PKCE ورابط إعادة توجيه مطابقًا وموردًا منفصلًا لـ REST أو MCP. تتم الموافقة داخل Tong، وتتغير رموز التحديث مع كل استخدام.

مثال طلب#

curl -X POST 'https://platform.tongai.io/oauth/register' \  -H "Content-Type: application/json" \  -d '{  "client_name": "example",  "redirect_uris": [    "https://your-app.example/events"  ],  "scope": "example"}'
الإعدادات
curl --version

المصادقة#

none

المعاملات#

لا توجد معاملات مطلوبة.

محتوى الطلب#

application/json
client_namestringمطلوب

الحد الأدنى للطول: 1 محرفًا.

الحد الأقصى للطول: 120 محرفًا.

redirect_urisstring[]مطلوب

الحد الأدنى للعناصر: 1.

الحد الأقصى للعناصر: 10.

scopestringمطلوب

الحد الأقصى للطول: 3000 محرفًا.

token_endpoint_auth_methodstringاختياري
القيم المسموح بها"none"

القيمة الافتراضية: "none".

grant_typesstring[]اختياري

القيمة الافتراضية: ["authorization_code","refresh_token"].

response_typesstring[]اختياري

القيمة الافتراضية: ["code"].

مخطط الاستجابة#

JSON
{  "client_id": "e8aa0a87-6cd9-42eb-975a-b72bf43218c8",  "client_name": "Your application",  "redirect_uris": [    "https://your-app.example/oauth/callback"  ],  "scope": "catalog:read operations:read",  "token_endpoint_auth_method": "none",  "grant_types": [    "authorization_code",    "refresh_token"  ],  "response_types": [    "code"  ]}

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

JSON
{  "error": "invalid_client_metadata"}