I have Tried and below is my code i don't know what went wrong
$http({
method: 'POST',
headers:'{"gqlQuery": {"queryString": "select * from culture" }}',
url: 'https://datastore.googleapis.com/v1/projects/nammaooru-3630e:runQuery?fields=batch%2Cquery&key=[myapikey]'
}).then(function successCallback(response) {
alert("Success"+response);
// this callback will be called asynchronously
// when the response is available
}, function errorCallback(response) {
alert("Error"+response);
// called asynchronously if an error occurs
// or server returns response with an error status.
});
Got Error in angular Request**
https://datastore.googleapis.com/v1/projects/nammaooru-3630e:runQuery?fields=batch%2Cquery&key=[apikey]
Failed to load resource: the server responded with a status of 401 ()
Got Error while trying in Postman
URL : https://datastore.googleapis.com/v1/projects/nammaooru-3630e:runQuery?fields=batch%2Cquery&key=[apikey]
Method : POST
{
"error": {
"code": 401,
"message": "The request does not have valid authentication credentials.",
"status": "UNAUTHENTICATED"
}
}
But I got out put response from Google Developer site
https://cloud.google.com/datastore/docs/reference/rest/v1/projects/runQuery#http-request
{
"batch": {
"entityResultType": "FULL",
"entityResults": [
{
"entity": {
"key": {
"partitionId": {
"projectId": "nammaooru-3630e"
},
"path": [
{
"kind": "culture",
"id": "5629499534213120"
}
]
},
"properties": {
"types": {
"stringValue": "",
"excludeFromIndexes": true
},
"images": {
"stringValue": "",
"excludeFromIndexes": true
},
"bname": {
"stringValue": "Kangeyam Kalai"
},
"date": {
"timestampValue": "2017-01-14T12:44:56.933Z"
},
"title": {
"stringValue": ""
},
"description": {
"stringValue": "Coimbatore Kongu nadu region",
"excludeFromIndexes": true
}
}
},
"cursor": "Ci8SKWoRc35uYW1tYW9vcnUtMzYzMGVyFAsSB2N1bHR1cmUYgICAgICAgAoMGAAgAA==",
"version": "1484398012256000"
}
],
"endCursor": "Ci8SKWoRc35uYW1tYW9vcnUtMzYzMGVyFAsSB2N1bHR1cmUYgICAgICAgAoMGAAgAA==",
"moreResults": "NO_MORE_RESULTS"
},
"query": {
"kind": [
{
"name": "culture"
}
]
}
}
--disable-web-security and restart the chrome by run below command in window "Run":
chrome --allow-file-access-from-files --disable-web-security --user-data-dir
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With