Below is the code that I am using to generate the Admob network report

```
from apiclient.discovery import build
from oauth2client.service_account import ServiceAccountCredentials
import os

base_path=os.path.dirname(os.path.realpath(__file__))
scopes=['https://www.googleapis.com/auth/admob.report']
key_file_location = base_path+'/config/service_account.json'

credentials = ServiceAccountCredentials.from_json_keyfile_name(key_file_location, scopes)

account_id='accounts/pub-XXXXXXXXXXXXXXXX'
network_report_filter = {
  'dateRange': {
    'startDate': {'year': 2020, 'month': 1, 'day': 1},
    'endDate': {'year': 2020, 'month': 2, 'day': 10}
  },
  'dimensions': ['DATE', 'APP', 'COUNTRY'],
  'metrics': ['CLICKS', 'ESTIMATED_EARNINGS'],
  'dimensionFilters': [
    {
      'dimension': 'COUNTRY',
      'matchesAny': {'values': [{'value': 'US', 'value': 'CN'}]}
    }
  ],
  'sortConditions': [
    {'dimension':'APP', 'order': 'ASCENDING'},
    {'metric':'CLICKS', 'order': 'DESCENDING'}
  ],
  'localizationSettings': {
    'currencyCode': 'USD',
    'languageCode': 'en-US'
  }
}

# Build the service object.
admob = build('admob', 'v1', credentials=credentials)

admob._resourceDesc=network_report_filter
accounts=admob.accounts()
network_report=accounts.networkReport().generate(parent=account_id)
data=network_report.execute()

```

It throws the below error

> 
> \*\*\* HttpError: https://admob.googleapis.com/v1/accounts/pub-XXXXXXXXXXXXXXXX/networkReport: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>.">
> 
> 
> 

I have generated the service account credentials with Admob API is enabled.
But not able to figure out why there is authentication error.