Trunk Search
از این سرویس برای جستجو در TrunkManager استفاده میشود.
#
پارامترهاتوضیحات | داده های تعریف شده | داده های نمونه | پارامترهای ضروری[**]/منطقی[*] | پارامترها |
---|---|---|---|---|
یافتن موارد مشابه | true/false | true | ** | alike |
نام مدیریتکننده ترانک | - | autodialer | conditions->title |
#
نمونه خروجی درخواست{ "success": 1, "message": "", "data": [ { "_id": "5ec63107ce4f6d12c43e250f", "title": "autodialer", "trunk_id": { "$oid": "5f19760ace4f6d16dd2e3e0c" }, "status": "active", "active_times": { "1": [ "10", "11", "12", "13", "14", "15", "16", "17", "18", "19" ], "2": [ "10", "11", "12", "13", "14", "15", "16", "17", "18", "19" ], "3": [ "10", "11", "12", "13", "14", "15", "16", "17" ], "4": [ "10", "11", "12", "13", "14", "15", "16", "17", "18", "19" ], "6": [ "10", "11", "12", "13", "14", "15", "16", "17", "18" ], "7": [ "9", "10", "11", "12", "13", "14", "15", "16", "17" ] }, "capacity": "5", "dial_interval": "1", "wait_cache_length": "100", "date": "1399-03-01 12:13:03", "current_capacity": 0, "current_wait_cache_length": 0 } ]}
#
نمونه فراخوانی- PHP
- JS
- Linux
<?php
$curl = curl_init();
curl_setopt_array($curl, array( CURLOPT_URL => 'http://192.168.51.20//api/v3/autodialer/trunks', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'GET', CURLOPT_POSTFIELDS =>'{ "alike":"true", "conditions":{"title":"autodialer"}}', CURLOPT_HTTPHEADER => array( 'X-APIKEY: 9UV0BWKRL83PYIH9Gv1fI85d41lO4S932EeX3wHC47sHjMJOMG', 'Authorization: Basic c2FkcjpTYWRyQDEyMw==', 'Content-Type: application/json' ),));
$response = curl_exec($curl);
curl_close($curl);echo $response;
<html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> </head> <body> <script> var settings = { "url": "http://192.168.51.20//api/v3/autodialer/trunks", "method": "GET", "timeout": 0, "headers": { "X-APIKEY": "9UV0BWKRL83PYIH9Gv1fI85d41lO4S932EeX3wHC47sHjMJOMG", "Authorization": "Basic c2FkcjpTYWRyQDEyMw==", "Content-Type": "application/json" }, "data": JSON.stringify({ "alike": "true", "conditions": { "title": "autodialer" } }), };
$.ajax(settings).done(function (response) { console.log(response); }); </script> </body></html>
curl --location --request GET 'http://192.168.51.20//api/v3/autodialer/trunks' \--header 'X-APIKEY: 9UV0BWKRL83PYIH9Gv1fI85d41lO4S932EeX3wHC47sHjMJOMG' \--header 'Authorization: Basic c2FkcjpTYWRyQDEyMw==' \--header 'Content-Type: application/json' \--data-raw '{ "alike":"true", "conditions":{"title":"autodialer"}}'