Skip to content

Instantly share code, notes, and snippets.

@sidouglas
Last active April 1, 2024 15:18
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\" }"
@chaoscreater
Copy link

Is there an updated version that you could share? Seems like legacy tokens can't be created anymore:

https://api.slack.com/authentication/token-types

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