PHP - How to update/delete contact (google People) With PHP
19:12 18 Jun 2018

for 3 days i'm frustated because google not have tutorial for php. (sorry for my bad english)

i got an error while updating names :

$client=client_google();
$google_id="people/c3062123412341234";

if ($client->getAccessToken() == "") return null;

$people_service = new Google_Service_PeopleService($client);
$person = new Google_Service_PeopleService_Person();

if($tipenya == "Cancel"){
    $name = new Google_Service_PeopleService_Name();
    $name->SetFamilyName("Keluarga Cemara");
    $name->SetGivenName("Tampan");
    $person->setNames($name);

       $profile = $people_service->people->get(
          $google_id, 
          array('personFields' => 'metadata'));

    $etag = $profile->etag;
    $person->setEtag($etag);
    $person->setResourceName($google_id);

       if($google_id !=''){
       //$people_service->people->updatePersonField("names");
       $people_service->people->updateContact($google_id,$person);
        }

    }else if($tipenya=="Delete"){
       if($google_id !=''){
       $person->setResourceName($google_id);
       $people_service->people->deleteContact($person);
       }

    }

Error when i execute:

exception 'Google_Service_Exception' with message '{ "error": { "code": 400, "message": "updatePersonFields mask is required. Please specify one or more valid paths. Valid paths are documented at https://developers.google.com/people/api/rest/v1/people/update.", "errors": [ { "message": "updatePersonFields mask is required. Please specify one or more valid paths. Valid paths are documented at https://developers.google.com/people/api/rest/v1/people/update.", "domain": "global", "reason": "badRequest" } ], "status": "INVALID_ARGUMENT" }}'

php google-api google-people-api