Skip to main content

User Edit

This service is used to edit internal users.

Parameters

DescriptionDefined DataSample DataRequired[**]/Optional[*]Parameters
Extension ID obtained through search service-603b41443e14270c550bf15a**id_
User active/inactive statusyes/noyes*active
User Name-Test User*name
Extension Number-530*number
--530*cid_number
Password-530*secret
Call Recordingyes/nono*call_record
-yes/nono*push_notification
Denied IPs-0.0.0.0/0.0.0.0*deny
Allowed IPs-0.0.0.0/0.0.0.0*permit
DTMF Protocol-rfc2833*dtmfmode
-yes/nono*canreinvite
-yes/nono*directmedia
--main_routing*context
--dynamic*host
-User/Peer/Frienduser*type
-yes/no/Force Report & Co-Mediano*nat
--5060*port
-yes/nono*qualify
--1*callgroup
--1*pickupgroup
-yes/nono*callcounter
-yes/nono*faxdetect
---*call_limit
-yes/nono*trunk
-yes/nono*transfer
---email
--571forward_policy->Busy
--09158315762forward_policy->No Answer
--570forward_policy->UnAvailable
--2121...

Sample Invocation

Show Full Source Code PHP


<?php
$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => 'http://192.168.51.20/api/v4/pbx/users/update',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"_id":"6033876dc92de036d1390923",
"user_type":"SIP",
"active":"yes",
"name":"Test User",
"number":"999",
"cid_number":"999",
"secret":"999",
"call_record":"no",
"push_notification":"no",
"deny":"0.0.0.0/0.0.0.0",
"permit":"0.0.0.0/0.0.0.0",
"dtmfmode":"rfc2833",
"canreinvite":"no",
"directmedia":"no",
"context":"main_routing",
"host":"dynamic",
"type":"user",
"nat":"no",
"port":"5060",
"qualify":"no",
"callgroup":"1",
"pickupgroup":"1",
"callcounter":"no",
"faxdetect":"no",
"call_limit":"",
"trunk":"no",
"transfer":"no",
"email":"",
"forward_policy":{"Busy":"571","No Answer":"093411452671","UnAvailable":"588","All":"2020"},
"more_options":""
}',
CURLOPT_HTTPHEADER => array(
'X-APIKEY: vZKtIKWsld0egNlkzHo8i5LVBqLNBSWARCQsPOSgDjFmAHM3tG',
'Authorization: Basic dGVzdDpBYTEyMzQ1Ng==',
'Content-Type: application/json'
),
));

$response = curl_exec($curl);

if (!curl_errno($curl)) {
$httpcode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
echo 'response code:'.$httpcode, '<br/>';
}

curl_close($curl);
echo $response;