Login
This guide explains how to implement Sign-In in the Mentor Calwe application.
Request
Endpoint
- Method: POST
- URL:
/v1/coach/login
Request Headers
| Header | Value | Required |
|---|---|---|
| Content-Type | application/json | Yes |
| Accept | application/json | Yes |
Request Body
| Parameter | Type | Description | Required |
|---|---|---|---|
| string | email address | Yes | |
| password | string | User's password | Yes |
Success Response
{
"success": true,
"message": "تم تسجيل الدخول بنجاح.",
"data": {
"fullName": "الاسم اللقب",
"email": "example@gmail.com",
"isEmailVerified": true,
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9....",
"tokenType": "Bearer",
"expiresAt": "2025-04-25 12:09:24",
"isCompletedPersonalInformation": true,
"isCompletedProfessionalInformation": true
},
"statusCode": 200
}
Error Responses
Login Error (422)
{
"success": false,
"message": "اسم المستخدم أو كلمة المرور غير صحيحة",
"errors": [
"اسم المستخدم أو كلمة المرور غير صحيحة"
],
"data": [],
"statusCode": 401
}
Account Not Found (422)
{
"success": false,
"message": "حدث خطأ في البيانات المرسلة يرجى التحقق منها.",
"errors": {
"email": "البريد الالكتروني غير موجودً"
},
"data": [],
"statusCode": 422
}
Validation Error (422)
{
"success": false,
"message": "حدث خطأ في البيانات المرسلة يرجى التحقق منها.",
"errors": {
"password": "كلمة المرور يجب أن تحتوي على حروف وأرقام ورموز خاصة"
},
"data": [],
"statusCode": 422
}
Example Implementation Flow
- Use email and password to Sign-In in your application
- User clicks on Sign-In button