簡體   English   中英

如何使用具有多個值的People API創建新聯系人

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM