@Anurag Mishra
Ambari does not maintain this information. Which means thewre is no database/table/column where we can see the information about last logged in Time for a user. Hence there is no API available for the same.
However you can parse the "ambari-audit.log" to extract similar kind of info
# grep 'User login' /var/log/ambari-server/ambari-audit.log
.