Snippit on slack11/7/2022 ![]() ![]() Now that I think about it, 90% of those messages was probably /giphy We then execute and close the cURL.That’s messages shared between members in public channels and direct messages, community members helping each other out when they get stuck, people sharing knowledge through blog posts and just sharing funny crazy stuff they saw in #random. Within our conditional statement, we want to initialize our cURL, tell it where to pull data from, and set our HTTP headers so that the Tallyfy API authenticates us. Most APIs make use of cURL, so it is a valuable process to understand. We will be using cURL in php to make our API request. Note that while I am using Tallyfy’s API to get data, you could pull data from any API and pass this over to Slack (I’ll show an example of this at the end). In order to communicate our tasks to Slack, we have to make a request to our Tallyfy API. Now, if we scroll down, there will be a URL under “Webhook URL.” Save this URL as we will need it later. #Snippit on slack installChoose the channel you want to install our app to. We must then choose a channel we want our app to make changes to. To do this, we need to go to the tab labeled “Incoming Webhooks,” and turn the “Off” switch to “On.” This next step will let our app point to where we want changes to be made in our Slack workspace. Now everything is set up on Slack’s end and its time for us to code! Fill out the rest of the form similarly to how I have it below and click save. Make sure the “Request URL” field points to the place we are hosting our php file. To do this, go to the tab labelled “Slash Commands” and click “Create New Command.” We’re now prompted with a form that will let us set up our command. Now we need to tell our app which commands to look out for. ![]() I’m naming the file “todoBot.php” and am hosting it on my own site, so my url will be. This means we’re going to have to make a php file that listens for events from Slack’s Events API, processes these events, and sends commands back to Slack. Now that we’ve got our app made in Slack, we need a place to actually host our app on our end. Then give the app a description, image, and background color. To do so, click this link, name your app, and choose a workspace for the app to be in. The first step to creating our Slack Bot is to simply create an app within Slack. We will be using the Tallyfy API to do this as Tallyfy is a business process management tool that manages tasks. ![]() In this example, we are going to make a Slack Bot that listens for the “/todo” command and returns the current user’s list of pending tasks to do. For example, you could create a bot that responds with the current user’s local temperature when they type “/temperature” or the company’s sales for the current quarter by typing “/revenue.” You can integrate pretty much any information you could pull from an API into a Slack Bot command. Slack Bots listen for commands from users and spit back relevant information. Slack apps can manage workflows, interpret and act upon user messages, connect with other APIs.īots are one such app that can make your channel more useful. There are a number of different kinds of apps you can make using the Slack API. Your app will just be a fancy game of ping-pong. These APIs are both notifiers and observers, just functioning in two different directions. Whenever your app processes the received information and wants to make a change within a slack channel, it pongs commands back to Slack. Whenever an “event” happens within a slack channel, it pings information about this event over to your app. Slack likens these two APIs to players in a game of ping-pong. This is because these two APIs do very similar things, but with different end results. The Events API – Web API RelationshipĬreation of complete Slack apps generally requires use of the Events API and the Web API. You can read more about each of these more in-depth, but this tutorial will be using the Events API and the Web API. ![]() Slack’s platform has a number of APIs that allow for the creation of “apps.” These APIs are: With so many businesses using Slack, the need for a comprehensive API became apparent, and Slack has certainly delivered. If not, it’s simply a tool that helps teams communicate – sort of like Discord, but more professional. If you’ve read this far, I’m assuming you’re already familiar with Slack as a platform. Let's resume the rest of this article! Slack API Are you looking to automate tasks between co-workers or clients? You've found the right app for that! With Tallyfy - you can automate tasks and business processes - within minutes. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |