عون Aun — المساعد الشخصي الذكي للسوق السعودي

EMM Technology Solutions · WhatsApp-first · PDPL-compliant · in-Kingdom
الرصيد اللوحة

المصادقة والصلاحيات والحدود

المصادقة: مفتاح API من صفحة المفاتيح بالشكل emm_aun_<id8>_<secret32> — ترسله في Authorization: Bearer … أو X-API-Key. يُحفظ تجزئته SHA-256 فقط ويُعرض مرة واحدة عند الإنشاء.

الصلاحيات: read لكل ما هو GET · write لإرسال الرسائل وإنشاء طلبات الشحن. المفتاح مقيد بمستخدم واحد: لا يرى بيانات غير مستخدمه، ولا يصل إلى بيانات واتساب أو مفاتيح الدفع أو رموز nod إطلاقاً.

الحدود: 60 طلباً/دقيقة لكل مفتاح → 429 مع Retry-After و X-RateLimit-*. الترحيل ?limit=&offset= (افتراضي 50، أقصى 200) → data.items / data.total.

المغلّف: النجاح {"ok":true,"data":…} · الخطأ {"ok":false,"error":{"code","message"}}. المبالغ نص بالريال بمنزلتين (49.00)، التواريخ ISO-8601 بتوقيت الرياض (+03:00).

الدفع: الشحن عبر emm-pay (StreamPay: مدى · Apple Pay · Visa) داخل التطبيق. أضف "dry_run":true أو ?dry_run=1 لحساب السعر دون إنشاء طلب. يُفعَّل الطلب عبر ويبهوك موقّع (X-EMM-Pay-Signature) بعد تحقق جانبي الخادم.

المواصفة: OpenAPI 3.1 · خادم MCP على POST /mcp · صفحة الوكلاء

GET /me — المستخدم والخطة والحصص — اختبار مفتاحك read

الصلاحية: read · النجاح: 200 · الأخطاء: 400 / 401 / 403 / 429

curl -s -X GET -H "Authorization: Bearer $AUN_KEY" https://aun.emm.sa/api/v1/me

GET /credit — حالة الخدمة: تاريخ الانتهاء، الأيام المتبقية، الباقات read

الصلاحية: read · النجاح: 200 · الأخطاء: 400 / 401 / 403 / 429

curl -s -X GET -H "Authorization: Bearer $AUN_KEY" https://aun.emm.sa/api/v1/credit

GET /plans — باقات الشحن 30/90/365 يوماً بالريال وأين تُدفع read

الصلاحية: read · النجاح: 200 · الأخطاء: 400 / 401 / 403 / 429

curl -s -X GET -H "Authorization: Bearer $AUN_KEY" https://aun.emm.sa/api/v1/plans

POST /credit/checkout — إنشاء طلب شحن عبر emm-pay — dry_run=true يحسب السعر فقط بلا طلب حقيقي write

الصلاحية: write · النجاح: 200 · الأخطاء: 400 / 401 / 403 / 429

curl -s -X POST -H "Authorization: Bearer $AUN_KEY" -H "Content-Type: application/json" -d '{"plan": true, "dry_run": false}' https://aun.emm.sa/api/v1/credit/checkout

GET /orders — سجل شحنات الخدمة (ترحيل) read

الصلاحية: read · النجاح: 200 · الأخطاء: 400 / 401 / 403 / 429 · المعاملات: limit offset

curl -s -X GET -H "Authorization: Bearer $AUN_KEY" https://aun.emm.sa/api/v1/orders

GET /conversation — المحادثة مع عون: آخر N رسالة (الأقدم أولاً) read

الصلاحية: read · النجاح: 200 · الأخطاء: 400 / 401 / 403 / 429 · المعاملات: limit

curl -s -X GET -H "Authorization: Bearer $AUN_KEY" https://aun.emm.sa/api/v1/conversation

GET /messages — رسائل المستخدم فقط (ترحيل، الأحدث أولاً) read

الصلاحية: read · النجاح: 200 · الأخطاء: 400 / 401 / 403 / 429 · المعاملات: limit offset

curl -s -X GET -H "Authorization: Bearer $AUN_KEY" https://aun.emm.sa/api/v1/messages

POST /messages — إرسال نص إلى وكيل المستخدم وإرجاع الرد (لا يُرسل شيء إلى واتساب) write

الصلاحية: write · النجاح: 201 · الأخطاء: 400 / 401 / 403 / 429

curl -s -X POST -H "Authorization: Bearer $AUN_KEY" -H "Content-Type: application/json" -d '{"text": true}' https://aun.emm.sa/api/v1/messages

GET /reminders — تذكيرات المستخدم (ترحيل) read

الصلاحية: read · النجاح: 200 · الأخطاء: 400 / 401 / 403 / 429 · المعاملات: limit offset

curl -s -X GET -H "Authorization: Bearer $AUN_KEY" https://aun.emm.sa/api/v1/reminders

GET /notes — ملاحظات/ذكريات المستخدم (ترحيل) read

الصلاحية: read · النجاح: 200 · الأخطاء: 400 / 401 / 403 / 429 · المعاملات: limit offset

curl -s -X GET -H "Authorization: Bearer $AUN_KEY" https://aun.emm.sa/api/v1/notes

MCP — POST /mcp (JSON-RPC 2.0، Streamable HTTP، بروتوكول 2025-06-18)

نفس المفتاح. التسلسل: initialize ← notifications/initialized (202) ← tools/list ← tools/call. الأدوات: aun_send_message (write)، aun_conversation، aun_credit_status، aun_pricing، aun_capabilities (read). أداة غير معروفة → -32602 · طريقة غير معروفة → -32601 · بلا مفتاح → 401 · GET /mcp → 405 · مهلة الأداة 25 ثانية.

curl -s -X POST -H "Authorization: Bearer $AUN_KEY" -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"agent","version":"1"}}}' https://aun.emm.sa/mcp
curl -s -X POST -H "Authorization: Bearer $AUN_KEY" -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"aun_credit_status","arguments":{}}}' https://aun.emm.sa/mcp