A Slack app for users of BambooHR to share who is going to be out of the office. Supports PTO and holidays.
See .env.sample for required environment variables.
- Remix on Glitch (easiest for a quick start since Glitch will host your app and provide a URL for Slack to talk directly to; more info on Glitch). Alternatively, and more traditionally, you may clone this repo and get the app running somewhere that it will be accessible on the web.
- Copy
.env.sample
to.env
. - Create a new app in the Slack "Your Apps" dashboard.
- In your newly created Slack app configuration, Create a slash command via the
"Slash Commands" tab in the sidebar and set the request URL to your app:
https://your-app-name-here.glitch.me/slack/events
- Configure the required environment variables in
.env
:SLACK_SIGNING_SECRET
: Navigate to the "Basic Information" tab and use the "Signing Secret".SLACK_BOT_TOKEN
: Navigate to the "Install App" tab and use the "Bot User OAuth Access Token" value.BAMBOO_API_TOKEN
: Create and configure a BambooHR API token.
- Configure the optional environment variables in
.env
. These values are utilized when the app is triggered from an external source such as a cron or Jenkins job as opposed to a "slash command" from within Slack.DEFAULT_CHANNEL_ID
/SANDBOX_CHANNEL_ID
(optional): Populate these values with the Slack channel ID's where you want the app to post notifications. The easiest way to get these values is to load your Slack workspace in a web browser (as opposed to the Slack app) and grab the channel id's from the address bar.
- Customize default values:
DEBUG_MODE
: Setting this value totrue
results in theSANDBOX_CHANNEL_ID
being used instead of theDEFAULT_CHANNEL_ID
.
To trigger the app from outside of Slack:
- Ensure
DEFAULT_CHANNEL_ID
,SANDBOX_CHANNEL_ID
, andBAMBOO_API_TOKEN
are configured as described above. - Make a POST request with your token in the following format:
curl --fail -X POST \
'https://your-app-name-here.glitch.me/triggers?token=YOUR_BAMBOO_API_TOKEN_HERE'