Hi @Shankar, Bhukya,
SharePoint Server is different with SharePoint Online, there is no tenant id for a SharePoint Server site. We are unable to get access token as SharePoint Online.
As a workaround, we could use NTLM Authothorization to access SharePoint Rest api. You could refer to the steps in following issue similar with yours
https://sharepoint.stackexchange.com/questions/284483/token-based-authentication-in-sharepoint-2016
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.