Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/design-patterns/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 无法更新特定联系人的google联系人数据_Php_Codeigniter_Google Api Php Client_Google Contacts Api - Fatal编程技术网

Php 无法更新特定联系人的google联系人数据

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(

我无法更新谷歌联系人中的联系人。似乎缺少一些授权

调用GET时出错 (403)许可不足


请告诉我我需要做什么来解决这个问题。上面的代码只是一个摘录。如果需要,请向我索取更多代码。谢谢。

我使用了此链接:-你能帮我吗-谢谢你删除
$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:*/