I wanted to create a web service like feature that would provide me the JSON response from the google analytics, i plan to do some processing on the GA data and then output the response to the user who would have requested for my service.
I selected PHP as my language and used google-api-php-client from google and now since i don't want to authorize every time to get Token, i thought of using Service account with which i would directly use keys.
I downloaded the sample code from Google changed client ID and Service Account Name and Key location.
But then this Error Came
Catchable fatal error: Argument 3 passed to Google_HostedmodelsServiceResource::predict()
must be an instance of Google_Input, none given, called in /var/www/webservice/GA/serviceanalytics.php
on line 62 and defined in /var/www/webservice/GA/google-api-php-client/src/contrib/Google_PredictionService.php on line 36
I found that the second argument that example is passing should have been the third argument.
So what should be the second argument. A little insight or a working code will be appreciated :)
Thanks