Hi @Amit Dimri
The siteusers
endpoint works by querying a hidden list called the User Information List. If a user has never logged into the site collection, or had never been referenced in the site collection in some other fashion, the user will not have an entry in the list, so as far as SharePoint is concerned, that user does not exist in the site, even if they may have access through an AD group. As an example, I granted an AD group permissions to my site & only the AD group showed up in the hidden User Information list not the users
Besides logging into a site, certain other activities, like adding the user to a People field in the site, or, as you've discovered, checking permissions, will trigger the process to add the user to the site. The basic process to trigger this process via REST is to call the EnsureUser endpoint. This endpoint will return information about the requested user, adding them to the site if they're not already there.
EnsureUser: https://msdn.microsoft.com/en-us/library/office/dn499819.aspx#bk_WebEnsureUser
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.