我无法通过Google Console api
$client = new Google_Client();
$client->setApplicationName("MyAppName");
$client->setClientId($client_id);
$client->setClientSecret($client_secret);
$client->setAccessType('offline');
$client->setAccessToken($token);
$verificationService = new Google_Service_SiteVerification($client);
$verificationService->webResource->get('https://domain.com');
domain.com
我的域名也是由google api添加的
我收到错误
“您不是此网站的所有者”
答案 0 :(得分:0)
现在我找到了如何按文件验证网站
$service = new Google_Service_SiteVerification($client);
$site = new Google_Service_SiteVerification_SiteVerificationWebResourceResourceSite();
$site->setIdentifier('https://domain.com');
$site->setType('SITE');
$request = new Google_Service_SiteVerification_SiteVerificationWebResourceResource();
$request->setSite($site);
$response = $service->webResource->insert('FILE', $request);
另一个问题。如何查找验证文件名。例如google50c005f8ca59a753.html