Search code examples
phpgoogle-api-clientgoogle-my-business-apigoogle-my-business

verificationTokens.generate method for Google Business Profiles throws 404


Calling POST method on https://mybusinessverifications.googleapis.com/v1/verificationTokens:generate with correct Location object in request body gets me:

Client error:
POST https://mybusinessverifications.googleapis.com/v1/verificationTokens:generate
resulted in a 404 Not Found response: 
<!DOCTYPE html> 
<html lang=en> <meta charset=utf-8> <meta name=viewport content="initial-scale=1, minimum-scale=1, w (truncated...)

This URL is correct per: https://developers.google.com/my-business/reference/verifications/rest/v1/verificationTokens/generate

Code (just repeating other requests that work with a different endpoint):

$account = $this->getAccounts('XXXX');
$filter = [];
$filter['store_code'] = 'YYY';
$locations = $this->getLocations($account, $filter);
$location=$locations[0];
$response = $client->authorize()->post('https://mybusinessverifications.googleapis.com/v1/verificationTokens:generate', ['location' => $location]);
dd($response);

Only errors listed in the docs are: Throws PERMISSION_DENIED if the caller is not a vetted partner account. Throws FAILED_PRECONDITION if the caller's VettedStatus is INVALID.

What's going on? Anybody with some experience using this endpoint?


Solution

  • Information from Google Business Profiles Support:

    I have confirmed with our internal team that this method has been removed.

    Sincerely, Shalini

    The Google Business Profile API team