public void connectRTM ( String slackToken ) { RTM rtm = restTemplate . getForEntity ( slackApiEndpoints . getRtmConnectApi ( ) , RTM . class , slackToken ) . getBody ( ) ; currentUser = rtm . getSelf ( ) ; webSocketUrl = rtm . getUrl ( ) ; getImChannels ( slackToken , 200 , "" ) ; }
Start a RTM connection . Fetch the web socket url to connect to current user details and list of channel ids where the current user has had conversation .