Search code examples
slackslack-apislack-commands

Retrieve direct message from Slack


I need to retrieve direct messages (1to1 chat) I created an APP but I can retrieve only

"is_channel": true,
"is_group": false,
"is_im": false,
"is_mpim": false,

I used https://slack.com/api/users.conversations and other endpoints without luck.


Solution

  • In order to retrieve direct messages, you need to explicitly specify the types input parameter as im. types parameter specifies what are the different types of conversations that API should retrieve and provide in response. By default, if you don't specify any types parameter, then it will show only public channels

    Check the parameter explanation here