Contact Search
از این سرویس برای جستجو مخاطبین استفاده میشود.
#
پارامترهاتوضیحات | داده های تعریف شده | داده های نمونه | پارامترهای ضروری[**]/منطقی[*] | پارامترها |
---|---|---|---|---|
یافتن موارد مشابه | yes/no | true | ** | alike |
نام مخاطب | - | - | conditions->name | |
توضیحات | - | - | conditions->description | |
- | - | - | conditions->status | |
- | - | 20 | pagination->start | |
- | - | 0 | pagination->count | |
- | - | {} | pagination->sorting |
#
نمونه خروجی درخواست{ "success": 1, "message": "", "data": { "pagination": { "start": 0, "count": 20, "sorting": { "name": 1 }, "total": 1 }, "data": [ { "_id": "60461561095d840c2e477098", "name": "test_contact", "number": "112233", "description": "Just for test", "date": "1399-12-18 15:45:29" } ] }}
#
نمونه فراخوانی- PHP
- JS
- Linux
<?php
$curl = curl_init();
curl_setopt_array($curl, array( CURLOPT_URL => "http://192.168.51.21//api/v3/autodialer/contacts", 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 =>"{\r\n \"alike\":\"true\",\r\n \"conditions\":{\"name\":\"\",\"number\":\"\",\"description\":\"\"},\r\n \"pagination\":{\"start\":0,\"count\":20,\"sorting\":{}}\r\n}", 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;
<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.21//api/v3/autodialer/contacts", "method": "GET", "timeout": 0, "headers": { "X-APIKEY": "vZKtIKWsld0egNlkzHo8i5LVBqLNBSWARCQsPOSgDjFmAHM3tG", "Authorization": "Basic dGVzdDpBYTEyMzQ1Ng==", "Content-Type": "application/json" }, "data": JSON.stringify({ "alike": "true", "conditions": { "name": "", "number": "", "description": "" }, "pagination": { "start": 0, "count": 20, "sorting": {} } }), };
$.ajax(settings).always(function (jqXHR) { console.log("response code: " + jqXHR.status + " " + jqXHR.statusText); console.log("response body: " + jqXHR.responseText); }); </script> </body></html>
curl --location --request GET 'http://192.168.51.21//api/v3/autodialer/contacts' \--header 'X-APIKEY: vZKtIKWsld0egNlkzHo8i5LVBqLNBSWARCQsPOSgDjFmAHM3tG' \--header 'Authorization: Basic dGVzdDpBYTEyMzQ1Ng==' \--header 'Content-Type: application/json' \--data-raw '{ "alike":"true", "conditions":{"name":"","number":"","description":""}, "pagination":{"start":0,"count":20,"sorting":{}}}'