Net Manager API nm.apnanetwork.net/backend/api/v1
GET · docs / overview

API Overview

RESTful API for the Net Manager ISP customer portal.

45
Endpoints
9
Categories
JWT
Auth
v1.0
Version

Response format

Every response follows a consistent envelope:

{
  "success": true,
  "data": { ... },
  "message": "Success message",
  "timestamp": "2026-08-03T10:30:00Z"
}

Authentication

Most endpoints require a bearer token: Authorization: Bearer {access_token}

Sandbox

Base URL: nm.apnanetwork.net/backend/api/v1/sandbox
Test credentials — Customer ID: TEST001, Password: test1234

Conventions for the backend team

Verbs

GET read · POST create/action · PUT full replace · PATCH partial update · DELETE remove. Every path below is relative to the base URL.

Live network data lives under /mikrotik-api

Anything read live from the router (status, traffic, speedtest, diagnostics) is prefixed /mikrotik-api — matching the confirmed sample /mikrotik-api/status. Stored/portal data (billing, tickets, shop, profile) uses its own resource prefix.

Prayer times are external — do not build

The app fetches prayer timings straight from api.aladhan.com. No backend endpoint is required. Proxy it only if you want to hide it behind your own domain.

docs / authentication

Authentication

User authentication and session management.

POST /auth/login User Login

Request Body

{
  "customer_id": "CK2206",
  "password": "user_password"
}

Parameters

ParameterTypeRequiredDescription
customer_idstringRequiredUnique customer identifier
passwordstringRequiredUser password

Success Response (200)

{
  "success": true,
  "data": {
    "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
    "token_type": "Bearer",
    "expires_in": 3600,
    "user": {
      "id": "user_uuid",
      "customer_id": "CK2206",
      "name": "Arif Hossain",
      "email": "arif@example.com",
      "mobile": "01712345678"
    }
  },
  "message": "Login successful"
}

Error Codes

INVALID_CREDENTIALSWrong customer ID or password
ACCOUNT_SUSPENDEDAccount is suspended
ACCOUNT_LOCKEDToo many failed login attempts
POST /auth/logout User Logout

Authentication required

Requires a valid bearer token in the Authorization header.

{
  "success": true,
  "message": "Logged out successfully"
}
POST /auth/refresh Refresh Access Token

Get a new access token using the refresh token when the current one expires.

Request Body

{
  "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
POST /auth/forgot-password Request Password Reset

Request a password reset via SMS to the registered mobile number.

{
  "customer_id": "CK2206"
}
POST /auth/change-password Change Password

Password requirements

At least 8 characters · one uppercase letter · one number

{
  "current_password": "old_password",
  "new_password": "new_password",
  "confirm_password": "new_password"
}
POST /auth/register Sign Up

Create an account. Backs the sign-up mode on the login screen.

Request Body

{
  "customer_id": "CK2206",
  "mobile": "01712345678",
  "password": "user_password"
}

Note

Customer ID is issued by the ISP at installation; sign-up links an app login to an existing subscriber, it does not create a new subscriber.

DELETE /auth/sessions/{session_id} Revoke Session

Sign out a specific device/session. Use current as the id to revoke the calling session (logout).

{
  "success": true,
  "message": "Session revoked"
}
docs / network

Network & Connection

Real-time network status, speed tests, and diagnostics.

GET /mikrotik-api/status Get Connection Status

Real-time data

Returns current connection status including speeds, session info, and usage.

{
  "success": true,
  "data": {
    "status": "online",
    "package": {
      "name": "Premium 50 Mbps",
      "speed": "50 Mbps",
      "price": 800
    },
    "connection": {
      "download_speed": 48.6,
      "upload_speed": 49.1,
      "ping": 12,
      "packet_loss": 0.2
    },
    "session": {
      "public_ip": "103.245.123.45",
      "uptime": "2d 14h 23m"
    }
  }
}
GET /mikrotik-api/traffic/live Live Traffic Sample

Polled ~1×/sec by the app

The home hero and Realtime Traffic screen redraw the download/upload graph continuously. Return the current instantaneous throughput; the client keeps its own rolling 30-sample window. A WebSocket push at /mikrotik-api/traffic/stream is preferred if feasible — it removes the polling load.

Success Response (200)

{
  "success": true,
  "data": {
    "timestamp": "2026-08-03T10:30:12Z",
    "download_mbps": 42.7,
    "upload_mbps": 8.3
  }
}
POST /mikrotik-api/speedtest Run Speed Test

Initiate a speed test. Use the returned test_id to fetch results.

{
  "success": true,
  "data": {
    "test_id": "test_uuid",
    "status": "initiated",
    "estimated_duration": 15
  }
}
POST /mikrotik-api/diagnostics Run Network Diagnostics

Run comprehensive network diagnostic tests (7 checks).

Diagnostic tests include

Router reachability · ISP gateway · DNS resolution · Internet connectivity · Bandwidth test · Packet loss · Network stability

GET /network/usage/monthly Get Monthly Usage

Get monthly data usage statistics with download/upload breakdown.

{
  "success": true,
  "data": {
    "month": "2026-08",
    "download": {
      "amount": 1200,
      "unit": "GB",
      "percentage": 62
    },
    "upload": {
      "amount": 320,
      "unit": "GB",
      "percentage": 28
    }
  }
}
docs / billing

Billing & Payments

Invoice management, payments, and package handling.

GET /billing/invoices Get Invoices List

Query Parameters

ParameterTypeRequiredDescription
statusstringOptionalFilter: all, paid, pending, overdue
pagenumberOptionalPage number (default: 1)
limitnumberOptionalItems per page (default: 20)
POST /billing/payments/initiate Initiate Payment

Initiate payment for one or multiple invoices.

Request Body

{
  "invoice_ids": ["inv_uuid_1", "inv_uuid_2"],
  "payment_method": "bkash",
  "return_url": "https://app.example.com/payment/callback"
}

Supported Payment Methods

bkash · nagad · rocket · card · bank_transfer

GET /billing/packages List Available Packages

All plans the customer can switch to. Powers the Packages / Upgrade screen.

{
  "success": true,
  "data": [
    {
      "package_id": "pkg_uuid_3",
      "name": "Premium 100 Mbps",
      "speed": "100 Mbps",
      "price": 1500,
      "is_current": false,
      "features": ["BDIX", "OTT", "Free installation"]
    }
  ]
}
GET /billing/package/current Get Current Package

Get the user's currently active internet package details.

{
  "success": true,
  "data": {
    "package_id": "pkg_uuid",
    "name": "Premium 50 Mbps",
    "speed": "50 Mbps",
    "price": 800,
    "status": "active",
    "expiry_date": "2026-08-15",
    "days_remaining": 12
  }
}
POST /billing/package/change Request Package Change

Request to upgrade or change the internet package.

{
  "new_package_id": "pkg_uuid_3",
  "effective_date": "immediate"
}
docs / support

Support & Tickets

Customer support ticket system and FAQs.

GET /support/categories Get Ticket Categories

Get the list of support ticket categories with priority and resolution times.

Available categories

No Internet · Billing Issue · Package Change · Relocation · Router Problem · Fiber Problem · Device Issue · Other

POST /support/tickets Create Support Ticket

File upload

Content-Type must be multipart/form-data when attaching files.

Form Data

FieldTypeRequiredDescription
category_idstringRequiredTicket category ID
titlestringRequiredBrief title
descriptionstringRequiredDetailed description
attachmentfileOptionalImage attachment (max 10MB)
GET /support/tickets/{ticket_id} Get Ticket Detail

Get detailed ticket information including full chat history.

Includes

Ticket details · status and priority · complete chat history · assigned engineer info · attachments

POST /support/tickets/{ticket_id}/messages Reply to Ticket

Post a message into the ticket chat thread. multipart/form-data when attaching a file.

{
  "message": "Still no internet after restarting the router.",
  "attachment": "(optional file)"
}
PATCH /support/tickets/{ticket_id} Update Ticket Status

Close or reopen a ticket from the customer side.

{
  "status": "closed"
}

Values

open · closed. Reopening a resolved ticket may be restricted server-side — return TICKET_ALREADY_CLOSED if not allowed.

docs / shop

Shop & Orders

E-commerce for routers, cables, and accessories.

GET /shop/products Get Products List

Get the list of available products with filtering options.

GET /shop/products?category=router&page=1&limit=20
POST /shop/orders Create Order

Request Body

{
  "items": [
    {
      "product_id": "prod_uuid_1",
      "quantity": 1
    }
  ],
  "delivery_details": {
    "full_name": "Arif Hossain",
    "phone": "01712345678",
    "address": "House 23, Road 7, Banani"
  },
  "payment_method": "cod",
  "promo_code": "NET10"
}
POST /shop/promo/validate Validate Promo Code

Validate a promo code and calculate the discount.

{
  "promo_code": "NET10",
  "subtotal": 3100
}
GET /shop/orders Get Order History

Customer's past orders with status. Query: status (all, pending, shipped, delivered, cancelled).

{
  "success": true,
  "data": [
    {
      "order_id": "NM-004821",
      "status": "shipped",
      "total": 4990,
      "placed_at": "2026-07-28T09:12:00Z"
    }
  ]
}
DELETE /shop/orders/{order_id} Cancel Order

Cancel an order that has not yet shipped.

{
  "success": true,
  "message": "Order cancelled"
}

Guard

Return ORDER_CANNOT_BE_CANCELLED if the order is already shipped or delivered.

docs / user

User Management

User profile and photo management.

GET /user/profile Get User Profile

Get the current user's profile information.

{
  "success": true,
  "data": {
    "id": "user_uuid",
    "customer_id": "CK2206",
    "name": "Arif Hossain",
    "email": "arif@example.com",
    "mobile": "01712345678",
    "address": "House 23, Road 7, Banani",
    "zone": "Banani",
    "joining_date": "2024-01-15"
  }
}
PUT /user/profile Update Profile

Update user profile information.

{
  "name": "Arif Hossain",
  "email": "newemail@example.com",
  "mobile": "01712345678",
  "address": "New Address"
}
POST /user/profile/photo Upload Profile Photo

Requirements

Content-Type: multipart/form-data · max file size 5MB · JPG or PNG

docs / notifications

Notifications

Push notifications and announcements.

GET /notifications Get Notifications

Query Parameters

ParameterDescription
typeFilter: all, billing, package, maintenance, promotion
unread_onlyShow only unread notifications (true/false)
PUT /notifications/read-all Mark All as Read

Mark all notifications as read for the current user.

PATCH /notifications/{notification_id} Mark One as Read

Mark a single notification read when the user opens it.

{
  "read": true
}
DELETE /notifications/{notification_id} Delete Notification

Remove a notification from the user's list (swipe-to-dismiss).

{
  "success": true,
  "message": "Notification deleted"
}
GET /announcements Get Announcements

Get system-wide announcements like maintenance notices and promotions.

docs / media

Media Content

Movies, TV series, and tutorials.

GET /media/movies/categories Get Movie Categories

Get the list of movie categories (Action, Drama, Bangla Cinema, etc.).

GET /media/movies/categories/{category_id} Get Movies by Category

Get movies in a specific category with pagination.

GET /media/movies/{movie_id} Get Movie Detail

Get detailed movie information including cast, synopsis, and stream URL.

BDIX cache server

Movies are cached on local BDIX servers for faster streaming within Bangladesh.

GET /media/tv-series Get TV Series

Get the list of TV series with seasons and episodes.

GET /media/tutorials Get Tutorials

Get setup guides and tutorial videos (router setup, Wi-Fi optimization, etc.).

docs / settings

Settings & Preferences

User settings, rewards, and referrals.

GET /settings Get User Settings

Get the user's app settings including notifications, appearance, and prayer times.

{
  "success": true,
  "data": {
    "notifications": {
      "push_enabled": true,
      "billing_alerts": true
    },
    "appearance": {
      "language": "en",
      "dark_mode": false,
      "primary_color": "#862BAE"
    }
  }
}
PATCH /settings Update Settings

Persist a settings change. Send only the keys that changed — language toggle, dark mode, notification switches, or the brand colour picker.

{
  "appearance": {
    "language": "bn",
    "primary_color": "#862BAE"
  },
  "notifications": {
    "billing_alerts": false
  }
}
GET /rewards Get Reward Balance

Current points balance and whether today's spin is still available. Read on app open to render the daily-reward card.

{
  "success": true,
  "data": {
    "points_balance": 240,
    "spin_available": true,
    "last_spin_date": "2026-08-02"
  }
}
GET /referrals Get Referral Info

Get the user's referral code, stats, and earnings.

Referral program

Earn ৳200 for each successful referral when they activate a monthly package.

POST /rewards/daily/spin Spin Daily Reward

Spin the daily reward wheel to earn points (once per day).

tools / health-check

API Health Check

Probe every read-only endpoint in one click. Fires GET requests only — never POST, PUT, PATCH, or DELETE — so it is safe to run against live.

docs / errors

Error Codes Reference

Complete list of API error codes and their meanings.

Authentication Errors
INVALID_CREDENTIALSWrong customer ID or password
ACCOUNT_SUSPENDEDAccount is suspended
ACCOUNT_LOCKEDToo many failed login attempts
TOKEN_EXPIREDAccess token has expired, use refresh token
TOKEN_INVALIDInvalid or malformed token
UNAUTHORIZEDAuthentication required
Validation Errors
VALIDATION_ERRORRequest validation failed
MISSING_REQUIRED_FIELDRequired field missing from request
INVALID_FORMATInvalid data format
INVALID_VALUEInvalid field value
Payment Errors
PAYMENT_FAILEDPayment transaction failed
INSUFFICIENT_BALANCEInsufficient wallet balance
PAYMENT_GATEWAY_ERRORPayment gateway error
INVALID_PAYMENT_METHODPayment method not supported
Business Logic Errors
INVOICE_ALREADY_PAIDInvoice has already been paid
PROMO_CODE_INVALIDInvalid or expired promo code
ORDER_CANNOT_BE_CANCELLEDOrder is already shipped or delivered
TICKET_ALREADY_CLOSEDSupport ticket is already closed
System Errors
INTERNAL_SERVER_ERRORInternal server error (500)
SERVICE_UNAVAILABLEService temporarily unavailable (503)
RATE_LIMIT_EXCEEDEDToo many requests, slow down
NOT_FOUNDResource not found (404)

Error Response Format

{
  "success": false,
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable error message",
    "details": {}
  },
  "timestamp": "2026-08-03T10:30:00Z"
}