Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. # Slack - [[slack python]] - [[slack blocks]] ## Slack API로 메시지 전송하기 [Slack API](https://api.slack.com/) 페이지에서 확인할 수 있습니다. 오른쪽에 보이는 `Start building custom integrations`를 눌러서 시작합니다.  오른쪽에 보이는 `New webhook`를 눌러서 webhook을 생성합니다.  `Add Configuratoin`을 눌러서 설정을 추가합니다.  포스트할 채널을 선택하고 `Add Incoming WebHooks integration`를 클릭합니다.  가운데 보이는 Webhook URL을 사용하여 메시지를 보낼 수 있습니다.  Example 에 있는 curl을 윈도우 cmd.exe에서 실행하면 `curl: (6) Could not resolve host` 에러가 발생합니다. `"` 와 `'` 를 바꿔서 실행하면 메시지가 전송됩니다. ``` curl -X POST --data-urlencode "payload={'text': 'This is posted to #general and comes from a bot named webhookbot.'}" https://hooks.slack.com/services/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 ``` 정상적으로 전송이 완료되면 `ok`값을 확인할 수 있습니다. slack 에서 전송된 메시지를 볼 수 있습니다.  ```bash C:\Users\x>curl -X POST --data-urlencode "payload={'text': 'This is posted to #general and comes from a bot named webhookbot.'}" https://hooks.slack.com/services/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 ok ``` [Slack API 메시지](https://api.slack.com/docs/messages)는 이곳에서 확인할 수 있습니다. open/slack.txt Last modified: 2024/10/05 06:15by 127.0.0.1