Standard API parameters

The following query parameters can be used with all methods and all resources in the Cloud Spanner API.

NOTES (on auth tokens):

  1. You must send an authorization token with every request that requires an OAuth scope. OAuth 2.0 is the only supported authorization protocol.
  2. You can provide an OAuth 2.0 token with any request in one of two ways:
    • Using the access_token query parameter like this: ?access_token=oauth2-token
    • Using the HTTP Authorization header like this: Authorization: Bearer oauth2-token

All parameters are optional except where noted.

Parameter Meaning Notes
access_token OAuth 2.0 token for the current user.
callback Callback function.
  • Name of the JavaScript callback function that handles the response.
  • Used in JavaScript JSON-P requests.
fields Selector specifying a subset of fields to include in the response.
  • For more information, see the partial response documentation.
  • Use for better performance.

Returns response with indentations and line breaks.

  • Returns the response in a human-readable format if true.
  • Default value: true.
  • When this is false, it can reduce the response payload size, which might lead to better performance in some environments.

Performance tips

We strongly recommend using the client libraries for workloads that involve relatively high queries per second, relatively small requests or responses, and where you are concerned about latency or throughput. The libraries have substantially lower overhead than REST or JSON because they are built on top of the gRPC interfaces. There are cases where using the REST API makes sense, and you want to optimize for fewer bytes transferred or smaller JSON responses. In those cases, you can use many of the performance tips for Cloud Storage.