mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 05:49:16 +01:00
feat(api): ✨ Add new endpoint to get a user by its username
This commit is contained in:
parent
407eb5e205
commit
be881f18cd
9 changed files with 124 additions and 3 deletions
|
|
@ -219,3 +219,21 @@ This request is authenticated with the user's Mastodon API access token.
|
|||
}
|
||||
```
|
||||
|
||||
## Get User By Username
|
||||
|
||||
Gets a user by their username.
|
||||
|
||||
```http
|
||||
GET /api/v1/users/id?username=myCoolUser
|
||||
```
|
||||
|
||||
### Response
|
||||
|
||||
Returns an account object.
|
||||
|
||||
```ts
|
||||
// 200 OK
|
||||
{
|
||||
id: string;
|
||||
// Account object
|
||||
}
|
||||
|
|
@ -50,12 +50,13 @@ Contains the same extensions as `/api/v1/instance`, except `banner` which uses t
|
|||
|
||||
(`/api/v1/accounts/:id`, `/api/v1/accounts/verify_credentials`, ...)
|
||||
|
||||
An extra attribute has been adding to all returned account objects:
|
||||
Two extra attributes has been adding to all returned account objects:
|
||||
|
||||
```ts
|
||||
{
|
||||
// ...
|
||||
roles: LysandRoles[];
|
||||
uri: string;
|
||||
}
|
||||
```
|
||||
|
||||
|
|
@ -63,7 +64,11 @@ An extra attribute has been adding to all returned account objects:
|
|||
|
||||
An array of roles from [Lysand Roles](./roles.md).
|
||||
|
||||
### `/api/v1/accounts/update_credentials`
|
||||
### `uri`
|
||||
|
||||
The URI of the account's Lysand object (for federation). Similar to Mastodon's `uri` field on notes.
|
||||
|
||||
## `/api/v1/accounts/update_credentials`
|
||||
|
||||
The `username` parameter can now (optionally) be set to change the user's handle.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue