php-google-my-business icon indicating copy to clipboard operation
php-google-my-business copied to clipboard

Getting error when calling list locations api

Open dhirendralab opened this issue 2 years ago • 0 comments

getting some error when using listAccountsLocations()

$account_txt = "accounts/".$account_id;
$mybusinessService = new Google_Service_MyBusiness($client);
$locations = $mybusinessService->accounts_locations->listAccountsLocations($account_txt); 


{
  "error": {
    "code": 400,
    "message": "Request contains an invalid argument.",
    "errors": [
      {
        "message": "Request contains an invalid argument.",
        "domain": "global",
        "reason": "badRequest"
      }
    ],
    "status": "INVALID_ARGUMENT",
    "details": [
      {
        "@type": "[type.googleapis.com/google.mybusiness.v4.ValidationError](http://type.googleapis.com/google.mybusiness.v4.ValidationError)",
        "errorDetails": [
          {
            "message": "This API will soon be deprecated. Please migrate all the usages to My Business Account Management API - https://developers.google.com/my-business/reference/accountmanagement/rest"
          }
        ]
      }
    ]
  }
}

dhirendralab avatar Jun 13 '22 12:06 dhirendralab