我想了解
https://developers.google.com/apis-explorer/#p/datastore/v1beta1/datastore.datasets.blindWrite
但我总是得到
503 Service Unavailable
{
"error": {
"errors": [
{
"domain": "global",
"reason": "backendError",
"message": "Backend Error"
}
],
"code": 503,
"message": "Backend Error"
}
}
你能提供一个尽可能简单的例子我可以粘贴以验证它是否真的有效吗? 我试过这样的事情。
{
"mutation": {
"insertAutoId": [
{
"key": {
"path": [
{
"kind": "person",
"name": "gert"
}
]
}
}
]
}
}
答案 0 :(得分:2)
假设您遵循了documentation中描述的前两个激活流程之一。最近创建了项目 ,App Engine应用程序应该已经与您的项目相关联。
你需要:
Authorize your request using OAuth 2.0
https://www.googleapis.com/auth/userinfo.email
范围https://www.googleapis.com/auth/datastore
Add additional scopes (optional)
Authorize
并授予权限datasetId
参数(与project-id
相同)insert
或upsert
代替insertAutoId
(与姓名或身份相称)。示例:
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
}
}