Reputation: 7175
I am trying to understand
https://developers.google.com/apis-explorer/#p/datastore/v1beta1/datastore.datasets.blindWrite
but I always get
503 Service Unavailable
{
"error": {
"errors": [
{
"domain": "global",
"reason": "backendError",
"message": "Backend Error"
}
],
"code": 503,
"message": "Backend Error"
}
}
Can you provide a example as simple as possible I can paste to verify it actually works? I tried something like this.
{
"mutation": {
"insertAutoId": [
{
"key": {
"path": [
{
"kind": "person",
"name": "gert"
}
]
}
}
]
}
}
Upvotes: 0
Views: 1550
Reputation: 10504
Assuming that you followed one of the first two activation flows described in the documentation. And created the project recently, an App Engine application should be already associated with your project.
You need to:
Authorize your request using OAuth 2.0
https://www.googleapis.com/auth/userinfo.email
scope checkedhttps://www.googleapis.com/auth/datastore
under Add additional scopes (optional)
Authorize
and grant the permissiondatasetId
parameter (same as your project-id
)insert
or upsert
instead of insertAutoId
if the key is complete (kind w/ name or id).Example:
POST https://www.googleapis.com/datastore/v1beta1/datasets/my-dataset-id/blindWrite...
Content-Type: application/json
Authorization: Bearer ...
X-JavaScript-User-Agent: Google APIs Explorer
{
"mutation": {
"insert": [
{
"key": {
"path": [
{
"kind": "Foo",
"name": "iamfoo"
}
]
}
}
]
}
}
200 OK
{
"kind": "datastore#blindWriteResponse",
"mutationResult": {
"indexUpdates": 1
}
}
Upvotes: 2