[英]How to Create new Contact using People API with multiple values
我想创建包含多个电子邮件和电话号码的新联系人
我尝试使用一个电子邮件和电话号码,这是我正在使用的代码
$name = new Google_Service_PeopleService_Name();
$name->setGivenName('00nirman');
$name->setFamilyName('weerasinghe');
$person->setNames($name);
$email1 = new Google_Service_PeopleService_EmailAddress();
$email1->setValue('test@example.com');
$person->setEmailAddresses($email1);
$phone1 = new Google_Service_PeopleService_PhoneNumber();
$phone1->setValue('0777677305');
$phone1->setType('home');
$person->setPhoneNumbers($phone1);
$exe = $people_service->people->createContact($person)->execute;
可以有人帮我修改代码来推送多个值我已经实现了很多谷歌文档,但我不能很好的方式在PHP中做
Parogrock谢谢你的回答
$phone1 = new Google_Service_PeopleService_PhoneNumber();
$phone2 = new Google_Service_PeopleService_PhoneNumber();
$phone1->setValue('0777677305');
$phone2->setValue('0774112128');
$person->setPhoneNumbers([$phone1,$phone2]);
$exe = $people_service->people->createContact($person)->execute;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.