I'm trying to create a new contact through google people api + PHP (Server-to-server) using the code below and the code apparently runs without errors, but no contacts are created at: https://www.google.com/contacts/
Querying the contacts as described here (https://developers.google.com/people/quickstart/php#step_3_set_up_the_sample) I see that the contact was created.
I use Google App Suite.
Is there anything wrong with my code?
<?php
require $_SERVER['DOCUMENT_ROOT'].'/../vendor/autoload.php';
$client = new Google_Client();
$client->setAuthConfig('my configs...');
$client->addScope(Google_Service_PeopleService::CONTACTS);
$service = new Google_Service_PeopleService($client);
$person = new Google_Service_PeopleService_Person();
$email = new Google_Service_PeopleService_EmailAddress();
$email->setValue('[email protected]');
$person->setEmailAddresses($email);
$name = new Google_Service_PeopleService_Name();
$name->setDisplayName('User de Test');
$person->setNames($name);
$exe = $service->people->createContact($person);
print_r($exe);
Is there anything wrong with my code?You tell us. Is the script working? any errors? what's wrong with it? - Latheesan