Giter Site home page Giter Site logo

Comments (3)

saranshdhingra avatar saranshdhingra commented on July 4, 2024

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

Thanks.

from google-api-php-client.

snehupadhyay2012 avatar snehupadhyay2012 commented on July 4, 2024

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

from google-api-php-client.

shivgautam avatar shivgautam commented on July 4, 2024

@saranshdhingra - Any update on this?

from google-api-php-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.