Admob API returns Request is missing required authentication credential

230 views
Skip to first unread message

Hien Mai Nguyen

unread,
May 31, 2021, 2:44:53 AM5/31/21
to AdMob API Developer Forum
Hello,

I am using some sample provided in https://github.com/googleads/googleads-admob-api-samples to call AdMob API. I was using the Python sample, after entering my publisher ID and client_secrets, AdMob returns this error (I censored my publisher ID, so it doesnt show the actual one).

googleapiclient.errors.HttpError: <HttpError 401 when requesting https://admob.googleapis.com/v1/accounts/pub-XXXXXXXXXXXXX/mediationReport:generate?alt=json returned "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.">

May I ask how can I solve this error?

Thank you.

AdMob API Forum Advisor

unread,
Jun 3, 2021, 12:59:36 AM6/3/21
to m...@puzzle.sg, google-admob-api...@googlegroups.com
Hello there,

Thank you for reaching out to the forum. Could you please confirm that the authorization steps were completed? These steps typically include:
  1. From the Google Console Credentials page, click Download JSON next to the client ID and save the file as client_secrets.json in the root directory of the samples.
  2. Open an example and replace the PUBLISHER_ID constant with your Publisher ID.
  3. Run any of the samples.
  4. Click on the link that is generated in the terminal and complete the authorization steps in the browser.
  5. Enter the authorization code in the terminal.
All the best,
Google Logo
Amira Badreldin
AdMob API Team

Help us improve the AdMob API,
please
share your feedback!
 


ref:_00D1U1174p._5004Q2Hz3PH:ref
Reply all
Reply to author
Forward
0 new messages