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

unable to get list of questions by location name

Open devsravi opened this issue 1 year ago • 0 comments

PLEASE READ: We are using https://developers.google.com/my-business/reference/qanda/rest/v1/locations.questions/list to get locations questions and answers but every time i am getting error error": { "code": 400, "message": "Request contains an invalid argument." }


<?php

use Google\Service\MyBusinessQA;

public function getLocationsQA($googleClient, $locationName, $nextPageToken = null)
    {
        try {
            $optParams = [
                'pageSize' => 10,
                'pageToken' => $nextPageToken,
            ];
            $service = new MyBusinessQA($googleClient);
            $response = $service->locations_questions->listLocationsQuestions($locationName, $optParams);
            return $response;
        } catch (\Exception $e) {
            Log::warning('Error message: ' . $e->getMessage());
        }
    }

devsravi avatar Sep 09 '24 11:09 devsravi