Skip to content

TECH))Slack incoming webhook

ilgwonPark edited this page Nov 13, 2018 · 2 revisions

Codes will be shared with file and issue#6(https://github.com/ilgwonPark2/SystemAnalysisDesign/issues/6)

payload needs to be formatted like below.

post= {
"attachments": [
    {
        "text": "<http://news.donga.com/3/all/20180523/90199081/1|Donga> - This link makes crawling error",
        "fields": [
            {
                "title": "Part",
                "value": "Data Crawling",
                "short": True
            },
            {
                "title": "NewsPaper",
                "value": "Donga",
                "short": True
            },
             {
                "title": "Priority",
                "value": "High",
                "short": False
            }
        ],
        "color": "danger",
        "footer": "Emma,Daniel",
        "footer_icon": "https://platform.slack-edge.com/img/default_application_icon.png",
        "ts":1541395367
    }
]
}

expected outcome: https://saditmseoultech.slack.com/archives/CDV8LK57C/p1541398717002200

Reference:

  1. How to format your message: https://api.slack.com/docs/message-attachments#attachment_structure
  2. https://api.slack.com

Written by ilgwon Park.