العودة إلى التوثيق
مرجع API
مرجع واجهة برمجة التطبيقات
مرجع شامل لجميع نقاط نهاية REST API مع أمثلة الطلب والاستجابة.
المصادقة
كل الطلبات تتطلب مصادقة
يتم تمرير المصادقة عبر رؤوس HTTP في كل طلب.
| الرأس | مطلوب | الوصف |
|---|---|---|
X-Api-Key | Required | مفتاح API الخاص بك |
X-Tenant-Id | Required | معرف المستأجر الخاص بك |
Content-Type | Conditional | مطلوب لطلبات POST/PUT |
bash
curl -X GET https://api.qawaid.ai/api/v1/rules \
-H "X-Api-Key: qw_live_your_api_key" \
-H "X-Tenant-Id: your-tenant-id"Base URL
https://api.qawaid.aiجميع مسارات API نسبية لعنوان URL الأساسي هذا. استخدم HTTPS دائمًا.
POST
/api/v1/validation/validateValidate a single payload against all published rules in the given context.
200Validation result returned400Invalid request body401UnauthorizedRequest Body
json
{
"context": "loan-application",
"payload": {
"applicant": { "age": 25, "income": 75000 },
"loan": { "amount": 250000, "term": 30 }
}
}Response
json
{
"isValid": false,
"totalRulesEvaluated": 5,
"failures": [
{
"ruleCode": "INCOME-RATIO-001",
"ruleName": "Income to Loan Ratio",
"severity": "Error",
"message": "Loan amount exceeds 3x annual income",
"errorCode": "INCOME_RATIO",
"fieldPath": "loan.amount",
"actualValue": 250000,
"expectedValue": 225000
}
],
"executionTimeMs": 12
}bash
curl -X POST https://api.qawaid.ai/api/v1/validation/validate \
-H "X-Api-Key: qw_live_your_api_key" \
-H "X-Tenant-Id: your-tenant-id" \
-H "Content-Type: application/json" \
-d '{
"context": "loan-application",
"payload": {
"applicant": { "age": 25, "income": 75000 },
"loan": { "amount": 250000, "term": 30 }
}
}'POST
/api/v1/validation/validate-batchValidate multiple payloads in a single request. Ideal for bulk data processing scenarios.
200Batch results returned400Invalid request body401UnauthorizedRequest Body
json
{
"context": "order-validation",
"items": [
{ "id": "order-1", "payload": { "total": 150, "currency": "USD" } },
{ "id": "order-2", "payload": { "total": 25, "currency": "USD" } },
{ "id": "order-3", "payload": { "total": 500, "currency": "EUR" } }
]
}Response
json
{
"results": [
{ "id": "order-1", "isValid": true, "failures": [] },
{ "id": "order-2", "isValid": false, "failures": [{ "ruleCode": "MIN-ORDER-001", "message": "Order must be at least $50" }] },
{ "id": "order-3", "isValid": true, "failures": [] }
],
"totalProcessed": 3,
"totalFailed": 1,
"executionTimeMs": 28
}bash
curl -X POST https://api.qawaid.ai/api/v1/validation/validate-batch \
-H "X-Api-Key: qw_live_your_api_key" \
-H "X-Tenant-Id: your-tenant-id" \
-H "Content-Type: application/json" \
-d '{
"context": "order-validation",
"items": [
{ "id": "order-1", "payload": { "total": 150, "currency": "USD" } },
{ "id": "order-2", "payload": { "total": 25, "currency": "USD" } }
]
}'POST
/api/v1/validation/validate-transactionValidate a complete transaction with multiple rule contexts evaluated atomically.
200Transaction result returned400Invalid request body401UnauthorizedRequest Body
json
{
"transactionId": "txn-20240115-001",
"contexts": ["kyc-check", "aml-screening", "credit-assessment"],
"payload": {
"customer": { "name": "John Doe", "country": "US", "pep": false },
"transaction": { "amount": 50000, "type": "wire-transfer" }
}
}Response
json
{
"transactionId": "txn-20240115-001",
"overallResult": "Rejected",
"contextResults": [
{ "context": "kyc-check", "isValid": true, "failures": [] },
{ "context": "aml-screening", "isValid": true, "failures": [] },
{ "context": "credit-assessment", "isValid": false, "failures": [
{ "ruleCode": "CREDIT-LIMIT-001", "message": "Amount exceeds single transaction limit" }
]}
],
"executionTimeMs": 45
}bash
curl -X POST https://api.qawaid.ai/api/v1/validation/validate-transaction \
-H "X-Api-Key: qw_live_your_api_key" \
-H "X-Tenant-Id: your-tenant-id" \
-H "Content-Type: application/json" \
-d '{
"transactionId": "txn-20240115-001",
"contexts": ["kyc-check", "aml-screening", "credit-assessment"],
"payload": {
"customer": { "name": "John Doe", "country": "US" },
"transaction": { "amount": 50000, "type": "wire-transfer" }
}
}'رموز حالة HTTP
| الرمز | الحالة | الوصف |
|---|---|---|
200 | OK | Request succeeded |
201 | Created | Resource created successfully |
204 | No Content | Resource deleted successfully |
400 | Bad Request | Invalid request body or parameters |
401 | Unauthorized | Missing or invalid API key |
402 | Payment Required | Payment method required for plan change |
404 | Not Found | Resource does not exist |
409 | Conflict | Resource state conflict (e.g., duplicate or wrong status) |
429 | Too Many Requests | Rate limit exceeded, retry after cooldown |
500 | Server Error | Internal server error, contact support |
ابدأ الآن
قم بتحميل مجموعة Postman أو ابدأ مع دليل التكامل.