synapse-admin
synapse-admin copied to clipboard
Admin API - Command Not Found
Hi,
I'm trying to use admin API in our Matrix Server using curl command, but all commands that I use give the same result:
Error 404
I can use Client API withount problems.
For example:
I can create a new room:
curl -XPOST -d '{"room_alias_name":"test"}' "https://MY_SERVER/_matrix/client/r0/createRoom**********
But I can't delete it
curl -X "DELETE" "https://MY_SERVER/_matrix/admin/v1/rooms/test"
It's like my Admin API isn't where it should, or it wasn't enabled
How can I check that admin API is enable?
Regards
curl -X "DELETE" "https://MY_SERVER/_matrix/admin/v1/rooms/test"
You uses the a wrong URL. See: https://matrix-org.github.io/synapse/latest/admin_api/rooms.html#version-2-new-version
DELETE /_synapse/admin/v2/rooms/<room_id>
Sorry. But it doesn't work for me.
I've tried to get info about my user
curl -XGET "https://MYSERVER/_matrix/admin/v2/users/@MY_USER"
This is the response:
No Such Resource
Sorry. No luck finding that resource.
Please read the docs.
GET /_synapse/admin/v2/users/<user_id>
The Admin API URLs start with /_synapse/admin/ and NOT /_matrix/admin/!
Hi
Sorry. But the result is the same
`curl -XGET "https://MYSERVER/_synapse/admin/v2/users/@MYUSER"
No Such Resource
No such child resource.
`
Do you have added /_synapse/admin
to your reverse proxy configuration?
Info: https://matrix-org.github.io/synapse/latest/reverse_proxy.html#synapse-administration-endpoints
Related to: https://github.com/Awesome-Technologies/synapse-admin/issues/88#issuecomment-1068838894
To get the token which starts with "syt": curl -X POST -d '{"type":"m.login.password", "user":"user", "password":" mypassword"}' "http://127.0.0.1:8008/_matrix/client/r0/login"
curl --header "Authorization: Bearer syt_xxxxx_xxxxxxxxxx_xxx" -X GET http://127.0.0.1:8008/_synapse/admin/v2/users?from=0
IMO this issue is stale and fixed.