Get usage report for subscribers

POST p8auth/reports/usage

Example Request

POST /api/v1/p8auth/products HTTP/1.1
Host: tph.io
X-Token: c9c0a840-b5f1-4e0e-84da-e8a4eedfc63b
Content-Type: application/json

{
    "from_date": "2018-04-01",
    "to_date": "2018-04-20",
    "subscriber_ids": [
        1,
        2
    ]
}

Response Structure

  • success: bool
  • messages: string
  • data: array[object]
    • id: int
    • start_date: string("2020-01-01")
    • end_date: string("2020-01-01")
    • customer: string
    • username: string
    • package_name: string
    • in_bundle: string
    • out_bundle: string
    • top_up_use: string
    • total_usage: string
    • total_usage_gb: string
    • total_usage_mb: string

Example Response

{
  "success": true,
  "messages": "Report generated.",
  "data": [
    {
      "id": 1,
      "start_date": "2018-01-01",
      "end_date": "2018-04-20",
      "customer": "Example Customer",
      "username": "3232323232",
      "package_name": "Example APN Product",
      "in_bundle": "1.00GB",
      "out_bundle": "100.00MB",
      "top_up_use": "0.00B",
      "total_usage": "1.10GB",
      "total_usage_gb": "1.09766",
      "total_usage_mb": "1124.00000"
    },
    {
      "id": 2,
      "start_date": "2018-01-01",
      "end_date": "2018-04-20",
      "customer": "Another Example Customer",
      "username": "1212121212",
      "package_name": "Example APN Product",
      "in_bundle": "0.00B",
      "out_bundle": "0.00B",
      "top_up_use": "0.00B",
      "total_usage": "0.00B",
      "total_usage_gb": "0.00000",
      "total_usage_mb": "0.00000"
    }
  ]
}