Get Login User E-mail

Get Login User E-mail

l.virone
Enthusiast Enthusiast
3,095 Views
3 Replies
Message 1 of 4

Get Login User E-mail

l.virone
Enthusiast
Enthusiast

Hello everyone,

 

I would like to have the user's e-mail as displayed in the "account information" window in Revit.
I know it is possible to have the "UserName" and "LoginUserId" using Revit Application but I can't find a method to access the email address.
Is there a way to access this value ? Maybe using "LoginUserId" to get it ?

 

Thank you

Lorenzo

0 Likes
Accepted solutions (1)
3,096 Views
3 Replies
  • user
Replies (3)
Message 2 of 4

naveen.kumar.t
Autodesk Support
Autodesk Support

Hi @l.virone ,

 

Application app = commandData.Application.ActiveUIDocument.Document.Application;
string userId = app.LoginUserId;
string userName = app.Username;

 I hope this helps.


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

Message 3 of 4

l.virone
Enthusiast
Enthusiast

Hi @naveen.kumar.t 

 

Thanks for your answer but what I'm looking for is the email address, so I can check what's after the "@" to find out which organization the person belongs to.

 

Tks !

0 Likes
Message 4 of 4

ricaun
Advisor
Advisor
Accepted solution

I believe is not possible to get the user email on the Revit Api, email data is private and could be used to sniff emails and send spam...

 

Sometimes the username has the email if the user does not change or is the default username when an account is created.

 

You should use the LoginUserId to check if the user can or cannot use your app.

 

If your plugin is on the app Autodesk when a user downloads a plugin is possible to get the UserId, email, and other information of the user.

 

You will need a web application to save the data and make all the backend logic.

 

And on the plugin, you can request if the UserId can use the app based on the email on the server.

 

I hope this helps

 

See yaa!

Luiz Henrique Cassettari

ricaun.com - Revit API Developer

AppLoader EasyConduit WireInConduit ConduitMaterial CircuitName ElectricalUtils

0 Likes