I am trying to access the bigquery api using the PHP library, but I always have this error:
Fatal error: throw a "Google_Service_Exception" exception with the message "GET call error https://www.googleapis.com/bigquery/v2/projects/primeval-shadow-571/datasets/Test/tables : (401) Login Required 'in. ..
I have a web application that needs to get some data from a table in bigquery. The remote account is not mine, but it was created by some guy (and I don’t have a login and password to log in), which gave me a file .jsonthat included thoose parameters:
auth_uri,
client_secret,
token_uri,
client_email,
client_x509_cert_url,
client_id and
auth_provider_x509_cert_url.
Here is my PHP code:
<?php
require_once 'Google/Client.php';
require_once 'Google/Service/Bigquery.php';
$client = new Google_Client();
$client->setAuthConfigFile('google-config.json');
$service = new Google_Service_Bigquery($client);
$service->tables->listTables('primeval-shadow-571', 'Test');
But finally, I got the error above.
Can someone tell me where I am going wrong?
P.S. google api , .
.