Skip to content

traffic_plans.php

Traffic tariff plan management module: creation, deletion, updating, and retrieval of available plans with filtering by server or location and price conversion.

API Methods

Method Action Description
list get list of traffic plans Returns a list of traffic plans with optional filtering by location, scope, or active status.

traffic_plans/list

Returns a list of traffic plans with optional filtering by location, scope, or active status.

HTTP Method: POST

Parameters:

Parameter Required Type Description
action string The action to perform (list)
token string Authentication token
id integer ID for specific location filtering
active string Filter by active status (-1 for all, 0 for inactive, 1 for active)
locations string[] Filter by multiple locations (comma-separated or array format)
location string Filter by a single specific location code
scope string Filter by scope

Example Request

curl -s "https://invapi.hostkey.com/traffic_plans.php" -X POST \
--data "action=list" \
--data "token=YOUR_TOKEN" \
--data "locations[]=US" \
--data "locations[]=NL"
Example of a successful response
{
"result": "OK",
"action": "list",
"data": [
{
"id": 1,
"name": "Standard Plan",
"active": 1,
"bandwidth": 100,
"price": {
"USD": 10.0,
"EUR": 9.2
},
"locations": [
"US",
"NL"
],
"dc_location": "Amsterdam"
}
]
}
Failure response
{
"code": -1,
"message": "traffic_plans: action required"
}
question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×