Database Reference
In-Depth Information
{
"error": {
"errors": [
{
"domain": "global",
"reason": "authError",
"message": "Invalid Credentials",
"locationType": "header",
"location": "Authorization"
}
],
"code": 401,
"message": "Invalid Credentials"
}
}
Here you can see that there is one error on the global domain (which 99.9
percent of error responses will share). The HTTP response code is 401. If
you look that up in the HTTP 1.1 spec, you'll see that it is the code for
Unauthorized
. You shouldn't need to look it up because you can use the
reason
field
authError
, which means that there was an error authorizing
the request.
If you forgot the
Authorization
header entirely, you'll still get an
HTTP
401
response, but you'll get the error
reason
of
required
, a
location
of
Authorization
, and a
locationType
of
header
. This enables you to
know that your request was missing a required field: the
Authorization
header.
Table 5.17
provides a partial list of the HTTP errors that BigQuery can
return.