API : Plan

Plan API


Get Plans list

POST /api/plan/list

Input Parameters Required ? Description
userid Y CRM Login User's numerical ID value
api_key Y api_key for the above Userid
ispid N ISP ID
resellerid N Reseller ID
id N Plan ID
name N Plan Name. Partial text accepted
protocol N Protocol. Allowed values: PPPoE, IPoE, LeasedLine
connectivity N Connectivity. Allowed values: Wireless, Fibre, Hotspot
plan_period N Plan Period. Numerical value only.
plan_period_unit N Plan Period Unit. Allowed values: Day, Month
lc N Locatoin code
slc N Sub Locatoin code
enabled N Is Enabled? Allowed values: Y, N
data_carryover N Is Data Carry over? Allowed values: Y, N
hide_bw_limit N Is Bandwidth limit is disabled? Allowed values: Y, N
bw_mgmt N Bandwidth Management. Allowed values: Radius, NAS IP Pool
bw1_gb N Usage Limit (in GB) on BW Level 1. Accepted Comparison Operators, like: <50, ≤10, ≥80, =100, etc.
bw1_pool N Bandwidth 1: NAS IP Pool ID
bw2_pool N Bandwidth 2: NAS IP Pool ID
bw3_pool N Bandwidth 3: NAS IP Pool ID
created_from N Created from date in yyyy-mm-dd format
created_upto N Created upto date in yyyy-mm-dd format
rows_limit N Limit the number of records in result set. Default: 10, Max value: 100
rows_offset N Fetch records from this offset position. Default: 0
sort_field N Sorts the result. Sort field should be any one of: id, name, protocol, connectivity, lc, slc, limit1_gb, bw1_dl, bw1_ul. Default: id
sort_order N Sort order. Allowed values are: asc, desc. Default: asc
show_count N Shows Records Count only, instead of detailed results. This will ignore rows_limit, rows_offset. Allowed values are: 0, 1. Default: 0

Typical API Call

curl -X POST $BASE_URL/api/plan/list -d userid=5 -d api_key="0f9895fb407c83e5ea128082098b47681aa75d6944576423c4" -d plan_period=1 -d plan_period_unit="Month"


Create Plan

POST /api/plan/create

Input Parameters Required ? Description
userid Y CRM Login User's numerical ID value
api_key Y api_key for the above Userid
ispid N ISP ID. Optional, If above Login userid belongs to an ISP, otherwise Required.
resellerid N Reseller ID. Optional, If above Login userid belongs to a Reseller, otherwise Required.
name Y Plan Name
protocol Y Protocol. Allowed values: PPPoE, IPoE, LeasedLine. Multiple values can be set with comma seperated.
connectivity Y Connectivity. Allowed values: Wireless, Fibre. Multiple values can be set with comma seperated.
plan_period Y Plan Period. Numerical value only.
plan_period_unit Y Plan Period Unit. Allowed values: Day, Month
lc N Locatoin code
slc N Sub Locatoin code
enabled N Enable this plan. Default: Y. Allowed values: Y, N
data_carryover N Data Carry over. Default: N. Allowed values: Y, N
hide_bw_limit N Bandwidth limit has to be hidden?. Default: N. Allowed values: Y, N
bw_mgmt N Bandwidth Management. Allowed values: Radius, NAS IP Pool
bw1_gb Y Usage Limit (in GB) on BW Level 1
bw2_gb N Usage Limit (in GB) on BW Level 2
bw3_gb N Usage Limit (in GB) on BW Level 3
bw1_dl N BW 1: Download rate in Kbps. Bandwidth's DL & UL rate is mandatory if mw_mgmt=Radius
bw1_ul N BW 1: Upload rate in Kbps
bw2_dl N BW 2: Download rate in Kbps
bw2_ul N BW 2: Upload rate in Kbps
bw3_dl N BW 3: Download rate in Kbps
bw3_ul N BW 3: Upload rate in Kbps
bw1_pool N BW 1: NAS IP Pool ID. Bandwidth's Pool ID is mandatory if mw_mgmt=NAS IP Pool
bw2_pool N BW 2: NAS IP Pool ID
bw3_pool N BW 3: NAS IP Pool ID

Typical API Call

curl -X POST $BASE_URL/api/plan/create -d userid=5 -d api_key="0f9895fb407c83e5ea128082098b47681aa75d6944576423c4" -d name="Test plan" -d resellerid=2 -d protocol="PPPoE" -d connectivity="Fibre" -d plan_period=1 -d plan_period=1 -d plan_period_unit="Month" -d bw_mgmt="Radius" -d bw1_gb=10000 -d bw1_dl=10000 -d bw1_ul=10000

The expected API Response will be

{
    "result": 23,
    "error": null
}

Returns newly created Plan id value, upon success. Upon failure result contains null value, and error contains error description.


Update Plan

POST /api/plan/update

Input Parameters Required ? Description
userid Y CRM Login User's numerical ID value
api_key Y api_key for the above Userid
id Y Plan ID to update
name N Plan Name
protocol N Protocol. Allowed values: PPPoE, IPoE, LeasedLine. Multiple values can be set with comma seperated.
connectivity N Connectivity. Allowed values: Wireless, Fibre. Multiple values can be set with comma seperated.
plan_period N Plan Period. Numerical value only.
plan_period_unit N Plan Period Unit. Allowed values: Day, Month
lc N Locatoin code
slc N Sub Locatoin code
enabled N Enable this plan. Allowed values: Y, N
data_carryover N Data Carry over. Allowed values: Y, N
hide_bw_limit N Bandwidth limit has to be hidden?. Allowed values: Y, N
bw_mgmt N Bandwidth Management. Allowed values: Radius, NAS IP Pool
bw1_gb N Usage Limit (in GB) on BW Level 1
bw2_gb N Usage Limit (in GB) on BW Level 2
bw3_gb N Usage Limit (in GB) on BW Level 3
bw1_dl N BW 1: Download rate in Kbps
bw1_ul N BW 1: Upload rate in Kbps
bw2_dl N BW 2: Download rate in Kbps
bw2_ul N BW 2: Upload rate in Kbps
bw3_dl N BW 3: Download rate in Kbps
bw3_ul N BW 3: Upload rate in Kbps
bw1_pool N BW 1: NAS IP Pool ID
bw2_pool N BW 2: NAS IP Pool ID
bw3_pool N BW 3: NAS IP Pool ID

Typical API Call

curl -X POST $BASE_URL/api/plan/update -d userid=5 -d api_key="0f9895fb407c83e5ea128082098b47681aa75d6944576423c4" -d id=25 -d bw1_gb=1000 -d bw1_dl=50000 -d bw1_ul=50000

{
    "result": "done",
    "error": null
}

Delete Plan

POST /api/plan/delete

Input Parameters Required ? Description
userid Y CRM Login User's numerical ID value
api_key Y api_key for the above Userid
id Y Plan ID to delete

Typical API Call

curl -X POST $BASE_URL/api/plan/delete -d userid=5 -d api_key="0f9895fb407c83e5ea128082098b47681aa75d6944576423c4" -d id=25

{
    "result": "done",
    "error": null
}


Sub Plans List

POST /api/plan/subplan_list

Input Parameters Required ? Description
userid Y CRM Login User's numerical ID value
api_key Y api_key for the above Userid
ispid N ISP ID
resellerid N Reseller ID
planid N Plan ID
id N Sub Plan ID
name N Sub Plan Name. Partial text accepted
portal N Publish to Web Portal? Allowed values: Y, N
price N Plan Price. Accepted Comparison Operators, like: <50, ≤10, ≥80, =100, etc.
created_from N Created from date in yyyy-mm-dd format
created_upto N Created upto date in yyyy-mm-dd format
rows_limit N Limit the number of records in result set. Default: 10, Max value: 100
rows_offset N Fetch records from this offset position. Default: 0
sort_field N Sorts the result. Sort field should be any one of: id, name, planid, units, price. Default: id
sort_order N Sort order. Allowed values are: asc, desc. Default: asc
show_count N Shows Records Count only, instead of detailed results. This will ignore rows_limit, rows_offset. Allowed values are: 0, 1. Default: 0

Typical API Call

curl -X POST $BASE_URL/api/plan/subplan -d userid=5 -d api_key="0f9895fb407c83e5ea128082098b47681aa75d6944576423c4" -d planid=12 -d show_count=1

The typical API Response will be

{
    "result": 3,
    "error": null
}

Create Sub Plan

POST /api/plan/subplan_create

Input Parameters Required ? Description
userid Y CRM Login User's numerical ID value
api_key Y api_key for the above Userid
planid Y Plan ID
name Y Sub Plan Name
units Y Units. It is multiplication factor for Plan Period. Numerical value.
portal N Mark this subplan available in Portal website. Default: N. Allowed values: Y, N
charge1 Y Charge Name 1
amt1 Y Amount for the charge1
charge2 N Charge Name 2. Optional
amt2 N Amount for the charge2. Optional
charge3 N Charge Name 3. Optional
amt3 N Amount for the charge3. Optional

Typical API Call

curl -X POST $BASE_URL/api/plan/subplan_create -d userid=5 -d api_key="0f9895fb407c83e5ea128082098b47681aa75d6944576423c4" -d name="Basic+" -d planid=24 -d units=1 -d charge1="CPE Charges" -d amt1=500 -d charge2="CPE Charges" -d amt2=100

The expected API Response will be

{
    "result": 62,
    "error": null
}

Returns newly created Sub Plan id value, upon success. Upon failure result contains null value, and error contains error description.


Update Sub Plan

POST /api/plan/subplan_update

Input Parameters Required ? Description
userid Y CRM Login User's numerical ID value
api_key Y api_key for the above Userid
id Y Sub Plan ID to update
name N Sub Plan Name
units N Units. It is multiplication factor for Plan Period. Numerical value.
portal N Mark this subplan available in Portal website. Default: N. Allowed values: Y, N
charge1 N Charge Name 1
amt1 N Amount for the charge1
charge2 N Charge Name 2. Optional
amt2 N Amount for the charge2. Optional
charge3 N Charge Name 3. Optional
amt3 N Amount for the charge3. Optional

Typical API Call

curl -X POST $BASE_URL/api/plan/subplan_update -d userid=5 -d api_key="0f9895fb407c83e5ea128082098b47681aa75d6944576423c4" -d id=63 -d units=2 -d amt1=2000

The expected API Response will be

{
    "result": "done",
    "error": null
}

Delete Sub Plan

POST /api/plan/subplan_update

Input Parameters Required ? Description
userid Y CRM Login User's numerical ID value
api_key Y api_key for the above Userid
id N Sub Plan ID to delete.
planid N Sub plans belongs to this Plan ID to delete. Either id or planid is required.

Typical API Call

curl -X POST $BASE_URL/api/plan/subplan_delete-d userid=5 -d api_key="0f9895fb407c83e5ea128082098b47681aa75d6944576423c4" -d id=63

The expected API Response will be

{
    "result": "done",
    "error": null
}