Closed smashism closed 3 years ago
💯 agree, Slack integration would be an awesome feature!
I haven't actually played with the Slack API, however after a quick scan of the docs it appears I can get away with the following config options:
{
"name": "KMART Report",
"url": "https://myorg.jamfcloud.com",
"credentials": "base_64_encoded_username:password",
"slack": {
"enabled": true,
"webhook_url": "https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX",
"token": "xoxb-your-token",
"channel": "channel_name",
"text": "KMART Report has been generated!",
"username": "username",
"icon_url": "https://icon.url",
"icon_emoji": ":white_check_mark:",
"attachments": {
"json": "filename.json",
"plist": "filename.plist",
"yaml": "filename.yaml",
"markdown": "filename.md",
"html": "filename.html"
}
}
}
If a webhook_url
is empty or not specified, use the default Slack API endpoint (token
, channel
, etc.).
@smashism do you have a preference or specific use case for Webhooks over the standard Slack API ?
I'd be fine with a webhook but I'm also a simple creature.
Here's a screenshot of Slack successfully receiving KMART report file uploads:
Note: File Uploads are not possible via Webhooks, so instead the following fields are now required:
{
"name": "KMART Report",
"url": "https://myorg.jamfcloud.com",
"credentials": "base_64_encoded_username:password",
"slack": {
"enabled": true,
"token": "xoxb-your-token",
"channel": "channel_name_or_id",
"text": "Custom Slack message supporting Markdown and Emoji",
"attachments": [
"json",
"plist",
"yaml",
"markdown",
"html"
]
}
}
chat:write
and files:write
scopes to be added - Documentationattachments
you do not wish to uploadFixed in #11
Hi, it'd be really handy if there was an export that could post results via a Slack webhook into a channel (with flags for webhook URL, username, icon/emoji icon, etc.).