Chúng tôi đang cố gắng truy cập dữ liệu từ máy chủ của Five9 bằng cách sử dụng API báo cáo đó. Chúng tôi đã viết mã dưới đây nhưng không nhận được bất kỳ kết quả nào. Đối với tôi, có vẻ như vấn đề là với máy chủ của Authentication to Five9. Vui lòng kiểm tra giúp chúng tôi hiểu cách chúng tôi có thể lấy dữ liệu cho một chiến dịch cụ thể trong khoảng thời gian thường xuyên và lưu trữ dữ liệu đó trong Kho dữ liệu.API của Five9: Cách kéo báo cáo bằng API SOAP và Xác thực cơ bản
<?php
$soapUser = "USERNAME"; // username
$soapPassword = "DEMOPASSWORD"; // password
$soap_options = array('login' => $soapUser, 'password' => $soapPassword);
$auth_details = base64_encode($soapUser.":".$soapPassword);
$client = new SoapClient("https://api.five9.com/wsadmin/v2/AdminWebService?wsdl", $soap_options);
$header = new SoapHeader("https://api.five9.com/wsadmin/v2/AdminWebService/getCallLogReport", "authentication", "Basic $auth_details");
//echo "Response:\n" . $client->__getLastResponse() . "\n";
$client->__setSoapHeaders($header);
$xml_data = '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://service.admin.ws.five9.com/v2/AdminWebService/getCallLogReport">
<soapenv:Header/>
<soapenv:Body>
<v2:getCallLogReport>
<campaigns>Campaign1</campaigns>
</v2:getCallLogReport>
</soapenv:Body>
</soapenv:Envelope>';
echo $result = $client->getCallLogReport($xml_data, "https://api.five9.com/wsadmin/v2/AdminWebService?wsdl", "https://api.five9.com/wsadmin/v2/AdminWebService/getCallLogReport",0);
?>
mẫu XML
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v2="http://service.admin.ws.five9.com/v2/">
<soapenv:Header/>
<soapenv:Body>
<v2:getCallLogReport>
<!--Optional:-->
<time>
<!--Optional:-->
<end>?</end>
<!--Optional:-->
<start>?</start>
</time>
<!--Optional:-->
<criteria>
<!--Optional:-->
<ANI>?</ANI>
<!--Zero or more repetitions:-->
<agents>?</agents>
<!--Zero or more repetitions:-->
<callTypes>?</callTypes>
<!--Zero or more repetitions:-->
<campaigns>?</campaigns>
<!--Optional:-->
<DNIS>?</DNIS>
<!--Zero or more repetitions:-->
<dispositions>?</dispositions>
<!--Zero or more repetitions:-->
<lists>?</lists>
<!--Zero or more repetitions:-->
<skillGroups>?</skillGroups>
</criteria>
</v2:getCallLogReport>
</soapenv:Body>
</soapenv:Envelope>