Appearance
User - Bandwidth Allocations
Base URL:
https://your-domain.com
Admin endpoints for managing bandwidth allocations/profiles. All endpoints require admin/staff authentication.
Fetch All Bandwidth Allocations
Retrieve all bandwidth profiles configured in the system.
| Property | Value |
|---|---|
| Endpoint | Fetch All Bandwidth Allocations |
| Method | GET |
| URL | /api/v1/bandwidth-allocations |
| Authentication | Bearer Token |
Request Headers:
| Header | Value | Required |
|---|---|---|
Accept | application/json | Yes |
Authorization | Bearer your-auth-token | Yes |
Success Response (200 OK):
json
{
"success": true,
"data": [
{
"id": 1,
"name": "50Mbps",
"upload": 50,
"download": 50,
"upload_unit": "M",
"download_unit": "M",
"package_count": 5
}
]
}Fetch Bandwidth Allocation
Retrieve details of a specific bandwidth profile.
| Property | Value |
|---|---|
| Endpoint | Fetch Bandwidth Allocation |
| Method | GET |
| URL | /api/v1/bandwidth-allocations/{id} |
| Authentication | Bearer Token |
Success Response (200 OK):
json
{
"success": true,
"data": {
"id": 1,
"name": "50Mbps",
"upload": 50,
"download": 50,
"upload_unit": "M",
"download_unit": "M"
}
}Create Bandwidth Allocation
Create a new bandwidth profile.
| Property | Value |
|---|---|
| Endpoint | Create Bandwidth Allocation |
| Method | POST |
| URL | /api/v1/bandwidth-allocations |
| Authentication | Bearer Token |
Request Body:
json
{
"isp_id": 1,
"branch_id": 1,
"user_id": 1,
"name": "50Mbps",
"upload": 50,
"download": 50,
"upload_unit": "M",
"download_unit": "M"
}| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Profile name |
upload | integer | Yes | Upload speed value |
download | integer | Yes | Download speed value |
upload_unit | string | Yes | Upload unit (K, M, G) |
download_unit | string | Yes | Download unit (K, M, G) |
Success Response (201 Created):
json
{
"success": true,
"message": "Bandwidth allocation created successfully",
"data": {
"id": 1
}
}Update Bandwidth Allocation
Update an existing bandwidth profile.
| Property | Value |
|---|---|
| Endpoint | Update Bandwidth Allocation |
| Method | PUT |
| URL | /api/v1/bandwidth-allocations/{id} |
| Authentication | Bearer Token |
Request Body:
json
{
"name": "100Mbps",
"upload": 100,
"download": 100
}Success Response (200 OK):
json
{
"success": true,
"message": "Bandwidth allocation updated successfully"
}Delete Bandwidth Allocation
Delete a bandwidth profile.
| Property | Value |
|---|---|
| Endpoint | Delete Bandwidth Allocation |
| Method | DELETE |
| URL | /api/v1/bandwidth-allocations/{id} |
| Authentication | Bearer Token |
Success Response (200 OK):
json
{
"success": true,
"message": "Bandwidth allocation deleted successfully"
}