I'm trying to use Google Datastore from PHP App Engine in the Google Cloud environment. The process doesn't appear to be as seamless as Cloud Storage, so instead I'm going to use the Datastore REST API.
There's a place in the docs where you can do a test request to the Datastore API: https://cloud.google.com/datastore/docs/apis/v1beta2/datasets/lookup#try-it
The problem I'm having is that I want to do this without OAuth (there's an option for this at the above link). However, when I do, I get the following error:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "required",
"message": "Login Required",
"locationType": "header",
"location": "Authorization"
}
],
"code": 401,
"message": "Login Required"
}
}
From the request details I see the following HTTP request signature: POST to https://www.googleapis.com/datastore/v1beta2/datasets/MY_PROJECT_ID/lookup?key={YOUR_API_KEY}
.
When I use my Server API key from the Google Cloud "APIs and Auth" Credentials, I get this:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "authError",
"message": "HTTP Basic Authentication is not supported for this API",
"locationType": "header",
"location": "Authorization"
}
],
"code": 401,
"message": "HTTP Basic Authentication is not supported for this API"
}
}
I'm not quite sure what {YOUR_API_KEY} is supposed to be in this case if it's not the server key.
How can I fix this and access the Datastore API without OAuth?
Thanks.