182 lines
		
	
	
		
			5.4 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			182 lines
		
	
	
		
			5.4 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
 | 
						|
require_once 'SASConnector.php';
 | 
						|
 | 
						|
$api = new SASConnector('172.16.12.108', 'admin', 'admin');
 | 
						|
$api->login();
 | 
						|
 | 
						|
 | 
						|
$res = $api->post('profile', [
 | 
						|
    "name" => "test profile",
 | 
						|
    "enabled" => 1,
 | 
						|
    "price" => "20.000",
 | 
						|
    "available_ucp" => 1,
 | 
						|
    "downrate" => "1",
 | 
						|
    "uprate" => "1",
 | 
						|
    "type" => 0,
 | 
						|
    "extension_allowed_profiles" => [],
 | 
						|
    "description" => null,
 | 
						|
    "vat" => "0",
 | 
						|
    "limit_expiration" => 0,
 | 
						|
    "expiration_amount" => 0,
 | 
						|
    "expiration_unit" => 1,
 | 
						|
    "limit_uptime" => 0,
 | 
						|
    "uptime_amount" => null,
 | 
						|
    "uptime_unit" => 0,
 | 
						|
    "limit_download" => 0,
 | 
						|
    "download_amount" => null,
 | 
						|
    "limit_upload" => 0,
 | 
						|
    "upload_amount" => null,
 | 
						|
    "limit_traffic" => 0,
 | 
						|
    "traffic_amount" => null,
 | 
						|
    "daily_download_limit" => "0",
 | 
						|
    "daily_upload_limit" => "0",
 | 
						|
    "daily_traffic_limit" => "0",
 | 
						|
    "daily_uptime_limit" => "0",
 | 
						|
    "daily_uptime_unit" => 0,
 | 
						|
    "ippool_mode" => 0,
 | 
						|
    "pool" => null,
 | 
						|
    "sas_ippool_id" => null,
 | 
						|
    "burst_enabled" => 0,
 | 
						|
    "burst_limit_dl" => null,
 | 
						|
    "burst_limit_ul" => null,
 | 
						|
    "burst_threshold_dl" => null,
 | 
						|
    "burst_threshold_ul" => null,
 | 
						|
    "burst_time_dl" => null,
 | 
						|
    "burst_time_ul" => null,
 | 
						|
    "expired_next_profile_id" => null,
 | 
						|
    "quota_next_profile_id" => null,
 | 
						|
    "daily_next_profile_id" => null,
 | 
						|
    "ignore_static_ip" => 0,
 | 
						|
    "private" => 0,
 | 
						|
    "allowed_managers" => [],
 | 
						|
    "allow_submanagers" => 0,
 | 
						|
    "site_id" => null,
 | 
						|
    "allowed_services" => 0,
 | 
						|
    "fixed_expiration_time" => 0,
 | 
						|
    "expiration_time" => null,
 | 
						|
    "debitable" => 0,
 | 
						|
    "no_freezone" => 0,
 | 
						|
    "max_price" => null,
 | 
						|
    "max_ucp_price" => null,
 | 
						|
    "expiration_grace_period" => null,
 | 
						|
    "hotspot_separate_session" => 0,
 | 
						|
    "ignore_pool_on_hotspot" => 0,
 | 
						|
    "mikrotik_addresslist" => null,
 | 
						|
    "mikrotik_queue_priority" => "8",
 | 
						|
    "cisco_qos_policy_in" => 0,
 | 
						|
    "cisco_qos_policy_out" => 0,
 | 
						|
    "monthly" => 0,
 | 
						|
    "monthly_start_day" => "1",
 | 
						|
    "monthly_charge_entire_month" => 0,
 | 
						|
    "carry_over" => 0,
 | 
						|
    "reset_daily_traffic" => 0,
 | 
						|
    "reset_expiration_on_activation" => 0,
 | 
						|
    "quota_addition_date" => 0,
 | 
						|
    "preserve_traffic_counters_expired" => 0,
 | 
						|
    "refundable" => 0,
 | 
						|
    "reward_points_awarded" => "0",
 | 
						|
    "reward_points_allow_activation" => 0,
 | 
						|
    "reward_points_required" => "0",
 | 
						|
    "initial_expiration_amount" => 0,
 | 
						|
    "initial_expiration_unit" => 0,
 | 
						|
    "initial_traffic_amount" => 0,
 | 
						|
    "initial_uptime_amount" => 0,
 | 
						|
    "initial_uptime_unit" => 0
 | 
						|
]);
 | 
						|
 | 
						|
print_r(json_decode($res));
 | 
						|
 | 
						|
 | 
						|
 | 
						|
//this is the expected response
 | 
						|
 | 
						|
//stdClass Object
 | 
						|
//(
 | 
						|
//    [status] => 200
 | 
						|
//    [message] => rsp_success
 | 
						|
//[data] => stdClass Object
 | 
						|
//(
 | 
						|
//    [name] => test profile
 | 
						|
//[enabled] => 1
 | 
						|
//            [price] => 20.000
 | 
						|
//            [available_ucp] => 1
 | 
						|
//            [downrate] => 1
 | 
						|
//            [uprate] => 1
 | 
						|
//            [type] => 0
 | 
						|
//            [description] =>
 | 
						|
//            [vat] => 0
 | 
						|
//            [limit_expiration] => 0
 | 
						|
//            [expiration_amount] => 0
 | 
						|
//            [expiration_unit] => 1
 | 
						|
//            [limit_uptime] => 0
 | 
						|
//            [uptime_amount] =>
 | 
						|
//            [uptime_unit] => 0
 | 
						|
//            [limit_download] => 0
 | 
						|
//            [download_amount] =>
 | 
						|
//            [limit_upload] => 0
 | 
						|
//            [upload_amount] =>
 | 
						|
//            [limit_traffic] => 0
 | 
						|
//            [traffic_amount] =>
 | 
						|
//            [daily_download_limit] => 0
 | 
						|
//            [daily_upload_limit] => 0
 | 
						|
//            [daily_traffic_limit] => 0
 | 
						|
//            [daily_uptime_limit] => 0
 | 
						|
//            [daily_uptime_unit] => 0
 | 
						|
//            [ippool_mode] => 0
 | 
						|
//            [pool] =>
 | 
						|
//            [sas_ippool_id] =>
 | 
						|
//            [burst_enabled] => 0
 | 
						|
//            [burst_limit_dl] =>
 | 
						|
//            [burst_limit_ul] =>
 | 
						|
//            [burst_threshold_dl] =>
 | 
						|
//            [burst_threshold_ul] =>
 | 
						|
//            [burst_time_dl] =>
 | 
						|
//            [burst_time_ul] =>
 | 
						|
//            [expired_next_profile_id] =>
 | 
						|
//            [quota_next_profile_id] =>
 | 
						|
//            [daily_next_profile_id] =>
 | 
						|
//            [ignore_static_ip] => 0
 | 
						|
//            [private] => 0
 | 
						|
//            [allow_submanagers] => 0
 | 
						|
//            [site_id] =>
 | 
						|
//            [allowed_services] => 0
 | 
						|
//            [fixed_expiration_time] => 0
 | 
						|
//            [expiration_time] => 03:00
 | 
						|
//            [debitable] => 0
 | 
						|
//            [no_freezone] => 0
 | 
						|
//            [max_price] =>
 | 
						|
//            [max_ucp_price] =>
 | 
						|
//            [expiration_grace_period] =>
 | 
						|
//            [hotspot_separate_session] => 0
 | 
						|
//            [ignore_pool_on_hotspot] => 0
 | 
						|
//            [mikrotik_addresslist] =>
 | 
						|
//            [mikrotik_queue_priority] => 8
 | 
						|
//            [cisco_qos_policy_in] => 0
 | 
						|
//            [cisco_qos_policy_out] => 0
 | 
						|
//            [monthly] => 0
 | 
						|
//            [monthly_start_day] => 1
 | 
						|
//            [monthly_charge_entire_month] => 0
 | 
						|
//            [carry_over] => 0
 | 
						|
//            [reset_daily_traffic] => 0
 | 
						|
//            [reset_expiration_on_activation] => 0
 | 
						|
//            [quota_addition_date] => 0
 | 
						|
//            [preserve_traffic_counters_expired] => 0
 | 
						|
//            [refundable] => 0
 | 
						|
//            [reward_points_awarded] => 0
 | 
						|
//            [reward_points_allow_activation] => 0
 | 
						|
//            [reward_points_required] => 0
 | 
						|
//            [initial_expiration_amount] => 0
 | 
						|
//            [initial_expiration_unit] => 0
 | 
						|
//            [initial_traffic_amount] => 0
 | 
						|
//            [initial_uptime_amount] => 0
 | 
						|
//            [initial_uptime_unit] => 0
 | 
						|
//            [created_by] => 1
 | 
						|
//            [updated_at] => 2023-07-20 14:50:32
 | 
						|
//            [created_at] => 2023-07-20 14:50:32
 | 
						|
//            [id] => 30
 | 
						|
//        )
 | 
						|
//
 | 
						|
//)
 | 
						|
//
 |