# tag_room

Source : [https://gist.github.com/turt2live/697d5b3781fb7ab7e11d704ea90e3dbe](https://gist.github.com/turt2live/697d5b3781fb7ab7e11d704ea90e3dbe "https://gist.github.com/turt2live/697d5b3781fb7ab7e11d704ea90e3dbe")

 ![rio1.png](https://notes.iiens.net/api/files.get?sig=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJrZXkiOiJ1cGxvYWRzL2U5ZDE0MjM4LWU2ZjctNGUwNi05ZDNhLTNhZWFhYTY1ZmU4My9kNGFlMjViMC0wNmE1LTQ4NGUtYTI5ZC05YzM3Y2U2NTc1YzIvcmlvMS5wbmciLCJ0eXBlIjoiYXR0YWNobWVudCIsImlhdCI6MTc5MjIxNDEwMCwiZXhwIjoxNzkyMzAwNTAwfQ.mO4kCtOEleZmYh6Qym7HTmaOxdw9VbXSSHSvWu2WIZU)

Note: Une fois la catégorie créée pour une room, on peut assigner rapidement d'autres rooms par un simple cliquer-déplacer Si on veut assigner une room à plusieurs catégorie il faudra par contre reproduire la procédure

# Comment catégoriser mes rooms ?

Télécharger : [http://tchiling.iiens.net/tag_room.sh](http://tchiling.iiens.net/tag_room.sh "http://tchiling.iiens.net/tag_room.sh")

```
# This should be the public-facing name (ie: dns name)
HOME_SERVER_URL="https://matrix.iiens.net"

# The room ID is NOT the room alias. The ID can be found at the bottom of the room settings dialog in vector-web
ROOM_ID="!hMtWboQDtWytpTKdNc:iiens.net"

# This is your user ID and access token. The access token must match the user.
USER_ID="@tchiling2012:iiens.net" # The home server should match this domain as well (ie: t2l.io as a HS should be :t2l.io in the user)
ACCESS_TOKEN="INSERT TOKEN HERE"

# The name for the tag, ie "Work Stuff"
TAG="Assoce"

# 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"
```

Il faut configurer ce fichier

* HOME_SERVER_URL : "[https://matrix.iiens.net](https://matrix.iiens.net "https://matrix.iiens.net")"
* USER_ID : identifiant arise suivi de ":iiens.net". *Par exemple "@tchiling2012:iiens.net"*
* TAG : Le nom de la catégorie. *e.g. "Association"*
* ROOM_ID : l'id de la room, voir [comment obtenir l'id de la room](https://wiki.iiens.net/services_arise/matrix/tips/tag_room#comment_obtenir_l_id_de_la_room)
* ACCESS_TOKEN : le token identifiant votre riot. [voir comment obtenir mon token](https://wiki.iiens.net/services_arise/matrix/tips/tag_room#comment_obtenir_mon_token)

Une fois cela configurer il suffit de faire un "sh tag_room.sh" et c'est prêt 🙂

Il est à noter une fois de plus qu'une fois la catégorie créée, on peut directement assigner d'autres rooms par un simple déplacement des rooms dans la catégorie manuellement

## Comment obtenir l'id de la room ?

Allez dans les paramètres de la room (suivre 1).

 ![rio4.png](https://notes.iiens.net/api/files.get?sig=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJrZXkiOiJ1cGxvYWRzL2U5ZDE0MjM4LWU2ZjctNGUwNi05ZDNhLTNhZWFhYTY1ZmU4My81MDViODExZS03Y2U5LTQ4ZTctOWIwNy05OTJhMDc0YTVkOTgvcmlvNC5wbmciLCJ0eXBlIjoiYXR0YWNobWVudCIsImlhdCI6MTc5MjIxNDEwMCwiZXhwIjoxNzkyMzAwNTAwfQ.d2mOqZ5kgkYbE2GMw1YvqiT-fZ4Y8Ha4JNr17995shA)

l'id de la room se trouve en bas, dans la partie "Advanced"

 ![rio3.png](https://notes.iiens.net/api/files.get?sig=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJrZXkiOiJ1cGxvYWRzL2U5ZDE0MjM4LWU2ZjctNGUwNi05ZDNhLTNhZWFhYTY1ZmU4My9mMTdjZmZmNS1jYmFlLTQxMGYtYTI0Ni05M2YxZDUxZDgwNjgvcmlvMy5wbmciLCJ0eXBlIjoiYXR0YWNobWVudCIsImlhdCI6MTc5MjIxNDEwMCwiZXhwIjoxNzkyMzAwNTAwfQ.SUFuMJOB_DTFVNKDapQ96fIRaIFcMVc2rVKS6WqmPow)

## Comment obtenir mon token ?

Allez dans les paramètres de riot (suivre 2).

En bas des paramètres, cliquer sur "Découvrir" à côté de token.

 ![rio4.png](https://notes.iiens.net/api/files.get?sig=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJrZXkiOiJ1cGxvYWRzL2U5ZDE0MjM4LWU2ZjctNGUwNi05ZDNhLTNhZWFhYTY1ZmU4My81MDViODExZS03Y2U5LTQ4ZTctOWIwNy05OTJhMDc0YTVkOTgvcmlvNC5wbmciLCJ0eXBlIjoiYXR0YWNobWVudCIsImlhdCI6MTc5MjIxNDEwMCwiZXhwIjoxNzkyMzAwNTAwfQ.d2mOqZ5kgkYbE2GMw1YvqiT-fZ4Y8Ha4JNr17995shA)