リストに追加するために Five9 に接続し、Five9 にレコードを送信しようとしました。
私のコードは以下です
$soapUser = "test@sample.com"; // username
$soapPassword = "password"; // 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/AddRecordToList", "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:ser="http://service.admin.ws.five9.com/">
<soapenv:Header />
<soapenv:Body>
<ser:addRecordToList>
<listName>some_list_name</listName>
<listUpdateSettings>
<fieldsMapping>
<columnNumber>1</columnNumber>
<fieldName>number1</fieldName>
<key>true</key>
</fieldsMapping>
<fieldsMapping>
<columnNumber>2</columnNumber>
<fieldName>first_name</fieldName>
<key>false</key>
</fieldsMapping>
<fieldsMapping>
<columnNumber>3</columnNumber>
<fieldName>last_name</fieldName>
<key>false</key>
</fieldsMapping>
<reportEmail>name@example.com</reportEmail>
<separator>,</separator>
<skipHeaderLine>false</skipHeaderLine>
<callNowMode>ANY</callNowMode>
<cleanListBeforeUpdate>false</cleanListBeforeUpdate>
<crmAddMode>ADD_NEW</crmAddMode>
<crmUpdateMode>UPDATE_FIRST</crmUpdateMode>
<listAddMode>ADD_FIRST</listAddMode>
</listUpdateSettings>
<record>
<fields>5551208111</fields>
<fields>John</fields>
<fields>Smith</fields>
</record>
</ser:addRecordToList>
</soapenv:Body>
</soapenv:Envelope>';
echo $client->__doRequest($xml_data, "https://api.five9.com/wsadmin/v2/AdminWebService?wsdl", "https://api.five9.com/wsadmin/v2/AdminWebService/AddRecordToList",0);
リストに追加するには、five9 に接続し、Five9 にレコードを送信するように案内してください。