API Connector Documentation
Import Slack Data to Google Sheets
In this guide, we’ll walk through how to pull data from the Slack API directly into Google Sheets, using the API Connector add-on for Sheets.
We'll first get an API token from Slack, and then set up a request to pull in channel data from Slack to your spreadsheet.
Contents
- Before You Begin
- Part 1: Get Slack API Token
- Part 2: Pull Slack API Data into Sheets
- Part 3: API Documentation
Before You Begin
Click here to install the API Connector add-on from the Google Marketplace.
Part 1: Get Your Slack API Token
- Navigate to https://api.slack.com/ and click Your Apps > Create your first app
- On the Apps page, click Create an App. You'll be asked whether to create your app from scratch or from a manifest file; we'll create it from scratch.
- Enter an app name and select a workspace. Click Create App
- Now scroll down the page and click Permissions. This will open the OAuth & Permissions page.
- Scroll down to Bot Token Scopes and select the scopes you'd like to have access to (you can change this later).
- Now scroll up and click Install to Workspace.
- You'll be prompted to approve the scopes you selected above. Click Allow.
- You should now see your token in the Bot User OAuth Token section.
- Congrats, you have your token! Keep it handy as we'll need it shortly. You're now ready to access the Slack Web API.
Part 2: Pull Slack API Data into Sheets
For this example, we'll get a list of channels in your Slack workspace. Substitute in your own token where it says your_token
.
- Open up Google Sheets and click Extensions > API Connector > Open > Create request.
- In the request form enter the following:
- Application:
Custom
- Method:
GET
- Request URL:
https://slack.com/api/conversations.list
- Headers:
Authorization
:Bearer
your_token
- Application:
- Create a new tab and click Set current to use that tab as your data destination.
- Name your request and click Run. A moment later you’ll see a list of channels populate your sheet.
The documentation lists over a hundred methods that can be used to search conversations, send messages, retrieve information about the channel, and more.
Part 3: API Documentation
Official API documentation: https://api.slack.com/web