How do I use a Service Account to Access the Google Analytics API V3 with .NET C#?

前端 未结 5 863
轮回少年
轮回少年 2020-12-01 04:52

I realized this question has been previously asked but with little in the way of example code, so I am asking again but with at least a little bit of direction.

Afte

5条回答
  •  情话喂你
    2020-12-01 05:14

    Regarding Richard Collette answer, be careful that using his method if you want to use Analytics API in READONLY mode, the correct way to use it is:

    string Scope = "analytics.readonly"
    

    and not

    string Scope = AnalyticsService.Scopes.AnalyticsReadOnly.ToString().ToLower()
    

    as he seems to tell that there is a bug. In fact, the bug is that the .toString() method returns analyticsreadonly and NOT analytics.readonly which is the way that Google likes. That's it.

提交回复
热议问题