POST /api/auth/login
المصادقة / الصلاحيات: Public · HTTP 201
{
"email": "merchant@example.test",
"password": "YOUR_ACCOUNT_PASSWORD"
}curl -X POST 'https://ruya.site/api/auth/login'
-H 'Content-Type: application/json'
--data '{"email":"merchant@example.test","password":"YOUR_ACCOUNT_PASSWORD"}'const response = await fetch("https://ruya.site/api/auth/login", {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
"email": "merchant@example.test",
"password": "YOUR_ACCOUNT_PASSWORD"
})
});
if (!response.ok) throw new Error('RUYA HTTP ' + response.status);
const result = await response.json();مخططات الطلب والرد الناجح
{
"request": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"email": {
"type": "string",
"maxLength": 254,
"format": "email",
"pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
},
"password": {
"type": "string",
"minLength": 12,
"maxLength": 128
}
},
"required": [
"email",
"password"
]
},
"response": {
"type": "object",
"properties": {
"workspaceUrl": {
"type": "string"
},
"user": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"email": {
"type": "string"
},
"role": {
"type": "string"
},
"verified": {
"type": "boolean"
},
"merchantId": {
"type": "string"
}
},
"required": [
"id",
"email",
"role",
"verified",
"merchantId"
]
}
},
"required": [
"workspaceUrl",
"user"
]
}
}استبدل معاملات المسار بمعرف سجلك. اتبع قسم الأخطاء للردود الفاشلة. لا تحتوي الأمثلة على مفاتيح حقيقية أو نتائج دفع فعلية.
جرّب في Sandbox