Skip to content

Latest commit

 

History

History
572 lines (373 loc) · 13.8 KB

user.md

File metadata and controls

572 lines (373 loc) · 13.8 KB

User

user_controller = client.user

Class Name

UserController

Methods

Authenticate User

Authenticates a user.

def authenticate_user(self,
                     user_id,
                     pw,
                     password=None)

Parameters

Parameter Type Tags Description
user_id uuid|string Template, Required The user id.
pw string Query, Required The password as plain text.
password string Query, Optional The password sha1-hash.

Response Type

AuthenticationResult

Example Usage

user_id = '000013ec-0000-0000-0000-000000000000'
pw = 'pw0'

result = user_controller.authenticate_user(user_id, pw)

Errors

HTTP Status Code Error Description Exception Class
403 Sha1-hashed password only is not allowed. ProblemDetailsException
404 User not found. ProblemDetailsException

Authenticate User by Name

Authenticates a user by name.

def authenticate_user_by_name(self,
                             body)

Parameters

Parameter Type Tags Description
body AuthenticateUserByName Body, Required The M:Jellyfin.Api.Controllers.UserController.AuthenticateUserByName(Jellyfin.Api.Models.UserDtos.AuthenticateUserByName) request.

Response Type

AuthenticationResult

Example Usage

body = AuthenticateUserByName()

result = user_controller.authenticate_user_by_name(body)

Authenticate With Quick Connect

Authenticates a user with quick connect.

def authenticate_with_quick_connect(self,
                                   body)

Parameters

Parameter Type Tags Description
body QuickConnectDto Body, Required The Jellyfin.Api.Models.UserDtos.QuickConnectDto request.

Response Type

AuthenticationResult

Example Usage

body = QuickConnectDto()
body.secret = 'Secret6'

result = user_controller.authenticate_with_quick_connect(body)

Errors

HTTP Status Code Error Description Exception Class
400 Missing token. APIException

Create User by Name

Creates a user.

def create_user_by_name(self,
                       body)

Parameters

Parameter Type Tags Description
body CreateUserByName Body, Required The create user by name request body.

Response Type

UserDto

Example Usage

body = CreateUserByName()

result = user_controller.create_user_by_name(body)

Errors

HTTP Status Code Error Description Exception Class
401 Unauthorized APIException
403 Forbidden APIException

Delete User

Deletes a user.

def delete_user(self,
               user_id)

Parameters

Parameter Type Tags Description
user_id uuid|string Template, Required The user id.

Response Type

void

Example Usage

user_id = '000013ec-0000-0000-0000-000000000000'

result = user_controller.delete_user(user_id)

Errors

HTTP Status Code Error Description Exception Class
401 Unauthorized APIException
403 Forbidden APIException
404 User not found. ProblemDetailsException

Forgot Password

Initiates the forgot password process for a local user.

def forgot_password(self,
                   body)

Parameters

Parameter Type Tags Description
body ForgotPasswordDto Body, Required The forgot password request containing the entered username.

Response Type

ForgotPasswordResult

Example Usage

body = ForgotPasswordDto()
body.entered_username = 'EnteredUsername0'

result = user_controller.forgot_password(body)

Forgot Password Pin

Redeems a forgot password pin.

def forgot_password_pin(self,
                       body)

Parameters

Parameter Type Tags Description
body ForgotPasswordPinDto Body, Required The forgot password pin request containing the entered pin.

Response Type

PinRedeemResult

Example Usage

body = ForgotPasswordPinDto()
body.pin = 'Pin0'

result = user_controller.forgot_password_pin(body)

Get Current User

Gets the user based on auth token.

def get_current_user(self)

Response Type

UserDto

Example Usage

result = user_controller.get_current_user()

Errors

HTTP Status Code Error Description Exception Class
400 Token is not owned by a user. ProblemDetailsException
401 Unauthorized APIException
403 Forbidden APIException

Get Public Users

Gets a list of publicly visible users for display on a login screen.

def get_public_users(self)

Response Type

List of UserDto

Example Usage

result = user_controller.get_public_users()

Get User by Id

Gets a user by Id.

def get_user_by_id(self,
                  user_id)

Parameters

Parameter Type Tags Description
user_id uuid|string Template, Required The user id.

Response Type

UserDto

Example Usage

user_id = '000013ec-0000-0000-0000-000000000000'

result = user_controller.get_user_by_id(user_id)

Errors

HTTP Status Code Error Description Exception Class
401 Unauthorized APIException
403 Forbidden APIException
404 User not found. ProblemDetailsException

Get Users

Gets a list of users.

def get_users(self,
             is_hidden=None,
             is_disabled=None)

Parameters

Parameter Type Tags Description
is_hidden bool Query, Optional Optional filter by IsHidden=true or false.
is_disabled bool Query, Optional Optional filter by IsDisabled=true or false.

Response Type

List of UserDto

Example Usage

result = user_controller.get_users()

Errors

HTTP Status Code Error Description Exception Class
401 Unauthorized APIException
403 Forbidden APIException

Update User

Updates a user.

def update_user(self,
               user_id,
               body)

Parameters

Parameter Type Tags Description
user_id uuid|string Template, Required The user id.
body UserDto Body, Required The updated user model.

Response Type

void

Example Usage

user_id = '000013ec-0000-0000-0000-000000000000'
body = UserDto()

result = user_controller.update_user(user_id, body)

Errors

HTTP Status Code Error Description Exception Class
400 User information was not supplied. ProblemDetailsException
401 Unauthorized APIException
403 User update forbidden. ProblemDetailsException

Update User Configuration

Updates a user configuration.

def update_user_configuration(self,
                             user_id,
                             body)

Parameters

Parameter Type Tags Description
user_id uuid|string Template, Required The user id.
body UserConfiguration Body, Required The new user configuration.

Response Type

void

Example Usage

user_id = '000013ec-0000-0000-0000-000000000000'
body = UserConfiguration()

result = user_controller.update_user_configuration(user_id, body)

Errors

HTTP Status Code Error Description Exception Class
401 Unauthorized APIException
403 User configuration update forbidden. ProblemDetailsException

Update User Easy Password

Updates a user's easy password.

def update_user_easy_password(self,
                             user_id,
                             body)

Parameters

Parameter Type Tags Description
user_id uuid|string Template, Required The user id.
body UpdateUserEasyPassword Body, Required The M:Jellyfin.Api.Controllers.UserController.UpdateUserEasyPassword(System.Guid,Jellyfin.Api.Models.UserDtos.UpdateUserEasyPassword) request.

Response Type

void

Example Usage

user_id = '000013ec-0000-0000-0000-000000000000'
body = UpdateUserEasyPassword()

result = user_controller.update_user_easy_password(user_id, body)

Errors

HTTP Status Code Error Description Exception Class
401 Unauthorized APIException
403 User is not allowed to update the password. ProblemDetailsException
404 User not found. ProblemDetailsException

Update User Password

Updates a user's password.

def update_user_password(self,
                        user_id,
                        body)

Parameters

Parameter Type Tags Description
user_id uuid|string Template, Required The user id.
body UpdateUserPassword Body, Required The M:Jellyfin.Api.Controllers.UserController.UpdateUserPassword(System.Guid,Jellyfin.Api.Models.UserDtos.UpdateUserPassword) request.

Response Type

void

Example Usage

user_id = '000013ec-0000-0000-0000-000000000000'
body = UpdateUserPassword()

result = user_controller.update_user_password(user_id, body)

Errors

HTTP Status Code Error Description Exception Class
401 Unauthorized APIException
403 User is not allowed to update the password. ProblemDetailsException
404 User not found. ProblemDetailsException

Update User Policy

Updates a user policy.

def update_user_policy(self,
                      user_id,
                      body)

Parameters

Parameter Type Tags Description
user_id uuid|string Template, Required The user id.
body UserPolicy Body, Required The new user policy.

Response Type

void

Example Usage

user_id = '000013ec-0000-0000-0000-000000000000'
body = UserPolicy()

result = user_controller.update_user_policy(user_id, body)

Errors

HTTP Status Code Error Description Exception Class
400 User policy was not supplied. ProblemDetailsException
401 Unauthorized APIException
403 User policy update forbidden. ProblemDetailsException