Invite new members to Slack workspace via APIa - slack

I'm developing an application for slack with ability to invite new members vie API. But seems that slack no longer keeps that functionality for non Enterprise Workspaces.
I know about endpoint users.admin.invite but it is need to have client scope for your token but for now it's a deprecated scope.
Endpoint users.admin.inviteBulk doesn't work without slack cookies.
Do we have any workflow to invite people via API? Because there are a few products who can do it and it seems that for now u can't create new app with these abilities
I've tried to ask these questions to Slack Support but they can't help

Related

How do I gnereate Embed Code on Azure Bot Services for OAuth v2 in Slack

Slack recently deprecated the bot scope in favor of more granular scopes. I have already migrated my app from the bot scope to granular scopes on the Slack' developer portal. I'm trying to get an embed code for my "Add to Slack" button. I'm trying to get the embed code from channel settings on Bot services as defined here https://learn.microsoft.com/en-us/azure/bot-service/bot-service-channel-connect-slack?view=azure-bot-service-4.0&tabs=abs
The embed code in my channel settings still point to Slack' legacy bot scope. The embed code is
https://slack.com/oauth/authorize?scope=bot/oauth/.....
I'm expecting an embed code that points to the new granular scopes on oauth2, the URL i expect would be https://slack.com/oauthv2/authorize?scope=app_mentions:read....
Is there a workaround to this issue?
Pointing back to the GitHub equivalent.
You need to remove the the slack channel and then re-add it. This will give the V2 auth, and then you will be able to modify the scopes.

How to find out if workspace added or removed your Slack App?

I have some questions about Slack App after Public Distribution is activated.
Our team has developed a Slack App with bot and incoming webhook features, and we have activated public distribution for this Slack App, and added the "Add to Slack" button on our product webpage.
Questions:
Is there any way to find out what workspaces have added our Slack App? I understand that via the Add-to-Slack flow, we would know when a workspace has added the Slack App along with the resulting bot access token and webhook. But is that the only way to keep track? Is there no API to just list the workspaces, resulting bot, and webhook?
Is there any way to find out which workspaces have removed our Slack App? I can infer that information by doing an users.list API call using the bot access token. If it says token invalid, then I can guess that the workspace has removed the Slack App. Is there no other direct API to find out if a workspace has removed the Slack App?
Thank you.
Is there any way to find out what workspaces have added our Slack App?
I understand that via the Add-to-Slack flow, we would know when a
workspace has added the Slack App along with the resulting bot access
token and webhook. But is that the only way to keep track? Is there no
API to just list the workspaces, resulting bot, and webhook?
This is the only way (to track workspace during installation flow). At least for now, I saw such a feature in mid/long term plans for Slack API team.
Is there any way to find out which workspaces have removed our Slack
App? I can infer that information by doing an users.list API call
using the bot access token. If it says token invalid, then I can guess
that the workspace has removed the Slack App. Is there no other direct
API to find out if a workspace has removed the Slack App?
Take a look at app_uninstalled and tokens_revoked API events.

Slack File Library

I really like Slack but my organization won't allow it if we cannot disable file sharing features. I'm trying to find out whether I can either disable uploads of certain file types or hide the file library all together. Their support says there's no way to do this natively but is this possible with the API?
No, not to my knowledge. The main focus of the API is not to configure your Slack team, but to enable bots and 3rd party apps to communicate with your Slack team and retrieve information. All core configuration for your Slack team has to be done in admin settings and apparently you have already learned from Slack support team that you can not deactivate file sharing in admin settings.
But I think I might have a solution for you. You can create a Slack bot that automatically blocks sharing of files in channels. (technically the bot would auto delete any message that is a file share form a user). Users would still be able to upload files, but they wont be able to share them. At least not in any public and known private channel. However there is a caveat: As I understand the bot would not be able to block users from sharing files in direct messaging channels though.
We are using a similar bot to block messages from unauthorized users in some private channels, which works nicely. Our bot is a simple Slack app with a bot user and using the Events API to receive all messages from all channels he is invited too. The bot then checks each new message and deletes the ones that does not fulfill some criteria. In our case if the message comes from a user that is not on the whitelist.

clarification on integrating slack api in the xamarin app?

I am working on a Xamarin App in which we need to have a feature as Open chat room or discussion room. I was exploring the slack api and interested to integrate the slack api in the App.
My clarification is, on integrating slack client api in the app, whether chat feature will be enabled? Whether my app registered users can utilize the slack chat room ? Or do the app registered users has also to register in the slack?
The Slack API is not much use if you do not plan to work with the core Slack application as well. So if you are just looking to extend your own app with a chat features, the Slack API will not help you much. To utilize the Slack chat features, you need to setup your own Slack team and your users will need to register on the Slack team and use it. The Slack API mainly enables one to build automation and bots around a Slack team.
QuickBlox is another 3rd-party SDK that you can use.
xamarin chat sample https://quickblox.com/developers/Sample-chat-xamarin/

How to create a slack bot with the events API

I have my own slack team, with its own slackbot user.
I want to create a basic slack bot that will respond to direct messages, and I since I need specific events, I need to use the Events API.
I understand that slack will POST to my server the event that happened with its parameters, but I don't understand what needs to be done with the oauth permissions.
How can I add permissions to the slack app, without submitting the app?
reading the docs, I couldn't find the answer to this..
what am I missing?
You do not need to submit your app to the Slack App Directory. That is optional and only necessary if you want to make your app available to the public.
But you need to install your app to your Slack team before you can use it. During the installation process your app will be authenticated to your Slack team and you will receive a special token based on the scopes you requested.
The authentication process follows the OAuth standard and works similar to the process used by other web services, e.g. Twitter or Facebook.
I use a mini website for each of my Slack apps that has the "Add to Slack" button and is able to run through the OAuth process with Slack. This website is basically another script in addition to the one that will handle the events coming form Slack.
Check out the excellent documentation from Slack on the Slack button and how to use Oauth with Slack.

Resources