Pergunta

In one of my applications, I'm trying to generate a link to a specific gmail message. I have the thread Id, so I can generate a link to a message in an inbox fine, like so:

string message_url = "https://mail.google.com/mail/#inbox/" + Fields!thread_id.Value;

However, I realized that my users will be using a delegated email account, and the url for a delegated inbox is different for each user. For example:

https://mail.google.com/mail/b/126/u/0/#inbox

This url has an "inbox id" of 126. This is different for someone else setting up a delegated account (my tester's url has an "inbox id" of 237).

So, I need to use the google admin sdk to get the url of a delegated account inbox for each user.

Here's what I have so far:

GoogleMailSettingsService service = new (MY_DOMAIN, "Gmail");
service.setUserCredentials(ADMIN_ACC, ADMIN_PASS);

AppsExtendedFeed delegates = service.RetrieveDelegates(SPECIFIC_ACCOUNT);
string delegated_to = ((AppsExtendedEntry)delegates.Entries[0]).getPropertyValueByName("delegationId");

Looking at delegates.Entries, I can see each delegate for that account listed. Is there any way to obtain either the delegated inbox url, or the "inbox id" from this information?

Foi útil?

Solução

I opened a ticket with Google enterprise support, and they basically said it can't be done. My workaround is simply to set up the delegated accounts beforehand (I only have a few users so it won't be too arduous).

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top