我想通过 SOAP api 向联系人添加多个电子邮件地址,假设我从我的 php 应用程序注册了一个用户。例如,通过带有 testemail1@test.com 的注册页面,因此这将通过 set entry 和 soap set_entry 调用中的“email1”参数在 name_to_value_list 数组中创建一个新的联系人。
现在假设我更新了我的 php web 应用程序中的帐户信息。并将电子邮件地址更新为 testemail2@test.com ,所以现在,这应该将此新电子邮件地址添加到当前联系人作为主要电子邮件地址并选择退出旧电子邮件地址(因为我们可以添加多个电子邮件地址来唱联系人记录)。
在此处查看示例代码:
$result = $mySoap->call('set_entry', array($session_id, 'module_name'=>'Contacts', array(
array("name" => 'first_name',"value" => $_POST['first_name']),
array("name" => 'last_name',"value" => $_POST['last_name']),
array("name" => 'email1',"value" => $_POST['email_address']), //Emails is suppose testemail1@test.com for first time
array("name" => 'primary_phone_c',"value" => $primary_phone),
array("name" => 'prefered_contact_c',"value" => $_POST['prefered_contact']),
array("name" => 'primary_address_street',"value" => $_POST['address']),
array("name" => 'primary_address_street_2_c',"value" => $_POST['address_2']),
array("name" => 'primary_address_city',"value" => $_POST['address_city']),
array("name" => 'primary_address_state',"value" => $_POST['address_state']),
array("name" => 'primary_address_postalcode',"value" => $_POST['address_postalcode']),
array("name" => 'address_country_c',"value" => $_POST['address_country']),
)));
所以任何示例肥皂电话或任何想法,如我在 set_entry 中使用 email2 字段而不是 email1 或其他?
谢谢,达瓦尔达尔吉