رفتن به مطلب اصلی
Version: v6.4.0 مرکز‌تماس

Campaign Add

از این سرویس برای افزودن کمپین استفاده می‌شود.

پارامتر‌ها#

توضیحاتداده های تعریف شدهداده های نمونهپارامترهای ضروری[**]/منطقی[*]پارامترها
نام کمپین-test**name
شناسه‌یکتا ترانک که از جستجو بدست می‌آید-5f6c5b56c92de0068f32e592**trunk_manager_id
مقدار context در کامپوننت autodialer route-autointerface_context
مقدار text در کامپوننت autodialer route-text1interface_text
شماره مخاطبین-09212396500*numbers
شناسه‌یکتا گروه که از جستجو بدست می‌آید-"5e96c8c2c92de0468920657e" "5e96d40cc92de025690d0a61"*groups
فاصله زمانی بین هر تلاش-600*try_interval
تعداد تکرار-1*try
زمان شروع کمپین-2021-02-19 15:17*start
زمان پایان کمپین-2021-02-23 15:17*end
شناسه‌یکتا فایل‌صوتی که از جستجو بدست می‌آید-5e5b629ec92de075df7af457*announcement
توضیحات--description

نمونه خروجی درخواست#

{    "success": 1,    "message": "Requested operation is done successfully",    "data": {        "name": "test",        "trunk_manager_id": {            "$oid": "5f6c5b56c92de0068f32e592"        },        "interface_context": "auto",        "interface_text": "text1",        "numbers": [            "09212396500"        ],        "groups": [            "5e96c8c2c92de0468920657e",            "5e96d40cc92de025690d0a61"        ],        "try_interval": "600",        "try": "1",        "start": {            "$date": {                "$numberLong": "1613735220000"            }        },        "end": {            "$date": {                "$numberLong": "1614080820000"            }        },        "announcement": "5e5b629ec92de075df7af457",        "description": "",        "count": 1,        "repeat": 1,        "date": "1399-12-18 14:01:49",        "status": "waiting",        "isoStart": {            "$date": {                "$numberLong": "1613735220000"            }        },        "isoEnd": {            "$date": {                "$numberLong": "1614080820000"            }        }    }}

نمونه فراخوانی#

<?php
$curl = curl_init();
curl_setopt_array($curl, array(  CURLOPT_URL => "http://192.168.51.21//api/v3/autodialer/campaigns",  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 =>"{\r\n    \"name\":\"test\",\r\n    \"trunk_manager_id\":\"5f6c5b56c92de0068f32e592\",\r\n    \"interface_context\":\"auto\",\r\n    \"interface_text\":\"text1\",\r\n    \"numbers\":[\"09212396500\"],\r\n    \"groups\":[\"5e96c8c2c92de0468920657e\",\"5e96d40cc92de025690d0a61\"],\r\n    \"try_interval\":\"600\",\r\n    \"try\":\"1\",\r\n    \"start\":\"2021-02-19 15:17\",\r\n    \"end\":\"2021-02-23 15:17\",\r\n    \"announcement\":\"5e5b629ec92de075df7af457\",\r\n    \"description\":\"\",\r\n    \"count\":3\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;