Add /account/whoami endpoint
This commit is contained in:
parent
d5b6e7e322
commit
e9febfedbc
@ -5,3 +5,4 @@ pub mod deactivate;
|
||||
pub mod register;
|
||||
pub mod request_password_change_token;
|
||||
pub mod request_register_token;
|
||||
pub mod whoami;
|
||||
|
22
src/r0/account/whoami.rs
Normal file
22
src/r0/account/whoami.rs
Normal file
@ -0,0 +1,22 @@
|
||||
//! [GET /_matrix/client/r0/account/whoami](https://matrix.org/docs/spec/client_server/r0.4.0.html#get-matrix-client-r0-account-whoami)
|
||||
|
||||
use ruma_api_macros::ruma_api;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
ruma_api! {
|
||||
metadata {
|
||||
description: "Get information about the owner of a given access token.",
|
||||
method: GET,
|
||||
name: "whoami",
|
||||
path: "/_matrix/client/r0/account/whoami",
|
||||
rate_limited: true,
|
||||
requires_authentication: true,
|
||||
}
|
||||
|
||||
request {}
|
||||
|
||||
response {
|
||||
/// The id of the user that owns the access token.
|
||||
pub user_id: String,
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user