synapse-admin icon indicating copy to clipboard operation
synapse-admin copied to clipboard

Admin API - Command Not Found

Open belascoain opened this issue 2 years ago • 5 comments

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

belascoain avatar Oct 03 '22 09:10 belascoain

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>

dklimpel avatar Oct 03 '22 09:10 dklimpel

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:

404 - No Such Resource

No Such Resource

Sorry. No luck finding that resource.

belascoain avatar Oct 03 '22 14:10 belascoain

Please read the docs.

GET /_synapse/admin/v2/users/<user_id>

The Admin API URLs start with /_synapse/admin/ and NOT /_matrix/admin/!

dklimpel avatar Oct 03 '22 15:10 dklimpel

Hi

Sorry. But the result is the same

`curl -XGET "https://MYSERVER/_synapse/admin/v2/users/@MYUSER"

404 - No Such Resource

No Such Resource

No such child resource.

`

belascoain avatar Oct 04 '22 07:10 belascoain

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

dklimpel avatar Oct 04 '22 19:10 dklimpel

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

sigma2017 avatar Oct 18 '22 20:10 sigma2017

IMO this issue is stale and fixed.

dklimpel avatar Feb 06 '24 21:02 dklimpel