Does anyone have a working example how to update site ownership with the Google API PHP SDK?
I can connect to the API, get the site details, I tried different ways to call the update method but I don't receive even an error message.
The code is something like this:
$service = new Google_Service_SiteVerification($client);
$siteList = $service->webResource->listWebResource();
$siteArray = array();
foreach ($siteList->getItems() as $siteItem)
{
array_push($siteArray, $siteItem);
}
$email_address = "new@email.address";
foreach ($siteArray as $site)
{
$owners = $site->getOwners();
array_push($owners, $email_address);
$site->setOwners($owners);
$reponse = $service->webResource->update($site->id, $site);
print_r($reponse);
}