The Aswar Academy Registration System provides a secure phone-based registration process with OTP (One-Time Password) verification via WhatsApp.
Endpoint: POST /api/auth/register
Register a new user with the following required information:
{
"full_name": "User Name",
"phone_number": "1234567890",
"country_code": "+1",
"password": "password123",
"password_confirmation": "password123",
"city": "city_name",
"g_recaptcha_response": "recaptcha_token"
}
Optional fields:
image
(File: jpeg, png, jpg, max: 2048KB)email
(String, unique)birth_date
(Date)address
(String, max: 255)facebook_url
(URL)linkedin_url
(URL)skills
(Array)languages
(Array)work_experiences
(Array)eductions
(Array)
Response:
{
"message": "Registration initiated. Please verify your phone number with the code sent via WhatsApp."
}
Endpoint: POST /api/auth/verify
Verify the OTP sent to WhatsApp:
{
"phone_number": "1234567890",
"otp": "123456",
"g_recaptcha_response": "recaptcha_token"
}
Success Response:
{
"user": {
// User details
},
"token": "access_token",
"message": "Registration completed successfully"
}
Endpoint: POST /api/auth/resend-otp
Request a new OTP if the previous one expired or wasn't received:
{
"phone_number": "1234567890"
}
Success Response:
{
"message": "New verification code has been sent to your WhatsApp."
}
- Invalid input data:
400 Bad Request
- Server error:
500 Internal Server Error
- Invalid or expired OTP:
400 Bad Request
- Missing registration data:
400 Bad Request
- Server error:
500 Internal Server Error
- No pending registration:
400 Bad Request
- Server error:
500 Internal Server Error
-
OTP Expiry
- OTP codes are valid for 10 minutes
- After expiry, use the resend OTP endpoint
-
WhatsApp Verification
- Make sure the phone number is active on WhatsApp
- Check WhatsApp for the verification code
-
Security Features
- Rate limiting on all endpoints
- reCAPTCHA verification
- Secure password requirements
- Phone number uniqueness check
-
Environment Requirements
- PHP >= 8.0
- Redis server
- Laravel framework
- WhatsApp API integration
-
Configuration
- Set up Redis connection
- Configure WhatsApp API credentials
- Set up reCAPTCHA keys
To test the registration flow:
- Start with registration endpoint
- Check WhatsApp for OTP
- Verify with received OTP
- (Optional) Test OTP resend if needed
For any issues or questions, please contact the development team or create an issue in the repository.