def call_hook(message,
              attachment=None,
              color='good',
              short=False,
              identifier=None):
    base_url = 'https://hooks.slack.com/services/'
    if not identifier:
        identifier = _get_hook_id()

    url = _urljoin(base_url, identifier)

    if not message:
        log.error('message is required option')

    if attachment:
        payload = {
            'attachments': [
                {
                    'fallback': message,
                    'color': color,
                    'pretext': message,
                    'fields': [
                        {
                            "value": attachment,
                            "short": short,
                        }
                    ]
                }
            ]
        }
    else:
        payload = {
            'text': message,
        }

    data = _urlencode(
        {
            'payload': json.dumps(payload, ensure_ascii=False)
        }
    )
    result = salt.utils.http.query(url, 'POST', data=data)

    if result['status'] <= 201:
        return True
    else:
        return {
            'res': False,
            'message': result.get('body', result['status'])
        }
Send message to Slack incomming webhook.
dataset/ETHPy150Open saltstack/salt/salt/modules/slack_notify.py/call_hook