1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[Python] What Oauth2 scope do I need to access Google Analytics Admin API?

Discussão em 'Python' iniciado por Stack, Setembro 27, 2024 às 19:33.

  1. Stack

    Stack Membro Participativo

    I have an Oauth flow that gets the following scopes: email https://www.googleapis.com/auth/analytics https://www.googleapis.com/auth/analytics.readonly

    However, when I query Google Analytics Admin API:

    from google.analytics.admin import AnalyticsAdminServiceClient
    client = AnalyticsAdminServiceClient(credentials=creds)
    results = client.list_account_summaries()


    I get the following error:


    google.api_core.exceptions.PermissionDenied: 403 Request had insufficient authentication scopes. [reason: "ACCESS_TOKEN_SCOPE_INSUFFICIENT",...

    I also tried adding: https://www.googleapis.com/auth/analytics.provision, but that didn't help. Using this site to try and find scopes: https://developers.google.com/identity/protocols/oauth2/scopes

    Does anyone know which one is needed?

    Continue reading...

Compartilhe esta Página