As far as I know, the is no such API function
For windows Front-end, this kind of information (last connection) is saved in .ini files related to windows profiles (not centralized).
For web Front-End, starting with HOPEX V1R2, there are supervision events (LoginAuthenticationSuccess, LoginAuthenticationFailure...) that log this but so far no API to access this information.
It is a need and it is likely that API will be available in the future.
As supervisor logs are text files, you can consider to parse such files.
you could also use a script that would write a text file each time a user connects to MEGA.
You could use a macro similar to this one :
Sub lastUserAccess() Dim macroGlobals, pathFile, strInfo, userName, fso pathFile = <pathToYourFile> nomUser = getObjectFromId(megaEnv.getCurrentUserId).getProp("short name") Set fso = CreateObject("Scripting.FileSystemObject") Set myFile = fso.OpenTextFile(pathFile, 8, True) myFile.WriteLine(username & ";" & megaEnv.getRoot.name & ";" & Date()) Set myFile = nothing Set fso = nothing End Sub lastUserAccess
Then, create a MetaCommand linked to your "Repository" metaClass and connect it to your macro.
Every time a user connects to MEGA, it will be logged in your text file :-)