Skip to content

Instantly share code, notes, and snippets.

@martindale
Forked from turt2live/tag_room.sh
Created August 11, 2018 05:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martindale/9775dd364b0c5152ca01aa2c188c69da to your computer and use it in GitHub Desktop.
Save martindale/9775dd364b0c5152ca01aa2c188c69da to your computer and use it in GitHub Desktop.
# This should be the public-facing name (ie: dns name)
HOME_SERVER_URL="https://matrix.org"
# The room ID is NOT the room alias. The ID can be found at the bottom of the room settings dialog in riot-web
ROOM_ID="!AbCDef823s:matrix.org"
# This is your user ID and access token. The access token must match the user.
USER_ID="@turt2live:matrix.org" # The home server should match this domain as well (ie: t2l.io as a HS should be :t2l.io in the user)
ACCESS_TOKEN="token_here"
# The name for the tag, ie "Work Stuff". Needs to be manually encoded
TAG="Conversations"
# Body information for the tag, such as ordering. JSON format
BODY="{}"
curl -H "Content-Type: application/json" -H "Accept: application/json" -X PUT -d "$BODY" "$HOME_SERVER_URL/_matrix/client/r0/user/$USER_ID/rooms/$ROOM_ID/tags/$TAG?access_token=$ACCESS_TOKEN"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment