Skip to content

Instantly share code, notes, and snippets.

@one-data-cookie
Last active December 4, 2020 13:15
Show Gist options
  • Save one-data-cookie/b45cdc6cceb673d785c4df914a87208f to your computer and use it in GitHub Desktop.
Save one-data-cookie/b45cdc6cceb673d785c4df914a87208f to your computer and use it in GitHub Desktop.
import requests as rq
import pandas as pd
msg_url = 'https://slack.com/api/conversations.history'
msg_headers = {'content-type': 'application/x-www-form-urlencoded'}
msg_params = {
'token': 'xoxp-XXXXXXXXXXXX-XXXXXXXXXXXX-XXXXXXXXXXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
'channel': 'CXXXXXXXX',
'limit': 1000
}
msg_res = rq.get(url=msg_url, headers=msg_headers, params=msg_params)
msg = [i['ts'] for i in msg_res.json()['messages']]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment