Account and session
Plan section 2.1 · Screens S01–S06, S62. Read Authentication and session first for the token rules.
Login
/api/User/LoginAuthenticateSigns in and returns the token plus the user's basic profile.
userNameis usually the employee's mobile number. Trim spaces; the server trims too.fcmToken: the device's Firebase token. When present it replaces the token stored for this user (push goes to the last device that logged in). Sendnullif you don't have one yet.isPasswordChange: false→ force Set new password before anything else.isApprover: the employee's designation has "can approve" set. Combine it with the tenant setting to show Approvals (Server rules).isClarify: the employee's designation uses clarification applications. Show the Clarification request type only when true (Clarification).isJobSeeker: designation flag used by the recruitment module; the app does not need it.profileImageUriis a full URL or empty.
Request
JSON body:
| Field (JSON name) | Type |
|---|---|
userName | string |
password | string |
fcmToken | string |
- curl
- TypeScript (HRMS.Mobile)
- Body only
curl -X POST "$BASE_URL/User/LoginAuthenticate" \
-H "Content-Type: application/json" \
-d '{
"userName": "9876544821",
"password": "MyNewPass@2026",
"fcmToken": "fcm-device-token"
}'
const body: LoginDto = {
"userName": "9876544821",
"password": "MyNewPass@2026",
"fcmToken": "fcm-device-token"
};
import { api } from '@/services/api'; // HRMS.Mobile: unwraps ApiResponse<T>, throws ApiError
import type { LoginDto } from './types'; // request DTO
const data = await api.post<AuthenticatedUserDto>('User/LoginAuthenticate', body);
{
"userName": "9876544821",
"password": "MyNewPass@2026",
"fcmToken": "fcm-device-token"
}
Response
HTTP 200 with the standard envelope. responseData is AuthenticatedUserDto.
| Field (JSON name) | Type |
|---|---|
id | integer |
fullName | string |
userName | string |
profileImageUri | string |
token | string |
employeeId | integer |
designationName | string |
isClarify | boolean | null |
isJobSeeker | boolean | null |
isPasswordChange | boolean | null |
isApprover | boolean | null |
Example response
{
"isSuccess": true,
"responseData": {
"id": 87,
"fullName": "Priya Sharma",
"userName": "9876544821",
"profileImageUri": "https://api-hrms.weblancertechnologies.com/Images/profile.jpg",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"employeeId": 142,
"designationName": "Senior Site Engineer",
"isClarify": false,
"isJobSeeker": false,
"isPasswordChange": true,
"isApprover": true
},
"errorCode": 0,
"errorMessage": null,
"errorTitle": ""
}
Errors
- isSuccess: false · errorCode 1 “UserName or Password is incorrect.”
- isSuccess: false · errorCode 1 “Your Account is currently blocked.”
- HTTP 500 unhandled server exception (HTML/text body, not JSON).
On these errors responseData is null. Show errorMessage to the user as-is.
Source: HRMS.WebAPI/Controllers/UserController.cs → UserService.LoginAuthenticate · returns AuthenticatedUserDto
Change password
/api/User/ChangePasswordUsed for the forced first-login change (S04) and from Profile (S62).
idis the user id from login (not the employee id).currentPasswordis checked first; a wrong one returnsInvalid Password.- Apply the password rules on the device (min 8 characters, a letter and a number). The server does not enforce them.
- The response echoes the user record (
passwordis alwaysnull). Keep using the current token (it stays valid).
Request
JSON body:
| Field (JSON name) | Type |
|---|---|
id | integer | null |
currentPassword | string |
password | string |
- curl
- TypeScript (HRMS.Mobile)
- Body only
curl -X POST "$BASE_URL/User/ChangePassword" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"id": 87,
"currentPassword": "9876544821",
"password": "MyNewPass@2026"
}'
const body: ChangePasswordDto = {
"id": 87,
"currentPassword": "9876544821",
"password": "MyNewPass@2026"
};
import { api } from '@/services/api'; // HRMS.Mobile: unwraps ApiResponse<T>, throws ApiError
import type { ChangePasswordDto } from './types'; // request DTO
const data = await api.post<UserDto>('User/ChangePassword', body);
{
"id": 87,
"currentPassword": "9876544821",
"password": "MyNewPass@2026"
}
Response
HTTP 200 with the standard envelope. responseData is UserDto.
| Field (JSON name) | Type |
|---|---|
id | integer | null |
userName | string |
password | string |
fullName | string |
role | RoleDto |
profileImageUri | string |
isActive | boolean |
companyId | CompanyDto[] |
notificationIds | NotificationUserDto[] |
fcmToken | string |
uniqueName | string |
Example response
{
"isSuccess": true,
"responseData": {
"id": 1045,
"userName": "priya.sharma",
"password": "MyNewPass@2026",
"fullName": "Priya Sharma",
"role": {
"id": 1045,
"company": {
"id": 1045,
"companyName": "Acme Infra Pvt Ltd",
"companyWebsite": "string",
"personName": "string",
"companyLegalName": "string",
"panCard": "string",
"tanCard": "string",
"address": "B-402, Shaligram Heights, Satellite, Ahmedabad 380015",
"contactNo": "9876544821",
"email": "priya.sharma@acmeinfra.in",
"isActive": true,
"pfNo": "string",
"pfGroup": "string",
"pfEstNo": "string",
"esicNo": "string",
"lwfNo": "string",
"ptNo": "string"
},
"roleName": "string",
"isActive": true
},
"profileImageUri": "https://api-hrms.weblancertechnologies.com/Images/profile.jpg",
"isActive": true,
"companyId": [
{
"id": 1045,
"companyName": "Acme Infra Pvt Ltd",
"companyWebsite": "string",
"personName": "string",
"companyLegalName": "string",
"panCard": "string",
"tanCard": "string",
"address": "B-402, Shaligram Heights, Satellite, Ahmedabad 380015",
"contactNo": "9876544821",
"email": "priya.sharma@acmeinfra.in",
"isActive": true,
"pfNo": "string",
"pfGroup": "string",
"pfEstNo": "string",
"esicNo": "string",
"lwfNo": "string",
"ptNo": "string"
}
],
"notificationIds": [
{
"id": 1045,
"userId": 87,
"notificationTypeId": 1
}
],
"fcmToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"uniqueName": "string"
},
"errorCode": 0,
"errorMessage": null,
"errorTitle": ""
}
Errors
- isSuccess: false · errorCode 1 “User Not Found.”
- isSuccess: false · errorCode 1 “Invalid Password”
- HTTP 401 missing or expired token (see token expiry).
- HTTP 500 unhandled server exception (HTML/text body, not JSON).
On these errors responseData is null. Show errorMessage to the user as-is.
Source: HRMS.WebAPI/Controllers/UserController.cs → UserService.IsValidCurrentPassword, UserService.UpdatePassword · returns UserDto
Forgot password: send code
/api/User/SendResetPasswordOTPStep 1 of forgot password. userName goes in the query string (the method is POST with no body).
- The server looks up the employee whose mobile number equals
userNameand emails a one-time code to the employee's email address. - The code is 6 uppercase letters and is valid for 1 day.
- Unknown mobile number:
Invalid User Name.
Request
| Parameter | In | Type | Required |
|---|---|---|---|
userName | query string | string | yes |
- curl
- TypeScript (HRMS.Mobile)
curl -X POST "$BASE_URL/User/SendResetPasswordOTP?userName=9876544821"
const userName = "9876544821";
import { api } from '@/services/api'; // HRMS.Mobile: unwraps ApiResponse<T>, throws ApiError
const data = await api.post<boolean>('User/SendResetPasswordOTP', undefined, { params: { userName } });
Response
HTTP 200 with the standard envelope. responseData is boolean.
Type: boolean Example response
Errors
- isSuccess: false · errorCode 1 “Reset Password OTP Email Template not Found. Please Contact Admin.”
- isSuccess: false · errorCode 1 “Invalid User Name.”
- HTTP 500 unhandled server exception (HTML/text body, not JSON).
On these errors responseData is false. Show errorMessage to the user as-is.
Source: HRMS.WebAPI/Controllers/UserController.cs → UserService.SendResetPasswordOTP · returns boolean
Forgot password: set the new password
/api/User/ResetPasswordWithOTPStep 2 of forgot password. Send the same userName used in step 1, the code exactly as received (uppercase letters) and the new password.
- Success:
responseDatais the text"Password Reset Successfully". Go to Login with the toast "Password reset. Please sign in." - Missing user name or code:
User name and OTP are required. - Wrong or already used code, or a code for another user:
Not Found. Code older than 1 day:OTP is Expired. - After 5 wrong codes in 15 minutes:
Too many wrong attempts. Please request a new OTP.All pending codes are cancelled; offer Resend code (a new code also resets the counter).
Request
JSON body:
| Field (JSON name) | Type |
|---|---|
userName | string |
verificationCode | string |
password | string |
- curl
- TypeScript (HRMS.Mobile)
- Body only
curl -X POST "$BASE_URL/User/ResetPasswordWithOTP" \
-H "Content-Type: application/json" \
-d '{
"userName": "9876544821",
"verificationCode": "QKZTRM",
"password": "MyNewPass@2026"
}'
const body: ResetPasswordInputDto = {
"userName": "9876544821",
"verificationCode": "QKZTRM",
"password": "MyNewPass@2026"
};
import { api } from '@/services/api'; // HRMS.Mobile: unwraps ApiResponse<T>, throws ApiError
import type { ResetPasswordInputDto } from './types'; // request DTO
const data = await api.post<string>('User/ResetPasswordWithOTP', body);
{
"userName": "9876544821",
"verificationCode": "QKZTRM",
"password": "MyNewPass@2026"
}
Response
HTTP 200 with the standard envelope. responseData is string.
Type: string Example response
Errors
- isSuccess: false · errorCode 1 “User name and OTP are required.”
- isSuccess: false · errorCode 1 “Too many wrong attempts. Please request a new OTP.”
- isSuccess: false · errorCode 1 “Not Found”
- isSuccess: false · errorCode 1 “OTP is Expired”
- isSuccess: false · errorCode 1 “User Not Found.”
- HTTP 500 unhandled server exception (HTML/text body, not JSON).
On these errors responseData is null. Show errorMessage to the user as-is.
Source: HRMS.WebAPI/Controllers/UserController.cs → UserService.ResetPasswordWithOTP · returns string
Companies the user can switch to
/api/User/getUserCompanyLists the companies this user belongs to (POST with no body). Show Switch company only when the list has more than one item. Each item is the full company record; use id and companyName.
Request
No parameters and no body.
- curl
- TypeScript (HRMS.Mobile)
curl -X POST "$BASE_URL/User/getUserCompany" \
-H "Authorization: Bearer $TOKEN"
import { api } from '@/services/api'; // HRMS.Mobile: unwraps ApiResponse<T>, throws ApiError
const data = await api.post<CompanyEntity[]>('User/getUserCompany', undefined);
Response
HTTP 200 with the standard envelope. responseData is CompanyEntity[].
An array of CompanyEntity objects
| Field (JSON name) | Type |
|---|---|
id | integer |
uniqueName | string (uuid) |
createdBy | integer | null |
createdOn | string (date-time) | null |
updatedBy | integer | null |
updatedOn | string (date-time) | null |
tenantId | integer | null |
companyNamerequired | string |
companyWebsite | string |
personName | string |
companyLegalName | string |
panCard | string |
tanCard | string |
address | string |
contactNo | string |
email | string |
isActive | boolean |
pfNo | string |
pfGroup | string |
pfEstNo | string |
esicNo | string |
lwfNo | string |
ptNo | string |
Example response
{
"isSuccess": true,
"responseData": [
{
"id": 1045,
"uniqueName": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"createdBy": 1,
"createdOn": "2026-11-23T00:00:00",
"updatedBy": 1,
"updatedOn": "2026-11-23T00:00:00",
"tenantId": 1,
"companyName": "Acme Infra Pvt Ltd",
"companyWebsite": "string",
"personName": "string",
"companyLegalName": "string",
"panCard": "string",
"tanCard": "string",
"address": "B-402, Shaligram Heights, Satellite, Ahmedabad 380015",
"contactNo": "9876544821",
"email": "priya.sharma@acmeinfra.in",
"isActive": true,
"pfNo": "string",
"pfGroup": "string",
"pfEstNo": "string",
"esicNo": "string",
"lwfNo": "string",
"ptNo": "string"
}
],
"errorCode": 0,
"errorMessage": null,
"errorTitle": ""
}
Errors
- HTTP 401 missing or expired token (see token expiry).
- HTTP 500 unhandled server exception (HTML/text body, not JSON).
Source: HRMS.WebAPI/Controllers/UserController.cs → UserService.getUserCompany · returns CompanyEntity[]
Switch company
/api/User/companyAuthenticateTokenReturns a new login response with a new token for companyId (query string). Replace the stored token and session, then reload all data.
Request
| Parameter | In | Type | Required |
|---|---|---|---|
companyId | query string | integer | yes |
- curl
- TypeScript (HRMS.Mobile)
curl -X POST "$BASE_URL/User/companyAuthenticateToken?companyId=2" \
-H "Authorization: Bearer $TOKEN"
const companyId = 2;
import { api } from '@/services/api'; // HRMS.Mobile: unwraps ApiResponse<T>, throws ApiError
const data = await api.post<AuthenticatedUserDto>('User/companyAuthenticateToken', undefined, { params: { companyId } });
Response
HTTP 200 with the standard envelope. responseData is AuthenticatedUserDto.
| Field (JSON name) | Type |
|---|---|
id | integer |
fullName | string |
userName | string |
profileImageUri | string |
token | string |
employeeId | integer |
designationName | string |
isClarify | boolean | null |
isJobSeeker | boolean | null |
isPasswordChange | boolean | null |
isApprover | boolean | null |
Example response
{
"isSuccess": true,
"responseData": {
"id": 1045,
"fullName": "Priya Sharma",
"userName": "priya.sharma",
"profileImageUri": "https://api-hrms.weblancertechnologies.com/Images/profile.jpg",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"employeeId": 142,
"designationName": "Senior Site Engineer",
"isClarify": false,
"isJobSeeker": false,
"isPasswordChange": false,
"isApprover": true
},
"errorCode": 0,
"errorMessage": null,
"errorTitle": ""
}
Errors
- HTTP 401 missing or expired token (see token expiry).
- HTTP 500 unhandled server exception (HTML/text body, not JSON).
Source: HRMS.WebAPI/Controllers/UserController.cs → UserService.companyAuthenticateToken · returns AuthenticatedUserDto
Thought of the day
/api/User/GetTodayThoughtPublic (no token needed). Returns the quote from the server file wwwroot/Thoughts.json (the same for every tenant). If the file is missing: isSuccess: false, errorCode: 2, Thought not found!; hide the card.
Request
No parameters and no body.
- curl
- TypeScript (HRMS.Mobile)
curl -X POST "$BASE_URL/User/GetTodayThought"
import { api } from '@/services/api'; // HRMS.Mobile: unwraps ApiResponse<T>, throws ApiError
const data = await api.post<ThoughtOfTheDay>('User/GetTodayThought', undefined);
Response
HTTP 200 with the standard envelope. responseData is ThoughtOfTheDay.
| Field (JSON name) | Type |
|---|---|
thought | string |
thoughtBy | string |
Example response
{
"isSuccess": true,
"responseData": {
"thought": "string",
"thoughtBy": "string"
},
"errorCode": 0,
"errorMessage": null,
"errorTitle": ""
}
Errors
- isSuccess: false · errorCode 2 Thought not found!
- HTTP 500 unhandled server exception (HTML/text body, not JSON).
On these errors responseData is null. Show errorMessage to the user as-is.
Source: HRMS.WebAPI/Controllers/UserController.cs → UserService.GetTodayThought · returns ThoughtOfTheDay