Question

Using Slack API to create private channel


Userlevel 1

I’m trying to figure out how to create a private Slack channel using API.  I think I’m supposed to create a Slack app but I don’t know how to get Zapier to trigger the app.  Can someone point me in the right direction?


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

16 replies

Userlevel 7
Badge +14

Hi @mike_h 

Good question.

App APIs can be used in Zaps with the Webhooks app as an action step: https://zapier.com/apps/webhook/help

You’ll need to default to the Slack API documentation for how to configure the API request for the desired endpoint: https://api.slack.com/methods/admin.conversations.create

Userlevel 1

Thank you @Troy Tessalone for getting back to me so quickly.  So if I understand correctly, these are the steps I need to take?

  1. Install Bolt and create Slack app to create webhook and create private Slack channel
  2. Zap sends data to Slack webhook
  3. Slack receives data and creates private Slack channel based on data received via webhook

A couple questions I have:

  1. Which Bolt do I install?  There’s Javascript, Python, and Java.  I don’t have experience using any of these but I’m determined to learn.  I’m just not sure which one I need for my next step.
  2. Does the Slack user need to have access rights to create a private channel or can the app alone have the access rights to create private channels?  Creating private channels is currently disabled for all users so I’m exploring using an app to create private channel as a workaround.
Userlevel 7
Badge +14

@mike_h 

Can you add some context about “Bolt” as that was not previously mentioned, thanks.

Perhaps link to the documentation you are referencing.

Userlevel 1

I’m reading (https://api.slack.com/start/building) that I need to install Bolt to finish creating the Slack app that will create the private channel.  If there’s a simpler way for me to execute conversations.create API commands then that would be ideal.  I really have barely any clue of what I’m doing here so please bear with me :(

 

I just noticed I can try to use the workflow builder so I will attempt to accomplish what I need with this tool.  I hope I’m going the right direction!

Userlevel 7
Badge +14

@mike_h 

FYI: This API endpoint method is only available for the Enterprise Grid Slack plan, do you have that?

 

Userlevel 1

@troy Yes, I’m on an Enterprise Grid plan.

 

I’ve read through a lot of documentation but all of these instructions start at a place that’s beyond me.  This page https://api.slack.com/methods/admin.conversations.create talks about method access and such but I don’t know how to apply this to my Slack app.

Userlevel 7
Badge +14

@mike_h 

Maybe it’s worth considering hiring a Zapier Expert to help: https://zapier.com/experts

Userlevel 1

Thanks @Troy Tessalone, we will consider it.  Would you be able to explain at least from a high level of how a private channel can be create using a webhook as you described here so I can better explain what the scope of work is?

Userlevel 7
Badge +14

@mike_h 

The Slack API link includes the documentation to follow: https://api.slack.com/methods/admin.conversations.create

Help article for using Webhooks app as an action step in Zaps: https://zapier.com/apps/webhook/help

Userlevel 1
Badge

Also weighing in here. Seems requests exist from about a year ago (maybe longer) for the native Slack integration to support creation of private channels. It was noted as ‘added as feature request’ but unfortunately I’ve found that to be a black hole, and anything I’ve asked about for the past year noted as ‘added as FR’ to go nowhere.

I’ve submitted a email making the request again. Anyone else wanting this, please also do so.

Till then, also looking at this from API. @mike_h Did you get this sorted? Care to share info or collaborate?

Userlevel 7
Badge +14

Hi @salesperson 

FYI: Most apps on Zapier are built and maintained by the app developers themselves, and Zapier keeps an internal list of app requests to share with app developers, altho I’m unsure who manages the Slack Zap app (Slack or Zapier).

Userlevel 1
Badge

@Troy Tessalone Thanks!! I’d thought this, but at one point early on, someone at Zapier provided contradictory info and said they maintained many of them (think they cited Google docs integrations, lots of gaps there). Knowing which vendors are responsible is helpful as we as users can them seek to have them updated by the vendors directly. Perhaps this should be documented?

Userlevel 7
Badge +14

@salesperson

Agreed. I have been pushing Zapier to maintain a public list of who owns which Zap integration for transparency that would be helpful on issues like this.

Even if Zapier simply said, we own these X Zap integrations, then we’d all know the others were owned by the app developers.

Userlevel 1
Badge

So, this just in from Zapier support, when asked who owns the integration and if they plan to implement the features (here and elsewhere that have been requested roughly a year ago.

 

Great question! Zapier owns the Slack integration.
 
To provide some context, I don’t have a timeframe for how long it could take to develop this Slack action. We consider the complexity, how many users are interested, and the scope when we prioritize, so the timeframe can vary.
 
If Slack supports webhooks, you could explore using Webhooks by Zapier as a workaround in the meantime. More info can be found here: https://zapier.com/apps/webhook/integrations

 

The canned response from support for EVERY request to fix a broken/missing integration is disappointing at best, and demonstrates at worst, lack of care/empathy for customers trying to solve/plan to solve implementations. Makes me want to look at competing companies (and there are plenty) that are a bit more communicative. For a year, I’ve been asking to touch base with someone in product management and have yet to have any sort of acknowledgement-- every request is simply ignored.

 

:)

 

Userlevel 7
Badge +14

@salesperson

Good to know that Zapier owns the Slack app integration, figured as much since Slack is a top Zap app.

 

Zapier Support is merely the front lines for this feedback.

Keep in mind there are several thousand apps on the Zapier Platform for which they are fielding inbound requests and feedback.

Any change to an Zap integration can have big implications across the millions of Zapier users with that app, so what may seem like a simple/small ask can actually be the tip of an iceberg for undertaking.

 

I can sympathize with Zapier’s generic response and lack of access to internal stakeholders.

Make sure you’re signed up for Emails about:

I’ve worked in the tech world building software.

There are many factors at play: investors, partners, competitors, marketplace movement, strategic decisions, end users, etc.

It takes a lot for a project to get prioritized, usually that’s driven by revenue generating activities, mission critical infrastructure improvements, new initiatives, and so on.

 

Most Zaps only expose the most common/popular API endpoints and webhook events, as there can be hundreds for certain apps.

(e.g. Most Zap apps don’t expose destructive endpoints such as Delete Contact as those can be misused and lead to unintended data loss.)

This is where advanced approaches for workarounds come in as an option which involve using the Webhooks app or Code app.

 

Maybe it’d be worth considering hiring a Zapier Expert to help determine and implement a workaround: https://zapier.com/experts

 

Userlevel 1

Hi @salesperson,

 

I ended up discussing the webhook solution with someone from the Slack technical team and I decided it’s too time consuming to build an app then work out the permissions with our IT team.  Creating public channels is disabled at my company so we’re exploring adding the channel admin role for some users so they could just use Zapier to create a public channel.  It’s not perfect and won’t be acceptable for all cases but it’s the best we can do for now.

 

However, I need to revisit this creating private channels eventually as I have some workflows that require this to be done manually.  The Slack support rep was surprised that Zapier doesn’t already have this function because he said it’s just a flag setting.

 

To go the webhook route, this is what I’ve gathered.  Please note that this isn’t tested and I’m by no means an expert on this, I simply jotted notes as I understood it.

  1. Create Slack app (scope group:write) with incoming webhook
  2. Create Zap and set trigger from Trello
  3. Set Zap action as send data to webhook and write JSON code into raw data section (custom)
  4. Include interactive button in JSON code
  5. Zap sends JSON code (payload) to Slack app
  6. Slack app recognizes button press event and creates private channel