Google Sync "Contacts API" turned down since Jannuary 19, 2022. We have to switch to "Pepole API"
Contacts sync between Vtiger and Google, no longer seems to work due to contacts API being "turned down":
The Contacts API was turned down on January 19, 2022. Use this guide to learn about changes to fields, endpoints, and authorization scopes as you migrate to the People API.
See: https://developers.google.com/people/contacts-api-migration
To be able to see the error, message, you have to print the response from the google api in Google_Contacts_Connector::pullGroups
, because vtiger just doesn't handle error responses from the api (it assumes no errors occurred):
/**
* Function to pull contact groups for user
* @param <Boolean> $onlyIds
* @return <Array>
*/
public function pullGroups($onlyIds = FALSE) {
//max-results: If you want to receive all of the groups, rather than only the default maximum.
$query = array(
'alt' => 'json',
'max-results' => 1000,
);
if($this->apiConnection->isTokenExpired()) $this->apiConnection->refreshToken();
$headers = array(
'GData-Version' => $this->apiVersion,
'Authorization' => $this->apiConnection->token['access_token']['token_type'] . ' ' .
$this->apiConnection->token['access_token']['access_token']
);
$response = $this->fireRequest(self::CONTACTS_GROUP_URI, $headers,$query,'GET');
var_dump($response);
echo '<pre>';
print_r($response);
echo '</pre>';
$decoded_resp = json_decode($response,true);
$feed = $decoded_resp['feed'];
$entries = $feed['entry'];
$groups = array(
'title' => $feed['title']['$t']
);
if(is_array($entries)) {
foreach($entries as $entry) {
$group = array(
'id' => $entry['id']['$t'],
'title' => $entry['title']['$t']
);
if($onlyIds) $group = $group['id'];
$groups['entry'][] = $group;
}
}
return $groups;
}
Then go to the google sync config setup page in index.php?module=Contacts&parent=Settings&view=Extension&extensionModule=Google&extensionView=Index&mode=settings
to see the error.
See #1084 for related issues.