Hi @Siddhesh Gholap
It is not possible to directly list all emails in a shared mailbox. When the target user shares their mailbox with you, only the Inbox folder is shared by default, so you can only retrieve emails from the Inbox folder of the shared mailbox.
GET /users/{sharedmailboxmailaddress}/mailFolders/{id}/messages
If you want to access emails in other folders of the shared mailbox, you need to contact the target user and ask them to share the other folders with you in Outlook.
Hope this helps.
If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.