RESTful API reference for integrating mobile applications with ERP Mobile Bridge.
The ERP Mobile Bridge API provides endpoints for mobile applications to retrieve app settings, check for updates, manage device tokens, and fetch content.
https://yourdomain.com/api
All API responses are in JSON format with the following structure:
{
"status": "success|error",
"message": "Human-readable message",
"data": { /* Response data */ }
}
GET or POST methods and
return JSON responses.
Currently, the API endpoints are publicly accessible and do not require authentication. Device tokens are used to identify unique devices for push notifications.
Retrieve complete app configuration including branding, colors, features, and URLs.
{
"status": "success",
"message": "App settings retrieved successfully",
"data": {
"app_name": "ERP Mobile Bridge",
"package_name": "com.web2app.pro",
"platform": "both",
"website_url": "https://example.com",
"app_logo_url": "https://yourdomain.com/storage/logos/app-logo.png",
"splash_logo_url": "https://yourdomain.com/storage/logos/splash-logo.png",
"primary_color": "#2196f3",
"secondary_color": "#ffc107",
"pull_to_refresh": true,
"exit_popup": true,
"hide_header": false,
"hide_footer": false,
"share_message": "Check out this amazing app!",
"offline_message": "No internet connection.",
"maintenance_mode": false
}
}
| Field | Type | Description |
|---|---|---|
app_name |
string | Application name |
package_name |
string | App package identifier |
platform |
string | Target platform: "both", "android", or "ios" |
website_url |
string | Website URL to load in app |
app_logo_url |
string|null | Full URL to app logo |
splash_logo_url |
string|null | Full URL to splash screen logo |
primary_color |
string | Primary brand color (hex) |
secondary_color |
string | Secondary brand color (hex) |
pull_to_refresh |
boolean | Enable pull-to-refresh feature |
exit_popup |
boolean | Show exit confirmation dialog |
hide_header |
boolean | Hide app header/toolbar |
hide_footer |
boolean | Hide app footer/navigation |
share_message |
string|null | Message for app sharing |
offline_message |
string|null | Message when offline |
maintenance_mode |
boolean | App in maintenance mode |
Check if an app update is available for a specific platform and version.
| Parameter | Type | Required | Description |
|---|---|---|---|
platform |
string | Yes | "android" or "ios" |
version_code |
integer | Yes | Current app version code |
GET /api/app-versions/check?platform=android&version_code=1
{
"status": "success",
"message": "Update available",
"data": {
"update_available": true,
"latest_version": {
"version_name": "2.0.0",
"version_code": 2,
"release_notes": "Bug fixes and performance improvements",
"force_update": false
}
}
}
{
"status": "success",
"message": "App is up to date",
"data": {
"update_available": false,
"latest_version": null
}
}
Retrieve all published pages.
{
"status": "success",
"message": "Pages retrieved successfully",
"data": [
{
"id": 1,
"title": "About Us",
"slug": "about-us",
"content": "<h1>About Us</h1><p>...</p>",
"status": "published",
"created_at": "2025-12-28T10:00:00.000000Z"
}
]
}
Retrieve a specific page by its slug.
| Parameter | Type | Description |
|---|---|---|
slug |
string | Page slug (e.g., "about-us") |
GET /api/pages/about-us
{
"status": "success",
"message": "Page retrieved successfully",
"data": {
"id": 1,
"title": "About Us",
"slug": "about-us",
"content": "<h1>About Us</h1><p>Company description...</p>",
"status": "published",
"created_at": "2025-12-28T10:00:00.000000Z"
}
}
Retrieve all active onboarding screens ordered by sequence.
{
"status": "success",
"message": "Onboarding screens retrieved successfully",
"data": [
{
"id": 1,
"title": "Welcome",
"description": "Welcome to our amazing app!",
"image_url": "https://yourdomain.com/storage/onboarding/screen1.png",
"order": 1,
"status": "active"
},
{
"id": 2,
"title": "Features",
"description": "Discover powerful features",
"image_url": "https://yourdomain.com/storage/onboarding/screen2.png",
"order": 2,
"status": "active"
}
]
}
| Field | Type | Description |
|---|---|---|
id |
integer | Screen ID |
title |
string | Screen title |
description |
string | Screen description |
image_url |
string|null | Full URL to screen image |
order |
integer | Display order |
status |
string | "active" or "inactive" |
Register or update a device token for push notifications.
| Field | Type | Required | Description |
|---|---|---|---|
token |
string | Yes | FCM device token |
platform |
string | Yes | "android" or "ios" |
device_id |
string | No | Unique device identifier |
POST /api/device-tokens
Content-Type: application/json
{
"token": "fcm_token_here",
"platform": "android",
"device_id": "unique_device_id"
}
{
"status": "success",
"message": "Device token registered successfully",
"data": {
"id": 1,
"token": "fcm_token_here",
"platform": "android",
"device_id": "unique_device_id",
"is_active": true
}
}
Remove a device token (e.g., when user logs out or uninstalls).
| Parameter | Type | Description |
|---|---|---|
token |
string | FCM device token to delete |
DELETE /api/device-tokens/fcm_token_here
{
"status": "success",
"message": "Device token deleted successfully",
"data": null
}
When an error occurs, the API returns a JSON response with error details:
{
"status": "error",
"message": "Error description",
"error": "Detailed error message (in development mode)"
}
| Code | Status | Description |
|---|---|---|
200 |
OK | Request successful |
201 |
Created | Resource created successfully |
400 |
Bad Request | Invalid request parameters |
404 |
Not Found | Resource not found |
422 |
Unprocessable Entity | Validation error |
500 |
Internal Server Error | Server error occurred |
{
"status": "error",
"message": "Validation failed",
"errors": {
"token": ["The token field is required."],
"platform": ["The platform must be android or ios."]
}
}
{
"status": "error",
"message": "Page not found",
"data": null
}
{
"status": "error",
"message": "Failed to retrieve app settings",
"error": "Database connection error"
}
// Fetch app settings
async function getAppSettings() {
try {
const response = await fetch('https://yourdomain.com/api/app-settings');
const data = await response.json();
if (data.status === 'success') {
console.log('App Settings:', data.data);
return data.data;
}
} catch (error) {
console.error('Error fetching settings:', error);
}
}
// Register device token
async function registerDeviceToken(fcmToken, platform) {
try {
const response = await fetch('https://yourdomain.com/api/device-tokens', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
token: fcmToken,
platform: platform,
device_id: 'unique_device_id'
})
});
const data = await response.json();
console.log('Token registered:', data);
} catch (error) {
console.error('Error registering token:', error);
}
}
// Check for updates
async function checkForUpdate(platform, versionCode) {
try {
const response = await fetch(
`https://yourdomain.com/api/app-versions/check?platform=${platform}&version_code=${versionCode}`
);
const data = await response.json();
if (data.data.update_available) {
console.log('Update available:', data.data.latest_version);
// Show update dialog
}
} catch (error) {
console.error('Error checking update:', error);
}
}
import 'dart:convert';
import 'package:http/http.dart' as http;
// Fetch app settings
Future