Php 无法更新特定联系人的google联系人数据
我无法更新谷歌联系人中的联系人。似乎缺少一些授权 调用GET时出错 (403)许可不足Php 无法更新特定联系人的google联系人数据,php,codeigniter,google-api-php-client,google-contacts-api,Php,Codeigniter,Google Api Php Client,Google Contacts Api,我无法更新谷歌联系人中的联系人。似乎缺少一些授权 调用GET时出错 (403)许可不足 请告诉我我需要做什么来解决这个问题。上面的代码只是一个摘录。如果需要,请向我索取更多代码。谢谢。我使用了此链接:-你能帮我吗-谢谢你删除$t变量附近的引号。我使用了此链接:-你能帮我吗-谢谢你删除$t变量附近的引号。 foreach($contacts['feed']['entry'] as $contact){ $return[] = array(
请告诉我我需要做什么来解决这个问题。上面的代码只是一个摘录。如果需要,请向我索取更多代码。谢谢。我使用了此链接:-你能帮我吗-谢谢你删除
$t
变量附近的引号。我使用了此链接:-你能帮我吗-谢谢你删除$t
变量附近的引号。
foreach($contacts['feed']['entry'] as $contact){
$return[] = array(
'id'=>$contact['id']['$t'],
'name' => $contact['title']['$t'],
'phone' => isset($contact['gd$phoneNumber'][0]['$t']) ? $contact['gd$phoneNumber'][0]['$t'] :false,
);
}
$count = -1;
$contactId;
foreach($return as $value) {
$count++;
if ((strcmp($value['name'], $checkname) == 0) && (strcmp($value['phone'], $oldphone) == 0)) {
$contactid=$value['id'];
}
}
/* The code with problem starts here:*/
$service = new Google_Service_Mirror($client);
$updatedContact = $service->contacts->get($contactId);
$updatedContact->setDisplayName($putname);
$updatedContact->setPhoneNumber($newphone);
return $service->contacts->update($contactId, $updatedContact);
/*The code with problem ends here:*/