Reputation: 547
using REST Reference in node js Google cloud store I got this error in the postman i got the following error. URL: https://datastore.googleapis.com/v1/projects/{projectId}:allocateIds Requset Body:
{
"keys": [
{
"partitionId": {
"namespaceId": "default",
"projectId": "superb-watch-172816"
},
"path": [
{
"kind": "User50records"
}
]
}
]}
I got this error:
{
"error": {
"code": 401,
"message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.",
"status": "UNAUTHENTICATED"
}
}
Upvotes: 0
Views: 100
Reputation: 38389
Truly anonymous calls to Cloud Datastore aren't allowed. You must identify yourself to the server in some manner. The bare minimum is attaching an API key, which is basically a claim that you are associated with some project or other. If you're accessing data that is not publicly viewable by anyone, you'll also need to provide some sort of authentication, which is usually done via OAuth.
So, minimum amount of work, assuming this is public data: get an API key, and then append a "key=myKey" query parameter to your URL.
Auth guide: https://cloud.google.com/docs/authentication/
Upvotes: 1