I used Microsoft Graph API for getting onedrive shared files and folder. I am getting files which is shared with me, but I want files and folder which is shared with other people or external to organisation.
For Microsoft Graph API: https://graph.microsoft.io/en-us/docs/api-reference/v1.0/api/drive_sharedwithme