Authentication and Login API
Product: NEXTMEGABYTE (Greenitco ITAM) · Module: API Documentation · Audience: Developer, Administrator
This page lists the NEXTMEGABYTE REST API endpoints for authentication. All URLs are relative to your portal, for example https://your-domain.com/api/.... Authenticate first with the Login API and send the standard headers described in the API Overview. Example values are shortened and anonymized.
Login
POST /api/login
Authenticates a user with email and password. Returns the user profile, roles, permissions and the access_token used in the token header of all other requests.
Request Headers
| Header | Type | Description |
|---|---|---|
| Content-Type | String | Must be application/json |
Request Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| String | Yes | The user's email address | |
| password | String | Yes | The user's password |
Example request
{
"email": "<string>",
"password": "<string>"
}
Example response (shortened)
Here is an example of an API response formatted in JSON: { "status": "success", "msg": "Welcome, You have logged in successfully!", "data": { "id": 495, "first_name": "", "last_name": "", "username": "", "email": "user@example.com", "phone": null, "jobtitle": null, "employee_num": "1456", "country": null, "gravatar": null, "location_id": 3, "company_id": 1, "manager_id": 244, "department_id": 1, " …
Forgot password
POST /api/forgot-password
Sends a password reset email to the given email address.
Request Headers
| Header | Type | Description |
|---|---|---|
| Content-Type | String | Must be application/x-www-form-urlencoded |
| apptoken | String | Must be A4uhcLJc1XrAbYUPyxEZlMChDcRzLWVj |
Request Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| String | Yes | The user's email address |
Example request
{
"email": "<string>"
}
Example response (values shortened and anonymized)
{
"status": "success",
"msg": "Password reset link and a code has been sent to user@example.com Please use any of them to reset password.",
"user_id": 123
}
Update push notification (FCM) token
POST /api/user/updateFcmToken
Saves the device's Firebase Cloud Messaging token so the user receives mobile push notifications.
Headers: standard authenticated headers (apptoken, token, Content-Type: application/x-www-form-urlencoded). See API Overview.
Request Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| fcm_token | String | Yes | device fcm token |
Example request
{
"fcm_token": "<token>"
}
Example response (values shortened and anonymized)
{
"status": "success",
"msg": "FCM Token updated successfully.",
"data": []
}
Get enabled modules
GET /api/getModulesForRole
Returns the modules enabled for the signed-in user's role, used to build the app menu.
Headers: standard authenticated headers (apptoken, token, Content-Type: application/x-www-form-urlencoded). See API Overview.
Top-level response fields: status, msg, isTechnician, data
Example response (values shortened and anonymized)
{
"status": "success",
"msg": "Module fetched successfully",
"isTechnician": true,
"data": {
"1": {
"module": "<string>",
"status": 1
},
"2": {
"module": "<string>",
"status": 1
},
"3": {
"module": "<string>",
"status": 1
},
"4": {
"module": "<string>",
"status": 1
},
"6": {
"module": "<string>",
"status": 1
},
"7": {
"module": "<string>",
"status": 1
},
"8": {
"module": "<string>",
"status": 1
},
"9": {
"module": "<string>",
"status": 1
},
"10": {
"module": "<string>",
"status": 1
},
"11": {
"module": "<string>",
"status": 1
},
"12": {
"module": "<string>",
"status": 1
},
"14": {
"module": "<string>",
"status": 1
},
"15": {
"module": "<string>",
"status": 1
},
"16": {
"module": "<string>",
"status": 1
},
"19": {
"module": "<string>",
"status": 1
},
"20": {
"module": "<string>",
"status": 1
},
"21": {
"module": "<string>",
"status": 1
},
"22": {
"module": "<string>",
"status": 1
},
"23": {
"module": "<string>",
"status": 1
},
"24": {
"module": "<string>",
"status": 1
},
"...": "2 more fields"
}
}
Update app version
POST /api/update-user-detail
Records the mobile app version and device details of the signed-in user.
Headers: standard authenticated headers (apptoken, token, Content-Type: application/x-www-form-urlencoded). See API Overview.
Request Body Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| user_id | String | Yes | user_id |
| app_version | String | Yes | app_version |
Example request
{
"user_id": "<string>",
"app_version": "<string>"
}
Example response (values shortened and anonymized)
{
"status": "Success",
"msg": "App version updated successfully"
}
Get Azure (environment) settings
GET /api/env-settings
Returns environment settings such as the Azure AD (Microsoft) sign-in configuration used by the mobile app.
Headers: standard authenticated headers (apptoken, token, Content-Type: application/x-www-form-urlencoded). See API Overview.
Example response (values shortened and anonymized)
{
"status": "success",
"msg": "ENV settings fetched successfully.",
"data": {
"azure": {
"client_id": "<string>",
"client_secret": "<string>",
"redirect": "https://your-domain.com/...",
"app_redirect": "<string>",
"tenant": "<string>",
"logout_url": "https://your-domain.com/...",
"group_ids": null
}
}
}
Get language data
GET /api/getLangData
Returns translation strings for the selected display language.
Headers: standard authenticated headers (apptoken, token, Content-Type: application/x-www-form-urlencoded). See API Overview.
Top-level response fields: status, msg, locales, data
Example response (values shortened and anonymized)
{
"status": "success",
"msg": "Data fetched successfully",
"locales": [
"<string>",
"..."
],
"data": {
"@Site URL Screen": {
"description": "<string>"
},
"pleaseSignIn": "<string>",
"goNext": "<string>",
"rememberMe": "<string>",
"getSupport": "<string>",
"wrongUrlMessage": "<string>",
"@Login Screen": {
"description": "<string>"
},
"siteURL": "<string>",
"statusBoard": "<string>",
"loginWithMicrosoft": "<string>",
"loginWithCredentials": "<string>",
"or": "<string>",
"pleaseSignInWithYourInfo": "<string>",
"signIn": "<string>",
"userNameOREmail": "<string>",
"password": "<string>",
"pleaseEnterSiteURL": "<string>",
"pleaseEnterUsername": "<string>",
"pleaseEnterPassword": "<string>",
"@Dashboard Screen": {
"description": "<string>"
},
"...": "281 more fields"
}
}