Skip to content

Subscribers (Users) API ​

Base URL: https://your-domain.com

Endpoints for reading, creating and updating subscriber (user) accounts.

All requests require HTTP Basic Authentication.

MethodEndpointDescription
GET/api/user/usersFetch subscribers (with filters)
POST/api/user/usersCreate 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.

PropertyValue
EndpointFetch Subscribers
MethodGET
URL/api/user/users
AuthenticationBasic Auth

Request Headers:

HeaderValueRequired
AuthorizationBasic {credentials}Yes
Acceptapplication/jsonYes

Query Parameters (all optional):

ParameterTypeDescription
user_idintegerFilter by subscriber ID
usernamestringFilter by username
mobilestringFilter by mobile number
phonestringFilter by phone number
emailstringFilter by email address
nicstringFilter by identity (NIC) number
package_idintegerFilter by package
salesperson_idintegerFilter by salesperson
profile_statusintegerFilter by profile status
connection_statusintegerFilter by connection status (online/offline)
connection_typeintegerFilter by connection type
sms_statusintegerFilter by SMS status
mac_lockintegerFilter by MAC lock flag
nas_idintegerFilter by NAS/router
static_ipstringFilter by static IP
mac_addressstringFilter by MAC address
limitintegerMax number of records to return
offsetintegerNumber 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.

PropertyValue
EndpointCreate / Update Subscriber
MethodPOST
URL/api/user/users
AuthenticationBasic Auth

Request Headers:

HeaderValueRequired
AuthorizationBasic {credentials}Yes
Acceptapplication/jsonYes
Content-Typeapplication/x-www-form-urlencodedYes

Control Field:

ParameterTypeRequiredDescription
post_typeintegerYes1 = create a new subscriber, 2 = update an existing subscriber

post_type = 1 — Create ​

Required Fields:

ParameterTypeDescription
isp_idintegerISP identifier
namestringSubscriber's full name
usernamestringLogin username (must be unique)
passwordstringLogin password
package_idintegerPackage to assign
connection_type_idintegerConnection type
salesperson_idintegerSalesperson
nas_idintegerNAS / router
nic_numbernumericIdentity number (must be unique)
mobile_numbernumericMobile number (must be unique)

Optional Fields:

ParameterTypeDescription
phone_numbernumericPhone number (unique if provided)
emailstringEmail address (valid & unique if provided)
addressstringStreet address
city_idintegerCity
area_idintegerArea
subarea_idintegerSub-area
latitudestringLatitude
longitudestringLongitude
box_numberstringBox number
box_addressstringBox address
uplink_portstringUplink port
fiber_codestringFiber code
fiber_colorstringFiber color
switch_boardstringSwitch board
switch_portstringSwitch port
backup_connectionstringBackup connection
electricity_socketstringElectricity socket
cable_typestringCable 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).

ParameterTypeRequiredDescription
usernamestringYesUsername 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.

www.onezeroart.com