我们正在尝试使用报告 API 从 Five9 的服务器访问数据。我们在下面编写了代码,但没有得到任何结果。对我来说,问题似乎与对 Five9 服务器的身份验证有关。请检查帮助我们了解如何定期提取特定活动的数据并将其存储在数据仓库中。
<?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);
?>
示例 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>