Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to get Google Business Location Attribute Details #2540

Open
snehupadhyay2012 opened this issue Dec 22, 2023 · 3 comments
Open

Not able to get Google Business Location Attribute Details #2540

snehupadhyay2012 opened this issue Dec 22, 2023 · 3 comments
Assignees
Labels
api: mybusiness Issues related to the MyBusiness API

Comments

@snehupadhyay2012
Copy link

Hello Team,
We are using google/apiclient( v2.15.1 ), And i want to get the location attributes so i am using Resource Location and calling the getAttributes function as per documentation. But i am getting below error.

{ "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.rpc.BadRequest", "fieldViolations": [ { "field": "read_mask", "description": "Field is required" } ] } ] } }

But even if i pass read_mask optional param i am getting error.

unknown parameter: 'readMask'

But when i am calling HTTP API : https://mybusinessbusinessinformation.googleapis.com/v1/locations/5544303602100449194/attributes
i am getting the response. Please look into this issue.

@saranshdhingra saranshdhingra self-assigned this Dec 27, 2023
@saranshdhingra saranshdhingra added the api: mybusiness Issues related to the MyBusiness API label Dec 27, 2023
@saranshdhingra
Copy link
Contributor

Hi @snehupadhyay2012
Could you please share the code that you are using?

Thanks.

@snehupadhyay2012
Copy link
Author

Hi @saranshdhingra

<?php 
include_once __DIR__ . '/../util.php';

$my_business_info = new Google_Service_MyBusinessBusinessInformation($client);
$storeAttrInfo = $my_business_info->locations->getAttributes($_GET['store_id']);

When i run this above code i am getting below fatal error.

Fatal error: Uncaught Google\Service\Exception: { "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.rpc.BadRequest", "fieldViolations": [ { "field": "read_mask", "description": "Field is required" } ] } ] } } in /var/www/html/node_web_services/vendor/google/apiclient/src/Http/REST.php:134 Stack trace: #0 /var/www/html/node_web_services/vendor/google/apiclient/src/Http/REST.php(107): Google\Http\REST::decodeHttpResponse() #1 [internal function]: Google\Http\REST::doExecute() #2 /var/www/html/node_web_services/vendor/google/apiclient/src/Task/Runner.php(187): call_user_func_array() #3 /var/www/html/node_web_services/vendor/google/apiclient/src/Http/REST.php(66): Google\Task\Runner->run() #4 /var/www/html/node_web_services/vendor/google/apiclient/src/Client.php(926): Google\Http\REST::execute() #5 /var/www/html/node_web_services/vendor/google/apiclient/src/Service/Resource.php(238): Google\Client->execute() #6 /var/www/html/node_web_services/vendor/google/apiclient-services/src/MyBusinessBusinessInformation/Resource/Locations.php(80): Google\Service\Resource->call() #7 /var/www/html/node_web_services/store/edit.php(8): Google\Service\MyBusinessBusinessInformation\Resource\Locations->getAttributes() #8 {main} thrown in /var/www/html/node_web_services/vendor/google/apiclient/src/Http/REST.php on line 134

And when i am passing read_mask field like i was doing while fetching store.

<?php 
include_once __DIR__ . '/../util.php';

$my_business_info = new Google_Service_MyBusinessBusinessInformation($client);
$storeAttrInfo = $my_business_info->locations->getAttributes($_GET['store_id'],["readMask"=>[]]);

It is again throwing below error.
Fatal error: Uncaught Google\Exception: (getAttributes) unknown parameter: 'readMask' in /var/www/html/node_web_services/vendor/google/apiclient/src/Service/Resource.php:155 Stack trace: #0 /var/www/html/node_web_services/vendor/google/apiclient-services/src/MyBusinessBusinessInformation/Resource/Locations.php(80): Google\Service\Resource->call() #1 /var/www/html/node_web_services/store/edit.php(7): Google\Service\MyBusinessBusinessInformation\Resource\Locations->getAttributes() #2 {main} thrown in /var/www/html/node_web_services/vendor/google/apiclient/src/Service/Resource.php on line 155

@shivgautam
Copy link

@saranshdhingra - Any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: mybusiness Issues related to the MyBusiness API
Projects
None yet
Development

No branches or pull requests

4 participants