1
votes

Currently I'm testing Google Cloud Datastore in php environment with the Google App Engine Launcher (version 1.8.8) on Windows 8.1. I'm using the google-api-php-client from GitHub (https://github.com/google/google-api-php-client) to authenticate and call the service.

The intent is to test the code locally with calls to remote services

If I try to insert data into the datastore through the classes provided by the client the operation is successful.

But if I try to do the same thing with a lookup call, I get the following error (Google_Service_Exception at google-api-php-client/src/Google/Http/REST.php on line 75):

Error calling POST https://www.googleapis.com/datastore/v1beta2/datasets/TESTAPP/lookup: (400) app s~TESTAPP cannot access app TESTAPP's data

If inserting data is done correctly, is not an authentication problem; So, where am I wrong?

(Sorry for my English)

3
The library is updated and the code is visible here - Damiano Mologni

3 Answers

2
votes

It looks like you are using the wrong dataset_id in the keys of the lookup request. You should leave the key.partition_id.dataset_id unset (or better yet, leave all of key.partition_id unset).

1
votes

It would be helpful if you post your code :)

The most obvious thing to check for is that you are using the correct app id. You can get the app id from the developer's console.

Also make sure that you pull the up to date PHP client source from GIT. There have been some fixes in the last couple of days.

-1
votes

You must manually edit the library code and write code which will remove s~ from the AppId. This shouldn't be there and this is why your code fails. You could write to google that they have a bug in library too.