Reputation: 61
i try to access to BigQuery via the REST API from my webserver by this request for example:
https://www.googleapis.com/bigquery/v2/projects/project%3Aid/queries?fields=rows&key={YOUR_API_KEY}
As {YOUR_API_KEY} I use the API key for server apps from the Google API Console but I get a "401 Unauthorized"
What's the right way to do this request from a server without user interaction for authentication?
Upvotes: 6
Views: 6056
Reputation: 7877
Google BigQuery does not support access via API key authorization. Instead, you should be using the OAuth flow that matches what you are trying to do with your application. See the BigQuery Authorization documentation here.
Upvotes: 5
Reputation: 6588
Without knowing anything about your implementation language I can only point you towards the google documentation: https://developers.google.com/bigquery/ which is fairly comprehensive.
Should you be using c# then you can check here on SO Google OAuth2 Service Account Access Token Request gives 'Invalid Request' Response
Upvotes: 0