Hi @Kuldeep Raj Tiwari ,
Thank you for postig in this community.
1.After my tests,POST /drives/{drive-id}/items/{item-id}/invite: Sends a sharing invitation for a driveItem. A sharing invitation provides permissions to the recipients and optionally sends them an email with a sharing link.
It simply sends a clickable shared connection and does not grant you access to it using the API, you can simply view it via the email link.
You can't access files in other people's onedrive through the API. This is because the post invite code you used above does not grant access, and secondly User Y from tenant B must exist as a guest member in tenant A to access User X's onedrive.
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.