Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Get a user by Id

Description

The GetById() method is used to get a user by user Id.

Package Details

Interface

IUserManager

Syntax

await _userManager.GetById(User user)

Returns

Task<User>

API

GET
/api/v1/users/{id}

Parameters

Parameter

Description

Parameter Type

id

The user Id

Path

Returns

On success, 200 Ok

If UserManage.GetById() returns null, 422 Unprocessable Entity

On error, 400 Bad Request

On authorization error, 403 Forbidden

Example

Code Block
int userId = 1;
await _userManager.GetById(userId);