You can easily grab files from your devices and post them to Slack using a Slack Apps Bot/User API's and a simple curl command.
Uploading files to Slack
The below link advises on this Slack Process:
https://api.slack.com/messaging/files/uploading
Take some time to read the safety considerations for your Slack workspace use tokens carefully.
Uploading Files
Now that you have your token, here's the simplest method for uploading files from Addigy. These commands can easily be run right on the Devices page. Simply replace the text after file=, initial_comment=, channels=, and Authorization: Bearer with your desired file on the target device, desired slack message, the channel it should be sent to, and your Slack App Bot/User API token.
curl -F file=@cycling.jpeg -F "initial_comment=Hello, Leadville" -F channels=C0R7MFNJD -H "Authorization: Bearer xoxp-123456789" https://slack.com/api/files.upload
Here's what successfully running the above command within Addigy on the Devices page should look like.
And this is what the upload will look like in Slack.
Get Creative
This simple integration can really do a lot if you or your customers use Slack. Here in the Addigy Support team, we commonly use Slack as a simple method for collecting and uploading device logs.
This script is a sample how you could quickly pull logs from your device into your Slack workspace.
#!/bin/bash
# Enter your own Slack App User/Bot API code to upload.
# https://api.slack.com/authentication/basics
device=$(hostname | awk -F'.' '{print $1}')
file_name="${device}_log_upload.tar.gz"
file_path='/Library/Addigy/logs'
slack_token='Authorization: Bearer xoxp-123456789'
slack_message="Hello, Leadville"
# Create System Information export
system_profiler -xml > ${file_path}/system_information.spx
cd "$file_path" || (echo "Could not cd to $file_path. Exiting..." && exit 1)
tar -czvf "$file_name"
curl file=@./"$file_name" -F initial_comment="$slack_message" -F channels=#log_uploads -H "$slack_token" https://slack.com/api/files.upload
rm "./$file_name"
rm "${file_path}/system_information.spx"
Scripts like this can easily be run from the Run Commands section on the Devices page, or the Scripts tab in GoLive. For more insight on running scripts on devices, check out our article Creating and Running Scripts On Your Devices.