简体   繁体   中英

How do i receive JSON payloads from the slack API to retrieve messages using python?

I have been trying to make a slack bot for quite some time but there seems to be very little documentation on the slack URL, the most in-depth instructions I have found is to use ngrok and then you should receive JSON payloads from the slack API but as I am a beginner programmer I don't have much knowledge on this. I used an ngrok https URL and appended /slack/actions as documented from slack and just tried a little piece of code to see if the URL was ok to receive payloads from

import requests

r = requests.get('https://f39b39ebcdbf.ngrok.io/slack/actions')

print(r)

and I got a 405 error

So I am not sure what code I need to receive these payloads as you can probably tell I am very new at this so any help would be much appreciated

Use POST Method Instead of GET. USE URL LIKE: https://xxxxxx.ngrok.io/api/YourSlackReceviver/Action

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM