"Matrix Synapse in Docker - Cheat Sheet"
Erscheinungsbild
Aquire API Key
mel@brh-tools01:/opt/docker-ha/netbox$ curl -XPOST "https://matrix.kingnet.berlin/_matrix/client/r0/login" -H "Content-Type: application/json" -d '{"type": "m.login.password","user": "charls","password": "<somepass>"}' | jq
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 218 0 150 100 68 304 138 --:--:-- --:--:-- --:--:-- 443
{
"user_id": "@charls:kingnet.berlin",
"access_token": "<API key>",
"home_server": "kingnet.berlin",
"device_id": "NLYMLYCLRH"
}
Check Own User Name
mel@brh-tools01:/opt/docker-ha/netbox$ curl -X GET "https://matrix.kingnet.berlin/_matrix/client/v3/profile/@charls:kingnet.berlin" -H "Authorization: Bearer <APIT key>" -H "Content-Type: application/json" | jq
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 28 0 28 0 0 364 0 --:--:-- --:--:-- --:--:-- 368
{
"displayname": "KingCharls"
}
Update Own User Name
mel@brh-tools01:/opt/docker-ha/netbox$ curl -X PUT "https://matrix.kingnet.berlin/_matrix/client/v3/profile/@charls:kingnet.berlin/displayname" -H "Authorization: Bearer <API key>" -H "Content-Type: application/json" -d '{"displayname":"KingCharls_prime"}' | jq
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 36 0 2 100 34 1 30 0:00:01 0:00:01 --:--:-- 32
{}