google-cloud-node: Not access data from Google Play

When requesting files from the bucket “pubsite_prod_rev_ххххх” answer is always “Forbidden” (status code 403). Example code:

var gcloud = require('gcloud');
var storage = gcloud.storage({
    projectId: '1xxxxxxxx',
    keyFilename: './json_api_key.json'
});

var bucket = storage.bucket("pubsite_prod_rev_1xxxxxxxxx");

bucket.getFiles({
    prefix: "reviews"
}, function (err, files, nextQuery, apiResponse) {
    if (nextQuery) {
        // nextQuery will be non-null if there are more results.
        bucket.getFiles(nextQuery, function (err, files, nextQ, apiResponse) {
        });
    }
    if(files == null) { // always Forbidden
        console.log(err.message); 
    }else{
        console.log(files);
    }
});

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 63 (29 by maintainers)

Commits related to this issue

Most upvoted comments

I’m afraid to jinx it, but seems it works. Why I didn’t think about that? 😃

@beshkenadze : Any chance you can try adding your service account as a user in the Play Devconsole? That is, in the JSON keyfile you’ll see an e-mail address… Can you try adding that e-mail to the list of users authorized to your Play account?