Node-slack-sdk: Where do you get the conversation IDs from?

Created on 14 Feb 2018  路  3Comments  路  Source: slackapi/node-slack-sdk

Description

Sorry if this is a dumb question but I've connected Slack to a Django REST API and I'm trying to use conversations.history to fetch a convo history but I need the convos ID. Is it just the user bot token? The same goes for User IDs

What type of issue is this? (place an x in one of the [ ])

  • [ ] bug
  • [ ] enhancement (feature request)
  • [ ] question
  • [ ] documentation related
  • [ ] testing related
  • [ ] discussion

Requirements (place an x in each of the [ ])

  • [ ] I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • [ ] I've read and agree to the Code of Conduct.
  • [ ] I've searched for any related issues and avoided creating a duplicate issue.

Bug Report

Filling out the following details about bugs will help us solve your issue sooner.

Reproducible in:

@slack/client version:

node version:

OS version(s):

Steps to reproduce:

1.
2.
3.

Expected result:

What you expected to happen

Actual result:

What actually happened

Attachments:

Logs, screenshots, screencast, sample project, funny gif, etc.

Most helpful comment

For anyone else who came here because they want the conversation id of a specific channel to post to: visit the channel in the Slack webapp from https://app.slack.com/ . The id will be the last thing in the URL after the final slash that starts with the letter C.

All 3 comments

As a note, this repository focuses around the Node.js package for the Slack API. For future questions about the API (rather than this package), I'd recommend looking at the Support article in the official API documentation, or asking in the Bot Developers Hangout, mentioned at the bottom of this repository's README. 馃槉


The ID of the conversation is literally just that: the conversation's ID; it identifies the conversation. How you get that ID is completely up to you.

If you're trying to get the history of a conversation in response to an event, it's likely that event will have an ID linked to that event; i.e. the message.channels event has a channel ID as one of the event arguments.

If you're trying to get the conversation ID given some other data, then a method like channels.list or im.list will get you a list of conversations, including conversation IDs, along with other metadata about those conversations that you can use to narrow your search down to one ID.

Likewise, the same applies to users and all other IDs. The IDs are ultimately passed to you in some way from the API, either via event arguments, or by inquiring yourself with methods.

For anyone else who came here because they want the conversation id of a specific channel to post to: visit the channel in the Slack webapp from https://app.slack.com/ . The id will be the last thing in the URL after the final slash that starts with the letter C.

it must be like this

https://app.slack.com/client/T005511LMG/CX-ID-CHANNEL/details/info

Was this page helpful?
0 / 5 - 0 ratings