-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to resolve 403 forbidden issue when trying to use Google Android Play API (androidpublisher.reviews.list) to get android app reviews #1688
Comments
Please share a code sample demonstrating the issue (with identifying information redacted) and authentication scopes used. |
Hello @jdpedrie Thank you for your reply! I have attached code with both method like "Auth with access token (AuthWithAccessToken.php)" and "Auth with private key (AuthWithPrivateKey.php)" scope I used for get app review : https://www.googleapis.com/auth/androidpublisher Description:
AuthWithPrivateKey.php
I used both method and try to get app reviews but every time it returns : |
Are you able to access the reviews using a manually-generated access token? Try it, it'll show us whether the issue is in your auth flow or further downstream.
Execute the following code, replacing the dummy access token with the token you generated: <?php
require_once __DIR__ . '/vendor/autoload.php';
session_start();
date_default_timezone_set('America/Los_Angeles');
$SCOPES = array(
'https://www.googleapis.com/auth/androidpublisher',
);
$client = new Google_Client();
$client->setScopes($SCOPES);
// Put your access token here.
$client->setAccessToken('ACCESS TOKEN');
try {
$review = new Google_Service_AndroidPublisher($client);
$opt_param = array();
$reviews = $review->reviews->listReviews('PackageName', $opt_param);
}
catch (exception $e) {
echo '<pre>';
print_r($e->getMessage());
exit;
} |
Hello @jdpedrie I followed what you suggest and generate access token on OAuth 2.0 Playground and copy token and set in my code but have same error occur. Steps screenshots: Thanks |
HI..make sure ,you have updated the billing information ,if you have created GCP project. |
@ankitsakhareliya Did you get a chance to follow the advise made by @myboopathiraja ? |
I think there is a mistake in how to create an service account. https://play.google.com/apps/publish/#ApiAccessPlace For your reference. |
Greetings, we're closing this. Looks like the issue got resolved. Please let us know if the issue needs to be reopened. |
When I try to get my app reviews by following Google Android Play API with owner access, it shows me an exception "You do not have permission to execute this method." every time.
Google AIP explorer https://developers.google.com/apis-explorer/?hl=en_US#p/androidpublisher/v3/androidpublisher.reviews.list (Exception: https://prnt.sc/oqjbto)
PHP Google-API library https://github.com/googleapis/google-api-php-client (Exception: http://prntscr.com/oqjc2g)
Please post your suggestion here, If anyone resolved that type of issue
Thank you!
The text was updated successfully, but these errors were encountered: