Skip to content

Latest commit

 

History

History
99 lines (76 loc) · 5.99 KB

index.rst

File metadata and controls

99 lines (76 loc) · 5.99 KB
.. toctree::
     :hidden:

     self
     v3-migration/index
     installation/index
     web/index
     webhook/index
     socket-mode/index
     oauth/index
     audit-logs/index
     scim/index
     real_time_messaging
     faq
     about

The Slack platform offers several APIs to build apps. Each Slack API delivers part of the capabilities from the platform, so that you can pick just those that fit for your needs. This SDK offers a corresponding package for each of Slack’s APIs. They are small and powerful when used independently, and work seamlessly when used together, too.

Feature What its for Package
Web API Send data to or query data from Slack using any of over 200 methods. slack_sdk.web slack_sdk.web.async_client
Webhooks / response_url Send a message using Incoming Webhooks or response_url slack_sdk.webhook slack_sdk.webhook.async_client
Socket Mode Receive and send messages over Socket Mode connections. slack_sdk.socket_mode
OAuth Setup the authentication flow using V2 OAuth, OpenID Connect for Slack apps. slack_sdk.oauth
Audit Logs API Receive audit logs API data. slack_sdk.audit_logs
SCIM API Utilize the SCIM APIs for provisioning and managing user accounts and groups. slack_sdk.scim
RTM API Listen for incoming messages and a limited set of events happening in Slack, using WebSocket. slack_sdk.rtm_v2
Request Signature Verification Verify incoming requests from the Slack API servers. slack_sdk.signature
UI Builders Construct UI components using easy-to-use builders. slack_sdk.models

The Python module documents are available at https://slack.dev/python-slack-sdk/api-docs/slack_sdk/

Installation

This package supports Python 3.6 and higher. We recommend using PyPI to install |product_name|

pip install slack_sdk

Of course, you can always pull the source code directly into your project:

git clone https://github.com/slackapi/python-slack-sdk.git
cd python-slack-sdk
python3 -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install -e .  # install the SDK project into the virtual env

And then, save a few lines of code as ./test.py.

# test.py
import sys
# Enable debug logging
import logging
logging.basicConfig(level=logging.DEBUG)
# Verify it works
from slack_sdk import WebClient
client = WebClient()
api_response = client.api_test()

You can run the code this way.

python test.py

It's also good to try on the Python REPL.

Getting Help

If you get stuck, we’re here to help. The following are the best ways to get assistance working through your issue: