Skip to content

Instantly share code, notes, and snippets.

@sidouglas
Last active August 28, 2024 09:51
Show Gist options
  • Save sidouglas/e7b211f175579dc3306a2e046fd8cc4e to your computer and use it in GitHub Desktop.
Save sidouglas/e7b211f175579dc3306a2e046fd8cc4e to your computer and use it in GitHub Desktop.
Slack API set status curl command
now=$(date +%s)
oneHour=$(($now + 3600))
curl 'https://slack.com/api/users.profile.set' \
--header 'Authorization: Bearer YOUR_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw "{
\"profile\": {
\"status_text\": \"On Lunch\",
\"status_emoji\": \":hamburger:\",
\"status_expiration\": $oneHour
}
}"
curl 'https://slack.com/api/users.setPresence' \
--header 'Authorization: Bearer YOUR_TOKEN' \
--header 'Content-Type: application/json' \
--data-raw "{ \"presence\": \"away\" }"
@sidouglas
Copy link
Author

Thanks for the write up — I found you on Reddit. I had to update the old token today...
https://www.jeroendruwe.be/automated-slack-lunch-status/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment