I tried to add the external user to direct access and i got a specific people link with edit permission. then I tried to get the link details using the role assignments for the particular file and the external user is not visible. after the user authenticate and use open the file the external user is visible under the group name starts with "SharedLinks....".
My question is "Is it possible to get the invitations of the external user using CSOM?" if yes, then how can i do that.
Also i found some reference to get that details in Rest API call,
https://42jghx.sharepoint.com/sites/1gate/_api/web/Lists(list_id)/GetItemById(item_id)/GetSharingInformation?$Expand=permissionsInformation&$Select=permissionsInformation
using this Api call I can get permission of the item and also details of the shared link with external user invitations in them.
Is there any relevant CSOM C# code for the above API call?
Here's an example of how you can use CSOM in C# to get details about external user invitations: