Appearance
Subscribers (Users) API ​
Base URL:
https://your-domain.com
Endpoints for reading, creating and updating subscriber (user) accounts.
All requests require HTTP Basic Authentication.
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/user/users | Fetch subscribers (with filters) |
| POST | /api/user/users | Create or update a subscriber |
Fetch Subscribers ​
Retrieve a list of subscribers. Without filters, all subscribers are returned. Any filter below narrows the result. Each record is enriched with resolved area / sub-area / city names.
| Property | Value |
|---|---|
| Endpoint | Fetch Subscribers |
| Method | GET |
| URL | /api/user/users |
| Authentication | Basic Auth |
Request Headers:
| Header | Value | Required |
|---|---|---|
Authorization | Basic {credentials} | Yes |
Accept | application/json | Yes |
Query Parameters (all optional):
| Parameter | Type | Description |
|---|---|---|
user_id | integer | Filter by subscriber ID |
username | string | Filter by username |
mobile | string | Filter by mobile number |
phone | string | Filter by phone number |
email | string | Filter by email address |
nic | string | Filter by identity (NIC) number |
package_id | integer | Filter by package |
salesperson_id | integer | Filter by salesperson |
profile_status | integer | Filter by profile status |
connection_status | integer | Filter by connection status (online/offline) |
connection_type | integer | Filter by connection type |
sms_status | integer | Filter by SMS status |
mac_lock | integer | Filter by MAC lock flag |
nas_id | integer | Filter by NAS/router |
static_ip | string | Filter by static IP |
mac_address | string | Filter by MAC address |
limit | integer | Max number of records to return |
offset | integer | Number of records to skip (used with limit) |
Success Response (200 OK):
Returns a JSON array of subscriber objects:
json
[
{
"isp_id": "1",
"id": "1024",
"photo": "",
"name": "John Doe",
"username": "john123",
"portal_pass": "e10adc3949ba59abbe56e057f20f883e",
"mobile_number": "01710000000",
"phone_number": "",
"nic_number": "1990123456789",
"email_address": "[email protected]",
"address": "123 Main St",
"profile_status": "1",
"expired_status": 0,
"sms_status": "1",
"mac_lock": "0",
"package_id": "5",
"salesperson_id": "3",
"connection_type_id": "1",
"nas_id": "2",
"static_ip": "",
"mac_address": "",
"connection_status": "1",
"discount": "0",
"area_id": "12",
"subarea_id": "34",
"city_id": "7",
"latitude": "23.8103",
"longitude": "90.4125",
"total_bandwidth": "0",
"used_bandwidth": "0",
"activation_date": "2026-01-01 10:00:00",
"renew_date": "2026-06-01 10:00:00",
"current_expiration_date": "2026-07-01 10:00:00",
"join_date": "2025-12-20",
"area_data": {
"city": { "id": "7", "name": "Dhaka" },
"area": { "id": "12", "name": "Gulshan" },
"subarea": { "id": "34", "name": "Gulshan-1" }
}
}
]INFO
The response includes many additional network/installation fields (box number, uplink port, fiber code/color, switch board/port, cable type, session counters, timestamps, etc.). Fields with no value are returned empty.
cURL Example:
bash
curl -X GET "https://your-domain.com/api/user/users?package_id=5&limit=50" \
-u "your_api_username:your_api_password" \
-H "Accept: application/json"Create or Update a Subscriber ​
A single POST endpoint handles both creating and updating, selected by the post_type field.
| Property | Value |
|---|---|
| Endpoint | Create / Update Subscriber |
| Method | POST |
| URL | /api/user/users |
| Authentication | Basic Auth |
Request Headers:
| Header | Value | Required |
|---|---|---|
Authorization | Basic {credentials} | Yes |
Accept | application/json | Yes |
Content-Type | application/x-www-form-urlencoded | Yes |
Control Field:
| Parameter | Type | Required | Description |
|---|---|---|---|
post_type | integer | Yes | 1 = create a new subscriber, 2 = update an existing subscriber |
post_type = 1 — Create ​
Required Fields:
| Parameter | Type | Description |
|---|---|---|
isp_id | integer | ISP identifier |
name | string | Subscriber's full name |
username | string | Login username (must be unique) |
password | string | Login password |
package_id | integer | Package to assign |
connection_type_id | integer | Connection type |
salesperson_id | integer | Salesperson |
nas_id | integer | NAS / router |
nic_number | numeric | Identity number (must be unique) |
mobile_number | numeric | Mobile number (must be unique) |
Optional Fields:
| Parameter | Type | Description |
|---|---|---|
phone_number | numeric | Phone number (unique if provided) |
email | string | Email address (valid & unique if provided) |
address | string | Street address |
city_id | integer | City |
area_id | integer | Area |
subarea_id | integer | Sub-area |
latitude | string | Latitude |
longitude | string | Longitude |
box_number | string | Box number |
box_address | string | Box address |
uplink_port | string | Uplink port |
fiber_code | string | Fiber code |
fiber_color | string | Fiber color |
switch_board | string | Switch board |
switch_port | string | Switch port |
backup_connection | string | Backup connection |
electricity_socket | string | Electricity socket |
cable_type | string | Cable type |
Defaults applied on create
New subscribers are created with status = 1, sms_status = 1, mac_lock = 0, and connection_status = 0 (not yet connected). The portal password is derived from password.
Success Response (200 OK):
json
{
"success": "User Successfully Added."
}post_type = 2 — Update ​
Updates the subscriber identified by username. The username itself is used as the key and is not changed by this call. The same required fields as create apply (except uniqueness checks now ignore the target subscriber's own record).
| Parameter | Type | Required | Description |
|---|---|---|---|
username | string | Yes | Username of the subscriber to update (must exist) |
Success Response (200 OK):
json
{
"success": "User Successfully Updated."
}Error Response (400 Bad Request) ​
Validation failures return the messages joined into a single string:
json
{
"error": "The Name field is required. Username Already Exists!"
}cURL Example (create):
bash
curl -X POST "https://your-domain.com/api/user/users" \
-u "your_api_username:your_api_password" \
-H "Accept: application/json" \
-d "post_type=1" \
-d "isp_id=1" \
-d "name=John Doe" \
-d "username=john123" \
-d "password=Secret123" \
-d "package_id=5" \
-d "connection_type_id=1" \
-d "salesperson_id=3" \
-d "nas_id=2" \
-d "nic_number=1990123456789" \
-d "mobile_number=01710000000"cURL Example (update):
bash
curl -X POST "https://your-domain.com/api/user/users" \
-u "your_api_username:your_api_password" \
-H "Accept: application/json" \
-d "post_type=2" \
-d "username=john123" \
-d "isp_id=1" \
-d "name=John A. Doe" \
-d "password=Secret123" \
-d "package_id=6" \
-d "connection_type_id=1" \
-d "salesperson_id=3" \
-d "nas_id=2" \
-d "nic_number=1990123456789" \
-d "mobile_number=01710000000"Activation endpoint (reserved)
An POST /api/user/activation route exists but is reserved for future use and is not functional in the current release. Do not integrate against it yet.
