question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The caller does not have permission [403] when calling Dynamic Links Analytics API

See original GitHub issue

I am trying to get dynamic link stats via Dynamic Links Analytics API with the method FirebaseDynamicLinksService.V1.GetLinkStats()… I was able to create a short link easily and it works… But the problem is to get the stats about this dynamic link.

I got 403: “Google.Apis.Requests.RequestError The caller does not have permission [403] Errors [Message[The caller does not have permission] Location[ - ] Reason[forbidden] Domain[global]]”

Is there something I am missing? I tried to follow this https://firebase.google.com/docs/reference/dynamic-links/analytics

My code basically looks like this:

var googleCredential = GoogleCredential.FromFile(shortLinkServiceConfiguration.KeyFileName).CreateScoped($"https://www.googleapis.com/auth/firebase");
var dynamicLinksService = new FirebaseDynamicLinksService(new Google.Apis.Services.BaseClientService.Initializer
        {
            HttpClientInitializer = googleCredential,
            ApplicationName = shortLinkServiceConfiguration.ApplicationName
        });

var request = dynamicLinksService.ShortLinks.Create(createShortDynamicLinkRequest);
request.AccessToken = googleCredential.UnderlyingCredential.GetAccessTokenForRequestAsync().Result;

// This works and I get the short link
var response = request.Execute();

var secondRequest = dynamicLinksService.V1.GetLinkStats(response.ShortLink);
secondRequest.AccessToken = googleCredential.UnderlyingCredential.GetAccessTokenForRequestAsync().Result;
secondRequest.DurationDays = 7;

// This does not work and I get 403 
var secondResponse = secondRequest.Execute();

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:14

github_iconTop GitHub Comments

40reactions
jskeetcommented, Sep 2, 2019

Okay, one final thing to check - the IAM permissions of the service account you’re using.

I just managed to reproduce your problem with a freshly-created service account with no permissions. I then added the “Firebase Grow Viewer” role to the service account in the IAM dashboard and the error went away. Could you check what roles your service account has access to, and try adding “Firebase Grow Viewer” if it’s not already there?

1reaction
jskeetcommented, Sep 2, 2019

Hooray - I’m glad that worked 😃 I guess Grow is a separate thing…

Read more comments on GitHub >

github_iconTop Results From Across the Web

The caller does not have permission [403] when calling ...
I am trying to get dynamic link stats via Dynamic Links Analytics API with the method FirebaseDynamicLinksService.V1.GetLinkStats() ... I was ...
Read more >
[Solved]-The caller does not have permission [403] when ...
Coding example for the question The caller does not have permission [403] when calling Dynamic Links Analytics API-C#.
Read more >
403 forbidden
403 means the authorized user doesn't have access to the account. If you log into the GA web interface, view a report, then...
Read more >
The caller does not have permission [403]No individual ...
I am experiencing error on multiple locations in Google My Business when trying to update them via the API. we get the following...
Read more >
Troubleshoot Cloud Functions
This error message indicates that the caller does not have permission to invoke the function. Note: Visiting the Cloud Functions URL in a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found