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