api_endpoints_with_errors
api_endpoints_with_errors
1. Register Endpoint
Endpoint: POST /api/register
Description: This endpoint is used to register a student.
Request Body:
{
"schoolId": 1073741824,
"gradeId": 1073741824,
"classId": 1073741824,
"studentId": "string",
"nic": "923176191v",
"firstName": "string",
"lastName": "string",
"middleName": "string",
"nameWithInitial": "string",
"forename": "string",
"surname": "string",
"gender": 1,
"date": "2025-02-15T14:14:35.082Z",
"homeAddress": "string",
"nationalityId": 1073741824,
"provinceId": 1073741824,
"districtId": 1073741824,
"cityId": 1073741824,
"phoneNumber": "1032260898",
"whatsappNumber": "4098230050",
"email": "string",
"relationId": 1073741824,
"guardianName": "string",
"guardianNic": "473345391v",
"guardianContact": "4127255581",
"guardianString": "string",
"occupation": "string",
"streamId": 1073741824,
"subjectSt1Id": 1073741824,
"subjectSt2Id": 1073741824,
"subjectSt3Id": 1073741824,
"password": "stringst"
}
2. Login Endpoint
Endpoint: POST /api/login
Description: This endpoint allows a user to log in.
Request Body:
{
"credential": "string",
"password": "string"
}
401 - Unauthorized
{
"status": "error",
"code": 401,
"message": "Invalid credentials",
"data": {},
"metadata": {
"timestamp": "2025-02-15T14:14:35.082Z",
"version": "1.0"
}
}
403 - Forbidden
{
"status": "error",
"code": 403,
"message": "Access denied",
"data": {},
"metadata": {
"timestamp": "2025-02-15T14:14:35.082Z",
"version": "1.0"
}
}