Before you begin
- Follow the Google Cloud authentication guide to set up your environment.
The BigQuery API uses OAuth 2.0 access tokens to authorize requests. An OAuth 2.0 access token is a string that grants temporary access to an API. Google's OAuth 2.0 server grants access tokens for all Google APIs.
Getting access tokens
Get a temporary access token using Application default credentials.
See the authentication guide to learn how to get an access token in other environments.
Because access tokens provide only temporary authorization, you must periodically refresh them.
To authorize requests to the BigQuery API with an access token, use any of the OAuth 2.0 token usage methods.
Set the token in the
Authorization request header with the value
- To learn how to get an OAuth 2.0 access token programmatically, see the authentication guides.