Context: Slack provides you with the option to send emails directly as DM or in a channel. One can get this email address in user's or channel's integration tab and then opening Send emails to this conversation pop-up.
Here, I'm looking for such API which take slack user's email address(e.g. john@meta.com) or a channel's tag(e.g. #tech-discussion) as parameter and respond with slack integrated email address(e.g. z-test-alert-aaaai2f5zktgpqhhwn74dh5czq@meta.slack.com)
Hi @Sumeet Singh as for 'Users' you can use https://api.slack.com/methods/users.info to get use robject https://api.slack.com/types/user where you can find the email field.
When it comes to channels I don't see any email related field on 'channel' object https://api.slack.com/types/channel so you would need to manually copy the email adres if you want to use it.
If I may ask, what is wrong with using https://api.slack.com/methods/chat.postMessage for sending messages to channel or https://api.slack.com/methods/conversations.open for sending messages directly to user?