Skip to content

Subscriber ​

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

Subscriber-specific endpoints for mobile app. All endpoints require subscriber authentication.


Subscriber Profile ​

Get the authenticated subscriber's basic profile information.

PropertyValue
EndpointSubscriber Profile
MethodGET
URL/api/v1/subscriber/profile
AuthenticationBearer Token (Subscriber)

Request Headers:

HeaderValueRequired
Acceptapplication/jsonYes
AuthorizationBearer subscriber-tokenYes

Request Body: None

Success Response (200 OK):

json
{
    "success": true,
    "data": {
        "id": 1,
        "username": "subscriber1",
        "fullname": "John Doe",
        "email": "[email protected]",
        "phone": "01712345678",
        "address": "123 Main Street, Dhaka",
        "package_id": 1,
        "package_name": "10MB Package",
        "expiration_date": "2025-12-31 23:59:59",
        "status": "active",
        "balance": 500.00,
        "created_at": "2024-01-15 10:30:00"
    }
}

Error Response (401 Unauthorized):

json
{
    "success": false,
    "message": "Unauthenticated"
}

Code Examples:

bash
curl -X GET "https://your-domain.com/api/v1/subscriber/profile" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer your-auth-token"
php
<?php

require 'vendor/autoload.php';

use GuzzleHttp\Client;

$client = new Client(['base_uri' => 'https://your-domain.com']);

$response = $client->request('GET', '/api/v1/subscriber/profile', [
    'headers' => [
        'Accept'        => 'application/json',
        'Authorization' => 'Bearer your-auth-token',
    ],
]);

$data = json_decode($response->getBody(), true);
print_r($data);
javascript
const BASE_URL = 'https://your-domain.com';
const TOKEN = 'your-auth-token';

const response = await fetch(`${BASE_URL}/api/v1/subscriber/profile`, {
  method: 'GET',
  headers: {
    Accept: 'application/json',
    Authorization: `Bearer ${TOKEN}`,
  },
});

const data = await response.json();
console.log(data);
python
import requests

BASE_URL = "https://your-domain.com"
TOKEN = "your-auth-token"

response = requests.get(
    f"{BASE_URL}/api/v1/subscriber/profile",
    headers={
        "Accept": "application/json",
        "Authorization": f"Bearer {TOKEN}",
    },
)

data = response.json()
print(data)
go
package main

import (
	"fmt"
	"io"
	"net/http"
)

const baseURL = "https://your-domain.com"
const token = "your-auth-token"

func main() {
	endpoint := baseURL + "/api/v1/subscriber/profile"

	req, _ := http.NewRequest("GET", endpoint, nil)
	req.Header.Set("Accept", "application/json")
	req.Header.Set("Authorization", "Bearer "+token)

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()

	body, _ := io.ReadAll(resp.Body)
	fmt.Println(resp.StatusCode, string(body))
}
rust
use reqwest::Client;

const BASE_URL: &str = "https://your-domain.com";
const TOKEN: &str = "your-auth-token";

#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
    let client = Client::new();

    let response = client
        .get(format!("{BASE_URL}/api/v1/subscriber/profile"))
        .header("Accept", "application/json")
        .bearer_auth(TOKEN)
        .send()
        .await?;

    let data: serde_json::Value = response.json().await?;
    println!("{data:#}");
    Ok(())
}

Subscriber Profile Details (Mobile App) ​

Get comprehensive subscriber profile details including package info, usage statistics, and account status for mobile app display.

PropertyValue
EndpointSubscriber Profile Details
MethodGET
URL/api/v1/subscriber/profile-details
AuthenticationBearer Token (Subscriber)

Request Headers:

HeaderValueRequired
Acceptapplication/jsonYes
AuthorizationBearer subscriber-tokenYes

Request Body: None

Success Response (200 OK):

json
{
    "success": true,
    "data": {
        "subscriber": {
            "id": 1,
            "username": "subscriber1",
            "fullname": "John Doe",
            "email": "[email protected]",
            "phone": "01712345678",
            "address": "123 Main Street, Dhaka",
            "identity": "1234567890",
            "status": "active"
        },
        "package": {
            "id": 1,
            "name": "10MB Package",
            "price": 1000,
            "validity_days": 30,
            "bandwidth_up": "10M",
            "bandwidth_down": "10M"
        },
        "subscription": {
            "expiration_date": "2025-12-31 23:59:59",
            "days_remaining": 30,
            "is_expired": false
        },
        "balance": 500.00,
        "usage": {
            "total_download": "15.5 GB",
            "total_upload": "2.3 GB",
            "session_count": 45
        },
        "isp": {
            "name": "Your ISP Name",
            "logo": "https://your-domain.com/logo.png",
            "support_phone": "01700000000"
        }
    }
}

Error Response (401 Unauthorized):

json
{
    "success": false,
    "message": "Unauthenticated"
}

Code Examples:

bash
curl -X GET "https://your-domain.com/api/v1/subscriber/profile-details" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer your-auth-token"
php
<?php

require 'vendor/autoload.php';

use GuzzleHttp\Client;

$client = new Client(['base_uri' => 'https://your-domain.com']);

$response = $client->request('GET', '/api/v1/subscriber/profile-details', [
    'headers' => [
        'Accept'        => 'application/json',
        'Authorization' => 'Bearer your-auth-token',
    ],
]);

$data = json_decode($response->getBody(), true);
print_r($data);
javascript
const BASE_URL = 'https://your-domain.com';
const TOKEN = 'your-auth-token';

const response = await fetch(`${BASE_URL}/api/v1/subscriber/profile-details`, {
  method: 'GET',
  headers: {
    Accept: 'application/json',
    Authorization: `Bearer ${TOKEN}`,
  },
});

const data = await response.json();
console.log(data);
python
import requests

BASE_URL = "https://your-domain.com"
TOKEN = "your-auth-token"

response = requests.get(
    f"{BASE_URL}/api/v1/subscriber/profile-details",
    headers={
        "Accept": "application/json",
        "Authorization": f"Bearer {TOKEN}",
    },
)

data = response.json()
print(data)
go
package main

import (
	"fmt"
	"io"
	"net/http"
)

const baseURL = "https://your-domain.com"
const token = "your-auth-token"

func main() {
	endpoint := baseURL + "/api/v1/subscriber/profile-details"

	req, _ := http.NewRequest("GET", endpoint, nil)
	req.Header.Set("Accept", "application/json")
	req.Header.Set("Authorization", "Bearer "+token)

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()

	body, _ := io.ReadAll(resp.Body)
	fmt.Println(resp.StatusCode, string(body))
}
rust
use reqwest::Client;

const BASE_URL: &str = "https://your-domain.com";
const TOKEN: &str = "your-auth-token";

#[tokio::main]
async fn main() -> Result<(), reqwest::Error> {
    let client = Client::new();

    let response = client
        .get(format!("{BASE_URL}/api/v1/subscriber/profile-details"))
        .header("Accept", "application/json")
        .bearer_auth(TOKEN)
        .send()
        .await?;

    let data: serde_json::Value = response.json().await?;
    println!("{data:#}");
    Ok(())
}

www.onezeroart.com