0

I need to know the time that it take to a user to response an email recived from a group. To do this I want to use google api, to download all the data I need and then compare it with SQL. When I'm traying to use the api users.messeges.get() for my user, the api return me the data, but when I tried to recover other user data, i have this error:

Delegation denied for user@domain.com

I understand this error it's because I do not have enough permits, but if I use GAM ADV with my user I can download all the data I need. The SCOPE I'm actually using is:

https://www.googleapis.com/auth/gmail.metadata

Any advice for me? I'm stack

Guido Caffa
  • 1,201
  • 1
  • 12
  • 22
  • There is a discussion [here](https://stackoverflow.com/questions/26135310/gmail-api-returns-403-error-code-and-delegation-denied-for-user-email) that could possibly be the issue in your case. If you are using the `userId` param that differs from the authorized user, the kind/style of delegation isn't supported. Always use `userId="me"` param in your requests. – MαπμQμαπkγVπ.0 Jan 15 '19 at 11:33
  • @MαπμQμαπkγVπ.0 The problem is that i need to download the email headers of other users... The first problem i have is when i use .list(userId='otheruser@domain.com'). With the app called GAM ADV I can download all the info i need, using the same user for authenticate. So i think the problem is in my app or the scopes I'm using – Guido Caffa Jan 15 '19 at 23:25

0 Answers0