google-api-php-client-services icon indicating copy to clipboard operation
google-api-php-client-services copied to clipboard

Method: verificationTokens.generate missing in MyBusinessVerifications

Open nekromoff opened this issue 1 year ago • 1 comments

Environment details

  • OS: Linux
  • PHP version: 8.2
  • Package name and version: 2.7.2

Steps to reproduce

1.Try calling generate tokens function;

Code example

$this->gbp_verifications = new Google_Service_MyBusinessVerifications($client);
dd($this->gbp_verifications->verificationTokens->generate($locations[0]));
dd($this->gbp_verifications->verification_tokens->generate($locations[0]));

Missing method in the base class:

  +batchPath: "batch"
  +rootUrl: "https://mybusinessverifications.googleapis.com/"
  +version: "v1"
  +servicePath: ""
  +serviceName: "mybusinessverifications"
  +availableScopes: null
  +resource: null
  -client: Google\Client {[#252 ▶](http://localhost/#sf-dump-2002073845-ref2252)}
  +locations: Google\Service\MyBusinessVerifications\Resource\Locations {#294 ▶}
  +locations_verifications: Google\Service\MyBusinessVerifications\Resource\LocationsVerifications {#293 ▼
    -stackParameters: array:10 [▶]
    -rootUrl: "https://mybusinessverifications.googleapis.com/"
    -client: Google\Client {[#252 ▶](http://localhost#sf-dump-2002073845-ref2252)}
    -serviceName: "mybusinessverifications"
    -servicePath: ""
    -resourceName: "verifications"
    -methods: array:2 [▼
      "complete" => array:3 [▶]
      "list" => array:3 [▶]
    ]
  }
}

nekromoff avatar Nov 22 '23 14:11 nekromoff

This class misses the API method: https://github.com/googleapis/google-api-php-client-services/blob/3bd53a6929d663b523da375b63cae6ac27207fc8/src/MyBusinessVerifications.php#L4

nekromoff avatar Nov 22 '23 14:11 nekromoff

Hello, thank you for filing an issue. The issue you're having is that the generate method which is found below is not available in the MyBusinessVerifications client as you'd expect.

https://github.com/googleapis/google-api-php-client-services/blob/8e22b0a6f661f2db3f99abb6ee5a1dcf28d370e7/src/MyBusinessVerifications/Resource/VerificationTokens.php#L44

If you look at the MyBusinessVerification's discovery API, which documents all the methods, you can see that the generate method no longer exists. This means that the API has removed that method, which is why this client library reflects that.

My guess is that now the tokens must be generated by a vetted partner, as per the API documentation.

Either way, this client library is accurate according to the linked discovery document, from which it's generated, so there's nothing we can do. You can try creating the VerificationTokens class manually and using that to generate a token, but I don't recommend it, as even if you can get it to work, that API may be turned off at any time.

Good luck!

bshaffer avatar May 20 '24 18:05 bshaffer

Yeah, well, the library is accurate now, it wasn't accurate last December. The rest is the fact as per info from Google support mentioned here: https://stackoverflow.com/questions/77547716/verificationtokens-generate-method-for-google-business-profiles-throws-404/77605450#77605450

On Mon, May 20, 2024 at 8:02 PM Brent Shaffer @.***> wrote:

Hello, thank you for filing an issue. The issue you're having is that the generate method which is found below is not available https://github.com/googleapis/google-api-php-client-services/blob/main/src/MyBusinessVerifications.php#L52 in the MyBusinessVerifications client as you'd expect.

https://github.com/googleapis/google-api-php-client-services/blob/8e22b0a6f661f2db3f99abb6ee5a1dcf28d370e7/src/MyBusinessVerifications/Resource/VerificationTokens.php#L44

If you look at the MyBusinessVerification's discovery API https://mybusinessverifications.googleapis.com/$discovery/rest?version=v1, which documents all the methods, you can see that the generate method no longer exists. This means that the API has removed that method, which is why this client library reflects that.

My guess is that now the tokens must be generated by a vetted partner https://support.google.com/business/answer/9199701?visit_id=638518246561086381-2543264289&rd=1, as per the API documentation https://developers.google.com/my-business/reference/verifications/rpc/google.mybusiness.verifications.v1 .

Either way, this client library is accurate according to the linked discovery document, from which it's generated, so there's nothing we can do. You can try creating the VerificationTokens class manually and using that to generate a token, but I don't recommend it, as even if you can get it to work, that API may be turned off at any time.

Good luck!

— Reply to this email directly, view it on GitHub https://github.com/googleapis/google-api-php-client-services/issues/3822#issuecomment-2120938148, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACBHPTNXZ4I52GEOOLMSWY3ZDI3BRAVCNFSM6AAAAAA7WL23DWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMRQHEZTQMJUHA . You are receiving this because you authored the thread.Message ID: @.*** com>

nekromoff avatar May 20 '24 18:05 nekromoff

This library is updated from the official API daily, with releases taking place every Monday morning. So there is a maximum of a one week delay from releasing any changes in the API.

Thanks for providing the link as confirmation.

bshaffer avatar May 20 '24 19:05 bshaffer