Before you begin
- Follow the Google Cloud authentication guide to set up your environment.
Access tokens
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.
Scopes
Access tokens are associated with a scope, which limits the token's access. Check the complete list of Google API scopes for scopes associated with the BigQuery API.
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.
Authorizing requests
To authorize requests to the BigQuery API with an access token, use any of the OAuth 2.0 token usage methods.
Request header
Set the token in the Authorization
request header with the value
Bearer ACCESS_TOKEN
.
What's next
- To learn how to get an OAuth 2.0 access token programmatically, see the authentication guides.