簡體   English   中英

如何從松弛的 API 接收 JSON 有效負載以使用 python 檢索消息?

[英]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但由於我是初學者程序員,我對此知之甚少。 我使用了一個ngrok https URL 並附加了 /slack/actions 記錄在 slack 中,並嘗試了一小段代碼來查看 ZE6B391A8D2C4D45902A23A8B658 的有效載荷是否正常

import requests

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

print(r)

我收到了 405 錯誤

所以我不確定我需要什么代碼來接收這些有效載荷,因為你可能會說我在這方面很新,所以任何幫助將不勝感激

使用 POST 方法而不是 GET。 使用 URL 喜歡: https://xxxxxx.ngrok.io/api/YourSlackReceviver/Action

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM