I am migrating some code from hipchat to slack. There is one hipchat curl command I used to send dm's to users that I want to convert over to slack:
msg='hello world'
curl --fail -d "$(jq -c -n --arg msg "${msg}" '{"message_format": "text", "message": $msg}')" \
-H "Content-Type: application/json" \
-X POST "https://my.hipchat.server.com/v2/user/$USERS_EMAIL/message?auth_token=$HIPCHAT_TOKEN"
Lets say all I have is a bot token and the email of the user account I want to send a message to (with no webhook setup). How can I send a message to that user? What is the exact curl structure I would use?