password123456 / slack_api_example

slack-api code snippets using slack_sdk, python requests

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

slack_example

made-with-python Python Versions

  • Meaningless work on the slack

How to set up

  1. Install slack-sdk
# pip install slack_sdk 
  1. or Install requests
# pip install requests
  1. Create Slack application bot and Set authorization scopes

e.g) if you want to know uploaded file information in a Specific channel, grant these scope to the Bot.

Two Slack API are used.

1) https://api.slack.com/methods/conversations.history

channels:history
groups:history
im:history
mpim:history

2) https://api.slack.com/methods/users.info

users:read 
users:read.email

:note:
Apps created after January 4th, 2017 must request both the users:read and users:read.email OAuth permission scopes to access the email field of user objects.
(default: not show email field) so, If not grant users:read.email, email field does not return.

Refer to a API guide link

Examples - python slack_sdk/requests

And...

  • If you find this helpful, please consider giving it a "star"🌟 to support further improvements.

Reference Pages

Slack API Application

Slack API Docs

About

slack-api code snippets using slack_sdk, python requests

License:GNU General Public License v3.0


Languages

Language:Python 100.0%