96 lines
		
	
	
		
			2.5 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			96 lines
		
	
	
		
			2.5 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
 | 
						|
require_once 'SASConnector.php';
 | 
						|
 | 
						|
$api = new SASConnector('172.16.12.108', 'admin', 'admin');
 | 
						|
$api->login();
 | 
						|
 | 
						|
 | 
						|
$res = $api->put('profile/31', [
 | 
						|
    "name" => "testprofiletest",
 | 
						|
    "enabled" => 1,
 | 
						|
    "price" => "12.22222",
 | 
						|
    "available_ucp" => 1,
 | 
						|
    "downrate" => 12,
 | 
						|
    "uprate" => 12,
 | 
						|
    "type" => 0,
 | 
						|
    "extension_allowed_profiles" => [],
 | 
						|
    "description" => null,
 | 
						|
    "vat" => "0.00",
 | 
						|
    "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" => "03:00",
 | 
						|
    "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
 | 
						|
//)
 | 
						|
 |